query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Store a newly created resource in storage.
public function save_field(Request $request) { Log::info("TransactionController->save_field :- Inside "); $organization_id = Session::get('organization_id'); $transaction_type = AccountVoucher::where('name', $request->input('type'))->where('organization_id', $organization_id)->first(); $field_item = $request->input('field_item'); $field = new TransactionField; $field->name = $request->input('field_name'); $field->field_type_id = $request->input('field_type'); $field->field_format_id = $request->input('field_format'); $field->transaction_type_id = $transaction_type->id; $field->status = $request->input('check_type'); $field->required_status = $request->input('required_status'); $field->sub_heading = $request->input('new_group'); $field->save(); if($field->id != null) { for($i=0; $i<count($field_item); $i++) { if($field_item[$i] != null) { $group = new TransactionField; $group->name = $field_item[$i]; $group->transaction_type_id = $transaction_type->id; $group->group_id = $field->id; $group->save(); } } } Log::info("TransactionController->save_field :- Return "); return response()->json(array('status' => 1, 'message' => 'Transaction Field'.config('constants.flash.added'), 'data' => ['id' => $field->id, 'name' => $field->name, 'field_type_id' => $field->field_type_id, 'field_format_id' => $field->field_format_id, 'transaction_type_id' => $field->transaction_type_id, 'status' => $field->status, 'required_status' => $field->required_status, 'sub_heading' => $field->sub_heading])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Takes data to corresponding page
public function add_to_account(Request $request) { Log::info("TransactionController->add_to_account :- Inside Datas are".json_encode($request->all())); //dd($request->all()); $module_name = Session::get('module_name'); $type = $request->type; Log::info("TransactionController->add_to_account :- Transaction Type Datas are".$type); $from = $request->from; $notification_type = $request->notification_type; $organization_id = Session::get('organization_id'); $person_id = Auth::user()->person_id; $selected_employee = HrmEmployee::select('hrm_employees.id') ->where('hrm_employees.organization_id', $organization_id) ->where('hrm_employees.person_id', $person_id) ->first()->id; $tomorrow = Carbon::tomorrow(); $tomorrow_date = $tomorrow->format('d-m-Y'); $country = Country::where('name', 'India')->first(); $state = State::where('country_id', $country->id)->pluck('name', 'id'); $state->prepend('Select State', ''); $city = City::orderBy('name')->orderby('name')->pluck('name', 'id'); $city->prepend('Select State', ''); $title = PeopleTitle::pluck('display_name','id'); $title->prepend('Title',''); /* WMS - Records */ $vehicle_sevice_type = ServiceType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_sevice_type->prepend('Select Service type', ''); $job_card_status = VehicleJobcardStatus::where('status', '1')->pluck('name', 'id'); $job_card_status->prepend('Select Jobcard Status', ''); $vehicle_make_id = VehicleMake::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_make_id->prepend('Select Vehicle Make', ''); $vehicle_model_id = VehicleModel::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_model_id->prepend('Select Vehicle Model', ''); $vehicle_tyre_size = VehicleTyreSize::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_tyre_size->prepend('Select Tyre Size', ''); $vehicle_tyre_type = VehicleTyreType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_tyre_type->prepend('Select Tyre Type', ''); //$vehicle_variant = VehicleVariant::where('organization_id', $organization_id)->orderBy('name')->pluck('name', 'id'); //$vehicle_variant->prepend('Select Vehicle Variant', ''); $vehicle_variant = VehicleVariant::orderBy('name')->pluck('name', 'id'); $vehicle_variant->prepend('Select Vehicle Variant', ''); $vehicle_wheel = VehicleWheel::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_wheel->prepend('Select Vehicle Wheel', ''); $fuel_type = VehicleFuelType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $fuel_type->prepend('Select Fuel Type', ''); $rim_type = VehicleRimType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $rim_type->prepend('Select Rim Type', ''); $body_type = VehicleBodyType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $body_type->prepend('Select Body Type', ''); $vehicle_category = VehicleCategory::where('organization_id', $organization_id)->orderBy('name')->pluck('name', 'id'); $vehicle_category->prepend('Select Vehicle Category', ''); $vehicle_drivetrain = VehicleDrivetrain::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_drivetrain->prepend('Select Vehicle Drivetrain', ''); $service_type = ServiceType::where('organization_id', $organization_id)->orderBy('name')->pluck('name', 'id'); $service_type->prepend('Select Service Type', ''); $vehicle_usage = VehicleUsage::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_usage->prepend('Select Vehicle Usage', ''); $maintanance_reading = VehicleMaintenanceReading::where('status', '1')->pluck('name', 'id'); $maintanance_reading->prepend('Select Maintenance Reading', ''); /*$vehicles_register = VehicleRegisterDetail::where('organization_id', $organization_id)->pluck('registration_no', 'id'); $vehicles_register->prepend('Select Vehicle', '');*/ $vehicles_register = VehicleRegisterDetail::leftjoin('wms_vehicle_organizations','wms_vehicle_organizations.vehicle_id','=','vehicle_register_details.id')->where('wms_vehicle_organizations.organization_id', $organization_id)->pluck('registration_no', 'vehicle_register_details.id'); $vehicles_register->prepend('Select Vehicle', ''); $reading_factor = WmsReadingFactor::select('wms_reading_factors.id AS reading_factor_id', 'wms_reading_factors.name AS reading_factor_name', 'wms_applicable_divisions.id AS wms_division_id', 'wms_applicable_divisions.division_name') ->leftJoin('wms_applicable_divisions', 'wms_applicable_divisions.id','=','wms_reading_factors.wms_division_id') ->where('wms_reading_factors.organization_id', $organization_id)->get(); /* END Records */ $voucher_terms = Term::select('id', 'name', 'display_name', 'days')->where('organization_id', $organization_id)->get(); $terms = Term::select('id', 'display_name')->where('organization_id', $organization_id)->pluck('display_name', 'id'); $terms->prepend('Select Term',''); $selected_term = Term::where('organization_id', $organization_id)->where('name', 'on_receipt')->first(); $make = VehicleMake::where('status', 1)->orWhere('organization_id', $organization_id)->pluck('display_name', 'id'); $make->prepend('Select Make', ''); $job_type = JobType::where('status', 1)->orWhere('organization_id', $organization_id)->pluck('display_name', 'id'); $payment = PaymentMode::where('status', '1')->pluck('display_name','id'); $payment->prepend('Select Payment Method',''); $payment_terms = PaymentTerm::where('status', '1')->pluck('display_name','id'); $payment_terms->prepend('Select Payment Term ',''); $payment_term = PaymentTerm::where('name', 'Immediate')->first()->id; $shipment_mode = ShipmentMode::where('organization_id', $organization_id)->pluck('name', 'id'); $shipment_mode->prepend('Select Shipment Mode', ''); //$selected_payment_method = ReferenceVoucher::where('name', $type)->first()->id; $transaction = Transaction::find($request->id); Log::info("TransactionController->add_to_account :- get transaction data add_to_account::add_to_account - ".json_encode($transaction)); $stock_item_update = TransactionItem::where('transaction_id', $transaction->id)->first(); $cus_name = ($transaction->name.'-'.$transaction->mobile); //$transaction = Transaction::find($request->id)->where('organization_id',$organization_id)->first(); //dd($transaction); $wms_transaction = WmsTransaction::select('wms_transactions.id','wms_transactions.registration_id','wms_transactions.vehicle_mileage','wms_transactions.service_type','wms_transactions.jobcard_status_id','wms_transactions.purchase_date','vehicle_register_details.*','wms_transactions.next_visit_mileage','wms_transactions.vehicle_next_visit','wms_transactions.vehicle_next_visit_reason','wms_transactions.name as name_of_job','wms_transactions.job_date','wms_transactions.job_due_date','wms_transactions.job_completed_date','wms_transactions.vehicle_note','wms_transactions.advance_amount','vehicle_variants.vehicle_configuration','wms_transactions.vehicle_complaints','wms_transactions.driver','wms_transactions.driver_contact') ->leftjoin('vehicle_register_details', 'vehicle_register_details.id', '=', 'wms_transactions.registration_id') ->leftjoin('vehicle_variants','vehicle_variants.id','=','vehicle_register_details.vehicle_configuration_id') ->where('wms_transactions.organization_id', $organization_id) ->where('wms_transactions.transaction_id', $transaction->id) ->first(); if($wms_transaction != null){ $spec_values = RegisteredVehicleSpec::select('registered_vehicle_specs.spec_id','vehicle_spec_masters.display_name', 'registered_vehicle_specs.spec_value') ->leftjoin('vehicle_spec_masters','vehicle_spec_masters.id','=','registered_vehicle_specs.spec_id') ->where('registered_vehicle_specs.organization_id',$organization_id) ->where('registered_vehicle_specs.registered_vehicle_id',$wms_transaction->registration_id) ->get(); }else{ $spec_values = null; } /*$module_type = AccountVoucherType::select('account_vouchers.*', 'modules.name AS module') ->leftjoin('module_voucher', 'module_voucher.voucher_type_id', '=', 'account_voucher_types.id') ->leftjoin('account_vouchers', 'account_vouchers.voucher_type_id', '=', 'account_voucher_types.id') ->leftjoin('modules', 'modules.id', '=', 'module_voucher.module_id') ->where('account_vouchers.organization_id', $organization_id) ->where('account_vouchers.id', $transaction->transaction_type_id) ->first();*/ /*$transaction_type = AccountVoucherType::select('account_vouchers.*', 'modules.name AS module') ->leftjoin('module_voucher', 'module_voucher.voucher_type_id', '=', 'account_voucher_types.id') ->leftjoin('account_vouchers', 'account_vouchers.voucher_type_id', '=', 'account_voucher_types.id') ->leftjoin('modules', 'modules.id', '=', 'module_voucher.module_id') ->where('account_vouchers.organization_id', $organization_id) ->where('modules.name', Session::get('module_name')) ->where('account_vouchers.id', $transaction->transaction_type_id) ->first();*/ //$module_type = Session::get('module_name'); //dd($transaction_type); /*if($module_type == null) { return null; }*/ $selected_payment = null; if($transaction->payment_mode_id != null) { $selected_payment = PaymentMode::find($transaction->payment_mode_id)->id; } $selected_shipment = null; if($transaction->shipment_mode_id != '') { $selected_shipment = ShipmentMode::find($transaction->shipment_mode_id)->id; } $transaction_type = AccountVoucher::find($transaction->transaction_type_id); $reference_voucher = ReferenceVoucher::select('name', 'display_name', 'id')->where('name', $transaction_type->name)->where('status', 1)->get(); $remote_reference_no = $transaction->order_no; $remote_order_id = $transaction->id; //$remote_item_voucher = null; //Transaction from same company (Copying) if($request->notification_type == "copy") { $remote_item_voucher = null; if($transaction->user_type == 0) { $reference_business = Person::find($transaction->people_id)->id; $reference_business_name = Person::find($transaction->people_id)->first_name; } else { $reference_business_data = Business::find($transaction->people_id); $reference_business = $reference_business_data->id; $reference_business_name = $reference_business_data->alias; } $customer_name = $transaction->name; $customer_mobile = $transaction->mobile; $customer_email = $transaction->email; $customer_gst = $transaction->gst; $customer_address = $transaction->address; } //Transaction from another company (Notification) else if($request->notification_type == "remote") { /*Usually whatever company made the transaction it will be considered as vendor or customer in the current company. e.g. If it is a purchase order it would turns into sale order The company which made the PO is the vendor and vice versa If it is a invoice The company which made the Invoice is the customer */ /* get remote item voucher type */ $query = TransactionItem::select('inventory_items.id', 'global_item_models.id AS global_id', 'global_item_models.name AS global_name', 'transaction_items.description', 'transaction_items.quantity', 'transaction_items.rate', 'transaction_items.amount', 'tax_groups.id AS tax_id', 'transaction_items.discount', 'transaction_items.discount_id', DB::raw('COALESCE(transaction_items.discount_value, "") AS discount_value'),'transaction_items.start_time','transaction_items.end_time','transaction_items.assigned_employee_id','transaction_items.job_item_status','inventory_item_stocks.in_stock','inventory_items.base_price','inventory_items.purchase_price','inventory_items.sale_price_data','transaction_items.item_id','global_item_category_types.id AS main_category_id','global_item_category_types.name AS category_name','account_vouchers.name AS voucher_type'); $query->leftjoin('inventory_items AS remote_item', 'remote_item.id', '=', 'transaction_items.item_id'); $query->leftjoin('inventory_item_stocks', 'inventory_item_stocks.id', '=', 'remote_item.id' ); $query->leftjoin('inventory_items', function($query) use ($organization_id) { $query->on('inventory_items.global_item_model_id', '=', 'remote_item.global_item_model_id'); $query->where('inventory_items.organization_id', '=', $organization_id); }); $query->leftjoin('global_item_models', 'global_item_models.id', '=', 'remote_item.global_item_model_id'); $query->leftjoin('tax_groups AS transaction_item_tax', 'transaction_item_tax.id', '=', 'transaction_items.tax_id'); $query->leftjoin('tax_groups', function($query1) use ($organization_id) { $query1->on('tax_groups.name', '=', 'transaction_item_tax.name'); $query1->where('tax_groups.organization_id', '=', $organization_id); }); $query->leftjoin('global_item_categories', 'global_item_categories.id', '=', 'global_item_models.category_id'); $query->leftjoin('global_item_main_categories', 'global_item_main_categories.id', '=', 'global_item_categories.main_category_id'); $query->leftjoin('global_item_category_types', 'global_item_category_types.id', '=', 'global_item_main_categories.category_type_id'); $query->leftjoin('transactions', 'transactions.id', '=', 'transaction_items.transaction_id'); $query->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id'); $query->where('transaction_items.transaction_id', $request->id); $transaction_items = $query->get(); foreach ($transaction_items as $key => $value) { $remote_item_voucher = $transaction_items[$key]->voucher_type; } //dd($remote_item_voucher); if($transaction->user_type == 0) { $reference_business = Person::find($transaction->people_id)->id; $reference_business_name = Person::find($transaction->people_id)->first_name; } else { //The organization which made the transaction $organization = Organization::find($transaction->organization_id); $reference_business_data = Business::select('businesses.id', 'businesses.alias', 'business_communication_addresses.mobile_no', 'business_communication_addresses.email_address', 'business_communication_addresses.address') ->leftjoin('business_communication_addresses', 'business_communication_addresses.business_id', '=', 'businesses.id') ->where('businesses.id', $organization->business_id)->first(); $reference_business = $reference_business_data->id; $reference_business_name = $reference_business_data->alias; } if($type == "purchase_order" || $type == "purchases" || $type == "goods_receipt_note" || $type == "debit_note") { $customer_name = $reference_business_data->alias; $customer_mobile = $reference_business_data->mobile_no; $customer_email = $reference_business_data->email_address; $customer_address = $reference_business_data->address; } else { //$customer_name = $transaction->billing_name; //$customer_mobile = $transaction->billing_mobile; //$customer_email = $transaction->billing_email; //$customer_address = $transaction->billing_address; $customer_name = $reference_business_data->alias; $customer_mobile = $reference_business_data->mobile_no; $customer_email = $reference_business_data->email_address; $customer_address = $reference_business_data->address; } } $reference_user_type = 1; $people_list = People::select('person_id AS id', DB::raw('IF(mobile_no, CONCAT(display_name, " - " , mobile_no), display_name) AS name'), 'person_id')->where('user_type', 0)->where('organization_id', Session::get('organization_id')); $business_list = People::select('business_id AS id', DB::raw('IF(mobile_no, CONCAT(display_name, " - " , mobile_no), display_name) AS name'), 'business_id')->where('user_type', 1)->where('organization_id', Session::get('organization_id')); $transaction_type = AccountVoucher::where('name', $type)->where('organization_id', $organization_id)->first(); Log::info("TransactionController->add_to_account :-get transaction_type LineNo 1852 - ".json_encode($transaction_type)); //dd($transaction_type); // $previous_entry = Transaction::where('transaction_type_id', $transaction_type->id)->where('organization_id', $organization_id)->orderby('id', 'desc')->first(); // if($request->gen_no){ // $gen_no = $request->gen_no; // }else{ // $gen_no = ($previous_entry != null) ? ($previous_entry->gen_no + 1) : $transaction_type->starting_value; // } $getGen_no=Custom::getLastGenNumber( $transaction_type->id, $organization_id ); //$gen_no=($getGen_no) ? $getGen_no : $transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } $voucher_no = Custom::generate_accounts_number($transaction_type->name, $gen_no, false); $sale_account = AccountGroup::where('name', 'sale_account')->where('organization_id', $organization_id)->first()->id; $account_ledgers = AccountLedger::where('group_id', $sale_account)->where('organization_id', $organization_id)->pluck('name', 'id'); $account_ledgers->prepend('Select Account', ''); $employees = HrmEmployee::select('hrm_employees.id', DB::raw('CONCAT(first_name, " ", COALESCE(last_name, "")) AS name'))->where('organization_id', $organization_id)->pluck('name', 'id'); $employees->prepend('Select Sales Person', ''); $items = InventoryItem::select('inventory_items.id', 'inventory_items.name', 'global_item_categories.display_name AS category', 'inventory_items.include_tax', 'inventory_items.include_purchase_tax') ->leftjoin('global_item_models', 'global_item_models.id', '=', 'inventory_items.global_item_model_id') ->leftjoin('global_item_categories','global_item_categories.id','=','global_item_models.category_id') ->where('inventory_items.organization_id', $organization_id) ->where('inventory_items.status', 1) ->orderby('global_item_categories.display_name') ->get(); /*$tax = TaxGroup::select('tax_groups.id', 'tax_groups.display_name', 'tax_types.name as tax_type', DB::raw('SUM(taxes.value) AS value')); $tax->leftjoin('tax_types', 'tax_types.id', '=', 'tax_groups.tax_type_id'); $tax->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id'); $tax->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id'); $tax->where('tax_groups.organization_id', $organization_id);*/ $tax = TaxGroup::select('tax_groups.id', 'tax_groups.display_name', 'tax_types.name as tax_type', DB::raw('SUM(taxes.value) AS value'),'taxes.id as tax_id', 'taxes.display_name AS tax_name', DB::raw("CONCAT('[', GROUP_CONCAT('{', '\"id\":', taxes.id, ',', '\"name\": ', '\"',taxes.name,'\"', ',', '\"value\":', taxes.value, '}'),']') AS tax_value")); $tax->leftjoin('tax_types', 'tax_types.id', '=', 'tax_groups.tax_type_id'); $tax->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id'); $tax->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id'); $tax->where('tax_groups.organization_id', $organization_id); $tax->groupby('tax_groups.id'); $taxes = $tax->get(); $discount = Discount::select('id', 'display_name', 'value'); $discount->where('status', 1)->where('organization_id', $organization_id); $discounts = $discount->get(); $weekdays = Weekday::pluck('display_name','id'); $weekday = Weekday::where('name','monday')->first()->id; $days = []; for ($i=1; $i <= 28; $i++) { $days[$i] = $i; } $days[0] = "Last"; if($transaction_type == null) abort(404); $address_type = BusinessAddressType::where('name', 'business')->first(); $business_id = Organization::find($organization_id)->business_id; $business_communication_address = BusinessCommunicationAddress::select('business_communication_addresses.placename', 'business_communication_addresses.mobile_no', 'business_communication_addresses.email_address', 'business_communication_addresses.address', 'cities.name AS city', 'states.name AS state', 'business_communication_addresses.pin') ->leftjoin('cities', 'business_communication_addresses.city_id', '=', 'cities.id') ->leftjoin('states', 'cities.state_id', '=', 'states.id') ->where('address_type', $address_type->id) ->where('business_id', $business_id) ->first(); $date_label = null; $due_date_label = null; $term_label = null; $order_type = null; $address_label = null; $order_type_value = []; $order_label = null; $payment_label = null; $sales_person_label = null; $include_tax_label = null; $customer_type_label = null; $customer_label = null; $discount_option = false; $person_type = null; $due_date = null; $transaction_address_type = null; $company_label = false; $company_name = null; $company_email = null; $company_mobile = null; $company_address = null; $service_type_label = null; $business_company_address = $business_communication_address->address; if($business_communication_address->address != "" && $business_communication_address->city != "") { $business_company_address .= "\n"; } $business_company_address .= $business_communication_address->city; if($business_communication_address->city != "" && $business_communication_address->state != "") { $business_company_address .= "\n"; } $business_company_address .= $business_communication_address->state." ".$business_communication_address->pin; switch($type) { case 'estimation': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct'))->where('status', 1)->orderby('id')->get(); //$order_type_value = AccountVoucher::whereIn('name', array('Direct'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); //$order_type_value->prepend('Direct', ''); $due_date_label = 'Expiry Date'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $due_date = Carbon::now()->addDays(30)->format('d-m-Y'); $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'sale_order': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'estimation'))->where('status', 1)->orderby('id')->get(); $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'sales': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'sale_order', 'estimation'))->where('status', 1)->orderby('id')->get(); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sale_order', 'estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'sales_cash': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sale_order', 'estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_card': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'estimation'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; //$order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_request': $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $term_label = 'Terms'; $service_type_label = 'Service Type'; $address_label = 'Customer Address'; $due_date_label = 'Expiry Date'; $sales_person_label = 'Attended By'; $date_label = 'Date'; $due_date = Carbon::now()->addDays(30)->format('d-m-Y'); $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_invoice': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'sale_order', 'estimation'))->where('status', 1)->orderby('id')->get(); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $service_type_label = 'Service Type'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_invoice_cash': $address_label = 'Customer Address'; $service_type_label = 'Service Type'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'sale_order', 'estimation'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $due_date_label = 'Payment Due Date'; $term_label = 'Payment Terms'; $order_type = "Order Type"; $order_label = 'Job Card Number#'; $payment_label = 'Payment Method'; $sales_person_label = 'Invoice By'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'delivery_note': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('sale_order', 'sales','sales_cash'))->where('status', 1)->orderby('name', 'desc')->get(); $order_label = 'Order#'; $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sale_order', 'sales', 'sales_cash','job_invoice','job_invoice_cash'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $payment_label = 'Payment Method'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'receipt': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('sales'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sales'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); break; case 'payment': $address_label = 'Vendor Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('purchases'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchases'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Vendor Type'; $customer_label = 'Vendor'; $person_type = "vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Vendor', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $company_label = true; $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'credit_note': $address_label = 'Customer Address'; $order_type = "Order Type"; //$reference_voucher = $reference_vouchers->whereIn('name', array('sales', 'delivery_note'))->where('status', 1)->orderby('id')->get(); $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sales', 'delivery_note'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); break; case 'purchase_order': $address_label = 'Supplier Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct'))->where('status', 1)->orderby('id')->get(); $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Supplier Type'; $customer_label = 'Supplier'; $person_type = "Vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Supplier', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'purchases': $address_label = 'Supplier Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'purchase_order'))->where('status', 1)->orderby('id')->get(); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchase_order', 'estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Supplier Type'; $customer_label = 'Supplier'; $person_type = "Vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Supplier', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $discount_option = true; $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'debit_note': $address_label = 'Vendor Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('purchases', 'goods_receipt_note'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchases', 'goods_receipt_note'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Vendor Type'; $customer_label = 'Vendor'; $person_type = "vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Vendor', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'goods_receipt_note': $address_label = 'Vendor Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('purchase_order', 'purchases'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchase_order', 'purchases'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_label = 'Order#'; $payment_label = 'Payment Method'; $date_label = 'Date'; $customer_type_label = 'Vendor Type'; $customer_label = 'Vendor'; $person_type = "vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Vendor', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $discount_option = true; $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; } $field_types = FieldType::select('field_types.id', 'field_types.display_name', 'field_types.name', 'field_formats.id AS format_id', 'field_formats.name AS format') ->leftjoin('field_formats', 'field_formats.id', '=', 'field_types.field_format_id') ->get(); $transaction_fields = TransactionField::select('transaction_fields.id', 'transaction_fields.name', 'field_formats.name as field_format', 'field_types.name as field_type', 'transaction_fields.field_format_id', 'transaction_fields.field_type_id', DB::Raw('GROUP_CONCAT(group_fields.name SEPARATOR "`")as group_name'), 'transaction_fields.sub_heading') ->leftjoin('field_formats', 'field_formats.id', '=', 'transaction_fields.field_format_id') ->leftjoin('field_types', 'field_types.id', '=', 'transaction_fields.field_type_id') ->leftjoin('transaction_fields as group_fields', 'group_fields.group_id', '=', 'transaction_fields.id') ->where('transaction_fields.transaction_type_id', $transaction_type->id) ->where('transaction_fields.status', 1) ->groupby('transaction_fields.id') ->orderby('transaction_fields.sub_heading') ->get(); $sub_heading = TransactionField::select(DB::Raw('DISTINCT(transaction_fields.sub_heading)'))->whereNotNull('transaction_fields.sub_heading')->get(); $selected_make = null; $model = ['' => 'Select Model']; $reference_transaction_type = null; $reference_transaction = Transaction::find($transaction->reference_id); if($reference_transaction != null) { $reference_transaction_account = AccountVoucher::find($reference_transaction->transaction_type_id); if($reference_transaction_account != null) { $reference_transaction_type = $reference_transaction_account->name; } } // exit; $group_name = CustomerGroping::where('organization_id', $organization_id)->pluck('name', 'id'); $group_name->prepend('Select Group Name', ''); Log::info("TransactionController->add_to_account :- Return "); return view('inventory.transaction_add_account', compact('people', 'business', 'voucher_no','gen_no','account_ledgers', 'employees', 'shipment_mode', 'items', 'taxes', 'discounts', 'transaction_type', 'state', 'title', 'payment', 'terms', 'voucher_terms', 'weekdays', 'days', 'weekday', 'type', 'due_date_label', 'term_label', 'order_label', 'payment_label', 'sales_person_label', 'include_tax_label', 'date_label', 'customer_type_label', 'customer_label', 'person_type', 'field_types', 'transaction_fields', 'make', 'selected_make', 'model', 'job_type', 'sub_heading', 'discount_option', 'due_date', 'order_type', 'order_type_value', 'address_label', 'transaction_address_type', 'company_name', 'company_email', 'company_mobile', 'company_address', 'company_label', 'reference_voucher', 'transaction', 'selected_payment', 'reference_business', 'reference_user_type', 'reference_business_name', 'customer_name', 'customer_mobile', 'customer_email','customer_gst', 'customer_address', 'remote_reference_no', 'remote_order_id','selected_employee','selected_shipment', 'notification_type','service_type_label','vehicle_make_id', 'vehicle_model_id', 'vehicle_tyre_size', 'vehicle_tyre_type', 'vehicle_variant', 'vehicle_wheel', 'fuel_type', 'rim_type', 'body_type', 'vehicle_category', 'vehicle_drivetrain','service_type', 'vehicle_usage', 'maintanance_reading', 'vehicles_register','reading_factor','wms_transaction','vehicle_sevice_type','job_card_status','payment_terms','tomorrow_date','reference_transaction_type','remote_item_voucher','group_name','spec_values','module_name','from','city','cus_name','stock_item_update','selected_term','payment_term')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPageData();", "function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }", "public function getExtraPageData();", "public function getData(): ContuctUsPage;", "public function getDataWithTypePage() {}", "function processPageData() {\n\n $this->dataLayer=new ClsDataLayer();\n\n $this->cookieOk = $this->checkAuthCookie();\n\n if ($this->cookieOk == 1) {\n\n $this->weeks = $this->getWeeks();\n $this->years = $this->getYears();\n\n $this->processPostData();\n\n $this->payrollDataCalculated = $this->generatePayrollDataCalculated();\n\n }\n else {\n $this->cookieNotOkText = $this->getCookieNotOkText();\n }\n\n }", "protected function setupPage() {}", "function page()\n {\n $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n # print_r($data);\n # exit();\n\n #Get the paginated list of the news items\n $data = add_msg_if_any($this, $data);\n\n //if user has permission\n if (check_user_access($this, 'view_procurement_plans')) \n {\n $search_str = '';\n if($this->session->userdata('isadmin') == 'N')\n {\n $userdata = $this->db->get_where('users', array('userid'=>$this->session->userdata('userid')))->result_array();\n $search_str = ' AND PP.pde_id=\"'. $userdata[0]['pde'] .'\"';\n }\n \n \n #Get the paginated list of plans\n $data['procurement'] = paginate_list($this, $data, 'procurement_plans', array('orderby'=>'PP.financial_year DESC', 'searchstring'=>$search_str));\n #exit($this->db->last_query());\n $data['page_title'] = 'Manage procurement plans';\n $data['current_menu'] = 'view_procurement_plans';\n $data['view_to_load'] = 'procurement/admin/all_procurement_plans_v';\n $data['view_data']['form_title'] = $data['page_title'];\n $this->load->view('dashboard_v', $data);\n \n } else {\n //load access denied page\n load_restriction_page();\n\n }\n\n\n }", "protected function getPage() {}", "protected function getPage() {}", "public function getCurrentPageData() {}", "public function getPage() {\n\t\tswitch($_POST['page']){\n\t\t\tcase 'getconfig':\n\t\t\t\t$this->returnConfig();\n\t\t\t\tbreak;\n\t\t\tcase 'save':\n\t\t\t\t$this->saveConfig();\n\t\t\t\tbreak;\n\t\t\tcase 'addkey':\n\t\t\t\t$this->addPresharedkey();\n\t\t\t\tbreak;\n\t\t\tcase 'editkey':\n\t\t\t\t$this->editPreSharedkey();\n\t\t\t\tbreak;\n\t\t\tcase 'deletekey':\n\t\t\t\t$this->removePresharedkey();\n\t\t\t\tbreak;\n\t\t\tcase 'addcertificate':\n\t\t\t\t$this->addCertificate();\n\t\t\t\tbreak;\n\t\t\tcase 'editcertificate':\n\t\t\t\t$this->editCertificate();\n\t\t\t\tbreak;\n\t\t\tcase 'deletecertificate':\n\t\t\t\t$this->removeCertificate();\n\t\t\t\tbreak;\n\t\t\tcase 'addtunnel':\n\t\t\t\t$this->addTunnel();\n\t\t\t\tbreak;\n\t\t\tcase 'edittunnel':\n\t\t\t\t$this->editTunnel();\n\t\t\t\tbreak;\n\t\t\tcase 'deletetunnel':\n\t\t\t\t$this->removeTunnel();\n\t\t\t\tbreak;\n\t\t\tcase 'toggletunnel':\n\t\t\t\t$this->toggleTunnel();\n\t\t}\n\t}", "public function setExtraPageData(array $data);", "protected function makePage() {\n // \n // get the user's constituency\n // \n // get the candidates for this election in this constituency\n // \n // make the page output\n }", "public function get_page_data(&$data, $page_meta){\n $data['menu'] = $page_meta['menu'];\n $data['menu_id'] = $page_meta['menu_id'];\n }", "public function getPage();", "public function ee_breakouts_page_load() {}", "public function get_page();", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "private function set_PageData() {\n\n\t\t\t// We have an existing page\n\t\t\t// should feed a wp_update_post not wp_insert_post\n\t\t\t//\n\t\t\tif ( $this->page_exists() ) {\n\t\t\t\t$this->pageData = array(\n\t\t\t\t\t'ID' => $this->linked_postid,\n\t\t\t\t\t'slp_notes' => 'pre-existing page',\n\t\t\t\t);\n\n\t\t\t\t// No page yet, default please.\n\t\t\t\t//\n\t\t\t} else {\n\t\t\t\t$this->pageData = array(\n\t\t\t\t\t'ID' => '',\n\t\t\t\t\t'post_type' => SLPlus::locationPostType,\n\t\t\t\t\t'post_status' => $this->pageDefaultStatus,\n\t\t\t\t\t'post_title' => ( empty( $this->store ) ? 'SLP Location #' . $this->id : $this->store ),\n\t\t\t\t\t'post_content' => '',\n\t\t\t\t\t'slp_notes' => 'new page',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Apply our location page data filters.\n\t\t\t// This is what allows add-ons to tweak page data.\n\t\t\t//\n\t\t\t// FILTER: slp_location_page_attributes\n\t\t\t//\n\t\t\t$this->pageData = apply_filters( 'slp_location_page_attributes', $this->pageData );\n\n\t\t\treturn $this->pageData;\n\t\t}", "public function getData(): HomePage;", "public function getData(): HomePage;", "public function getPage() {}", "public function getPage() {}", "protected function _getPageData($page) {\n $data = array();\n\n if (!$page) return array();\n\n if($page == 'institucional'){\n $event = 'institucional';\n $ec_pagetype = $page;\n $ecomm_pagetype = 'other';\n } else if ($page == 'landingpage'){\n $event = 'landingpage';\n $ec_pagetype = $page;\n $ecomm_pagetype = 'category';\n } else if ($page == 'home'){\n $event = $page;\n $ec_pagetype = $page;\n $ecomm_pagetype = $page;\n } else {\n $event = $page;\n $ec_pagetype = $page;\n $ecomm_pagetype = $page; \n }\n\n $data = array(\n 'event' => $event,\n 'google_tag_params' => array()\n );\n\n $google_tag_params = array();\n $google_tag_params['ecomm_pagetype'] = $ecomm_pagetype; \n\n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $google_tag_params['user_id'] = (string) $customer->getCustomerId(); \n }\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n $data['google_tag_params'] = $google_tag_params;\n\n /* Facebook Conversion API Code */\n $this->createFacebookRequest(\"PageView\");\n /* End Facebook Conversion API Code */\n\n return $data;\n }", "function go_page_list() {\n\t\tglobal $ROW, $TEMPLATE;\n\t\tLOG_MSG('INFO',\"go_page_list(): START \");\n\t\t// Do we have a search string?\n\t\t// Get all the args from $_GET\n\t\t$name=get_arg($_GET,\"name\");\n\t\t$title=get_arg($_GET,\"title\");\n\t\t$type=get_arg($_GET,\"type\");\n\t\tLOG_MSG('DEBUG',\"go_page_list(): Got args\");\n\t\t// Validate parameters as normal strings \n\t\tLOG_MSG('DEBUG',\"go_page_list(): Validated args\");\n\t\t// Rebuild search string for future pages\n\t\t$search_str=\"name=$name&title=$title&type=$type\";\n\t\t$ROW=$this->admin_model->db_page_select(\n\t\t\t\"\",\n\t\t\t\t$name,\n\t\t\t\t$title,\n\t\t\t\t'',\n\t\t\t\t$type);\n\n\t\tif ( $ROW[0]['STATUS'] != \"OK\" ) {\n\t\t\tadd_msg(\"ERROR\",\"There was an error loading the Pages. Please try again later. \");\n\t\t\treturn;\n\t\t}\n\t\t\t\t$this->data['rows'] = $ROW;\n\t\t\t\t$this->load->view('admin/html/header', $this->data,'');\n\t\t\t\t$this->load->view('admin/html/topbar', $this->data);\n\t\t\t\t$this->load->view('admin/html/leftnav', $this->data);\n\t\t\t\t$this->load->view('admin/page/list', $this->data);\n\t\t\t\t$this->load->view('admin/html/footer', $this->data);\n\t\tLOG_MSG('INFO',\"go_page_list(): END\");\n\t}", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "public function Process($data) {\n\t\tprint_pre($this);\n\t\tprint_pre($data); //lets see what's inside\n\t\t//here we're setting page <title> text\n\t\t$this->core->title = 'custom title';\n\t\t//and main page body source, which you can generate using your own methods in this controller class\n\t\t//by looking at $this->core->routes for internal paging\n\t\t$this->core->text = print_pre($this->core->routes, false);\n\t}", "function get_data($name) {\n $data = $this->find_in_session('page_data',$name,false);\n return $data ;\n }", "public function get_page_info()\n {\n }", "function Data($file) {\n $this->doc = new DOMDocument();\n $this->doc->load($file);\n $this->xp = new DOMXPath($this->doc);\n $this->nodes = $this->xp->query('/data/page');\n $this->node = $this->xp->query('/data/page[@href=\"' . $this->value() . '\"]')->item(0);\n }", "abstract protected function view_generatePageContent();", "abstract protected function getPage() ;", "public function getData() {\n\t\treturn $this->pageData;\n\t}", "public function setupPageData($page_no) \n {\n //NB: gets login page defaults all messages/errors\n $this->data['login'] = $this->user->viewLogin();\n $this->saveData('data');\n }", "protected function getPageData($page)\n\t{\n\t\t//Open the page file\n\t\t$data = $this->openFile(\"data/pages/\".$page.\".dat\");\n\t\t\n\t\t//Explode the available data\n\t\t$data = explode(\"|<*div*>|\",$data);\n\t\t\n\t\t//Return the collected data\n\t\treturn $data;\n\t}", "function pageLoad () {\n\tglobal $pageBegin, $pageEnd, $tableRow;\n\t$page = page_load (\"search_results.html\");\n\n\t$tableRow = page_split ($page, \"[[\", \"]]\");\n\t$pageBegin = $tableRow[0];\n\t$pageEnd = $tableRow[2];\n\t$tableRow = $tableRow[1];\n}", "public function process_flexpage_page($data) {\n global $DB;\n\n $data = (object) $data;\n $oldid = $data->id;\n $data->courseid = $this->task->get_courseid();\n $data->availablefrom = $this->apply_date_offset($data->availablefrom);\n $data->availableuntil = $this->apply_date_offset($data->availableuntil);\n\n $newid = $DB->insert_record('format_flexpage_page', $data);\n\n $this->set_mapping('flexpage_page', $oldid, $newid);\n }", "public function populate($data = array())\n {\n $this->pageId = (isset($data['pageId'])) ? $data['pageId'] : null;\n $this->pageName = (isset($data['pageName'])) ? $data['pageName'] : null;\r\n $this->pageLink = (isset($data['pageLink'])) ? $data['pageLink'] : null;\n\n }", "public function object_from_page_post($fields, &$data)\r\n\t{\r\n\t\t$data->title \t\t= $fields['title'];\r\n\t\t$data->slug \t\t= $fields['slug'];\r\n\t\t$data->order \t\t= $fields['order'];\r\n\t\t$data->body \t\t= $fields['body'];\r\n\t\t$data->raw\t\t\t= $fields['raw'];\r\n\t\t$data->parent_id \t= $fields['parent_id'];\r\n\t\t$data->menu_id \t\t= $fields['menu_id'];\t\r\n\t\t$data->template \t= $fields['template'];\r\n\t}", "public function getPageData() {\n return $this->pageData;\n }", "function performDataAction()\n{\n\tglobal $ajax;\n\n\t// XXX Set one and delete the other. This directly ties into\n\t// what HTTP method is being used: POST or GET.\n\t$key = getPostValue('assignment');\n\t$step = getPostValue('assignstep');\n\n\t// Render page.\n\t$html = formPage($key, $step);\t\n\t$ajax->sendCommand(ajaxClass::CMD_WMAINPANEL, $html);\n}", "private function page()\n {\n $records = array();\n $uid = $this->pObj->zz_getMaxDbUid('sys_template');\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrg($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalCaddy($uid);\n\n // #61838, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCal($uid);\n\n // #61826, 140923, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalEvents($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgCalLocations($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocuments($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgDocumentsCaddy($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgHeadquarters($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobs($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgJobsJobsApply($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgNews($uid);\n\n // #61779, 140921, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgService($uid);\n\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaff($uid);\n\n // #67210, 150531, dwildt, 2+\n $uid = $uid + 1;\n $records[$uid] = $this->pageOrgStaffVcard($uid);\n\n return $records;\n }", "private function pagedata_preprocessor()\r\n {/*{{{*/\r\n $items_st = $this->items_ordered_struct;\r\n // the number of items per page\r\n $this->pagedata['limit'] = isset(self::$preferences->item->itemsperpage) \r\n ? self::$preferences->item->itemsperpage : 10;\r\n if(self::$is_admin_panel)\r\n $this->pagedata['limit'] = isset(self::$preferences->item->bitemsperpage) \r\n ? self::$preferences->item->bitemsperpage : 10;\r\n $this->pagedata['viewpage'] = isset(self::$preferences->item->page) \r\n ? self::$preferences->item->page : '';\r\n // How many adjacent pages should be shown on each side\r\n $this->pagedata['adjacents'] = 3;\r\n // last page\r\n $this->pagedata['lastpage'] = (int)(ceil(count($items_st) / $this->pagedata['limit']));\r\n // handle get\r\n if(isset(self::$input['page']) && self::$input['page'] <= 0)\r\n self::$input['page'] = 1;\r\n elseif(isset(self::$input['page']) && self::$input['page'] > $this->pagedata['lastpage'])\r\n self::$input['page'] = $this->pagedata['lastpage'];\r\n\t $this->pagedata['page'] = !empty(self::$input['page']) ? (int)self::$input['page'] : 1;\r\n // first page to display\r\n $this->pagedata['start'] = !empty($this->pagedata['page']) \r\n ? (($this->pagedata['page'] - 1) * $this->pagedata['limit']) : 0;\r\n // next page\r\n $this->pagedata['next'] = $this->pagedata['page'] + 1;\r\n\r\n // just for counting of rows\r\n $act_row = $this->pagedata['start'];\r\n $index = $this->pagedata['start'] + $this->pagedata['limit'];\r\n\r\n // active item keys\r\n\t\t$this->pagedata['itemkeys'] = array();\r\n while(isset($items_st[$act_row]) && $act_row < $index)\r\n {\r\n $this->pagedata['itemkeys'][] = $act_row;\r\n $act_row++;\r\n }\r\n\r\n // initialize jquery id\r\n $this->pagedata['jid'] = '';\r\n if(isset(self::$input['delete']))\r\n $this->pagedata['jid'] = safe_slash_html_input(self::$input['delete']);\r\n elseif(isset(self::$input['promo']))\r\n $this->pagedata['jid'] = safe_slash_html_input(self::$input['promo']);\r\n elseif(isset(self::$input['visible']))\r\n $this->pagedata['jid'] = safe_slash_html_input(self::$input['visible']);\r\n \r\n // Setup page vars to display.\r\n\t $this->pagedata['prev'] = $this->pagedata['page'] - 1;\r\n\t //$this->pagedata['next'] = $this->pagedata['page'] + 1;\r\n $this->pagedata['lpm1'] = $this->pagedata['lastpage'] - 1;\r\n\r\n // try to fix our url inside admin, remove redundant 'page' param\r\n // todo: search engine friendly URL \r\n $this->pagedata['pageurl'] = self::$properties['paths']['siteurl'].return_page_slug().'/?page=';\r\n if(self::$is_admin_panel)\r\n if(strpos(curPageURL(),'&page=')!==false)\r\n $this->pagedata['pageurl'] = reparse_url(parse_url(curPageURL()));\r\n else\r\n $this->pagedata['pageurl'] = curPageURL().'&cat='.ImCategory::$current_category.'&page=';\r\n\r\n }", "public function HandlePage()\n\t\t{\n\t\t\t$this->SetOrderData();\n\n\t\t\t$action = \"\";\n\t\t\tif(isset($_REQUEST['action'])) {\n\t\t\t\t$action = isc_strtolower($_REQUEST['action']);\n\t\t\t}\n\n\t\t\tswitch($action) {\n\t\t\t\tdefault: {\n\t\t\t\t\t$this->FinishOrder();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function prePageContent();", "public function display($page){ \n switch($page){\n case 'cities':\n $this->get_big_four_cities();\n break;\n case 'women':\n $this->get_wfashion();\n break;\n case 'men':\n $this->get_mfashion();\n break;\n case 'lifestyle':\n $this->get_lifestyle();\n break;\n case 'culture':\n $this->get_culture();\n break;\n default:\n $this->get_big_four_cities();\n \n } \n }", "protected function _prepare_page($page)\n {\n }", "function tpps_details_top() {\n global $base_url;\n $params = drupal_get_query_parameters($_POST);\n $page = 0;\n if (empty($params)) {\n $params = drupal_get_query_parameters();\n }\n if (!empty($params['page'])) {\n $page = $params['page'];\n }\n $per_page = 20;\n\n $query = db_select('chado.plusgeno_view', 'pg');\n $query->addExpression('count(distinct(pg.accession))', 'count');\n if (!empty($params['type']) and !empty($params['value']) and !empty($params['op'])) {\n switch ($params['type']) {\n case 'title':\n case 'species':\n case 'project_id':\n case 'accession':\n case 'author':\n case 'year':\n $query->condition($params['type'], $params['value'], $params['op']);\n break;\n\n case 'phenotype_name':\n $query->innerJoin('chado.project_stock', 'ps', 'ps.project_id = pg.project_id');\n $query->innerJoin('chado.stock_phenotype', 'sp', 'sp.stock_id = ps.stock_id');\n $query->innerJoin('chado.phenotype', 'ph', 'ph.phenotype_id = sp.phenotype_id');\n $query->condition('ph.name', $params['value'], $params['op']);\n break;\n\n case 'phenotype_ontology':\n $query->innerJoin('chado.project_stock', 'ps', 'ps.project_id = pg.project_id');\n $query->innerJoin('chado.stock_phenotype', 'sp', 'sp.stock_id = ps.stock_id');\n $query->innerJoin('chado.phenotype', 'ph', 'ph.phenotype_id = sp.phenotype_id');\n $query->innerJoin('chado.cvterm', 'cvt', 'cvt.cvterm_id = ph.attr_id');\n $query->innerJoin('chado.cv', 'cv', 'cv.cv_id = cvt.cv_id');\n $query->condition('cv.name', $params['value'], $params['op']);\n break;\n\n case 'genotype_name':\n $query->innerJoin('chado.tpps_search_genotype_name', 'g', 'g.project_id = pg.project_id');\n $query->condition('g.name', $params['value'], $params['op']);\n break;\n\n case 'genotype_marker':\n $query->innerJoin('chado.tpps_search_genotype_marker', 'g', 'g.project_id = pg.project_id');\n $query->condition('g.name', $params['value'], $params['op']);\n break;\n\n case 'tags':\n $query->innerJoin('public.tpps_submission', 'ts', 'ts.accession = pg.accession');\n $query->innerJoin('public.tpps_submission_tag', 'st', 'st.tpps_submission_id = ts.tpps_submission_id');\n $query->innerJoin('public.tpps_tag', 'tt', 'tt.tpps_tag_id = st.tpps_tag_id');\n $query->condition('tt.name', $params['value'], $params['op']);\n break;\n\n default:\n break;\n }\n }\n $query = $query->execute();\n $total = $query->fetchObject()->count;\n\n $_GET['page'] = $page;\n $page = pager_default_initialize($total, $per_page);\n $start = $page * $per_page;\n\n $submissions = db_select('chado.plusgeno_view', 'pg');\n $submissions->distinct();\n $submissions->innerJoin('chado.project', 'p', 'p.project_id = pg.project_id');\n if (!empty($params['type']) and !empty($params['value']) and !empty($params['op'])) {\n switch ($params['type']) {\n case 'title':\n case 'species':\n case 'project_id':\n case 'accession':\n case 'author':\n case 'year':\n $submissions->condition($params['type'], $params['value'], $params['op']);\n break;\n\n case 'phenotype_name':\n $submissions->innerJoin('chado.project_stock', 'ps', 'ps.project_id = pg.project_id');\n $submissions->innerJoin('chado.stock_phenotype', 'sp', 'sp.stock_id = ps.stock_id');\n $submissions->innerJoin('chado.phenotype', 'ph', 'ph.phenotype_id = sp.phenotype_id');\n $submissions->condition('ph.name', $params['value'], $params['op']);\n break;\n\n case 'phenotype_ontology':\n $submissions->innerJoin('chado.project_stock', 'ps', 'ps.project_id = pg.project_id');\n $submissions->innerJoin('chado.stock_phenotype', 'sp', 'sp.stock_id = ps.stock_id');\n $submissions->innerJoin('chado.phenotype', 'ph', 'ph.phenotype_id = sp.phenotype_id');\n $submissions->innerJoin('chado.cvterm', 'cvt', 'cvt.cvterm_id = ph.attr_id');\n $submissions->innerJoin('chado.cv', 'cv', 'cv.cv_id = cvt.cv_id');\n $submissions->condition('cv.name', $params['value'], $params['op']);\n break;\n\n case 'genotype_name':\n $submissions->innerJoin('chado.tpps_search_genotype_name', 'g', 'g.project_id = pg.project_id');\n $submissions->condition('g.name', $params['value'], $params['op']);\n break;\n\n case 'genotype_marker':\n $submissions->innerJoin('chado.tpps_search_genotype_marker', 'g', 'g.project_id = pg.project_id');\n $submissions->condition('g.name', $params['value'], $params['op']);\n break;\n\n case 'tags':\n $submissions->innerJoin('public.tpps_submission', 'ts', 'ts.accession = pg.accession');\n $submissions->innerJoin('public.tpps_submission_tag', 'st', 'st.tpps_submission_id = ts.tpps_submission_id');\n $submissions->innerJoin('public.tpps_tag', 'tt', 'tt.tpps_tag_id = st.tpps_tag_id');\n $submissions->condition('tt.name', $params['value'], $params['op']);\n break;\n\n default:\n break;\n }\n }\n $submissions->fields('pg', array(\n 'title',\n 'project_id',\n 'accession',\n 'tree_count',\n 'phenotypes_assessed',\n 'phen_count',\n 'gen_count',\n ));\n $submissions->range($start, $per_page);\n $submissions->orderBy('pg.accession');\n $submissions = $submissions->execute();\n\n $rows = array();\n while (($sub = $submissions->fetchObject())) {\n $proj_id = $sub->project_id;\n\n $query = db_select('chado.organism', 'o');\n $query->join('chado.pub_organism', 'po', 'o.organism_id = po.organism_id');\n $query->join('chado.project_pub', 'pp', 'pp.pub_id = po.pub_id');\n $query->fields('o', array('organism_id', 'genus', 'species'));\n $query->condition('pp.project_id', $proj_id);\n $query->distinct();\n $query = $query->execute();\n\n $species = array();\n while (($result = $query->fetchObject())) {\n $species[] = tpps_entity_link($result->organism_id, \"{$result->genus} {$result->species}\", 'Organism');\n }\n\n $warning = \"\";\n if (empty(tpps_load_submission($sub->accession))) {\n $warning = \"<img src='$base_url/misc/message-16-warning.png' title='This study has not yet been resubmitted through the new TPPS pipeline'> \";\n }\n\n $row = array(\n \"<a href=\\\"$base_url/tpps/details/{$sub->accession}\\\">{$sub->accession}</a>\",\n \"$warning<a href=\\\"$base_url/tpps/details/{$sub->accession}\\\">{$sub->title}</a>\",\n tpps_show_tags(tpps_submission_get_tags($sub->accession)),\n implode('<br>', $species),\n $sub->tree_count,\n $sub->phenotypes_assessed,\n $sub->phen_count,\n $sub->gen_count,\n );\n $rows[$sub->accession] = $row;\n }\n\n ksort($rows);\n\n $vars = array(\n 'header' => array(\n 'Accession',\n 'Title',\n 'Tags',\n 'Species',\n 'Plant Count',\n 'Phenotypes Assessed',\n 'Phenotypic Measures',\n 'Genotype Count',\n ),\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n\n $output = theme('table', $vars);\n $pager = theme('pager', array('quantity', $total));\n return $pager . $output;\n}", "public function collectData(){\n\t\t// Simple HTML Dom is not accurate enough for the job\n\t\t$content = getContents($this->getURI())\n\t\t\tor returnServerError('No results for LWNprev');\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML($content);\n\t\tlibxml_clear_errors();\n\n\t\t$cat1 = '';\n\t\t$cat2 = '';\n\n\t\tforeach($html->getElementsByTagName('a') as $a){\n\t\t\tif($a->textContent === 'Multi-page format'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$realURI = self::URI . $a->getAttribute('href');\n\t\t$URICounter = 0;\n\n\t\t$edition = $html->getElementsByTagName('h1')->item(0)->textContent;\n\t\t$editionTimeStamp = strtotime(\n\t\t\tsubstr($edition, strpos($edition, 'for ') + strlen('for '))\n\t\t);\n\n\t\tforeach($html->getElementsByTagName('h2') as $h2){\n\t\t\tif($h2->getAttribute('class') !== 'SummaryHL'){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = array();\n\n\t\t\t$h2NextSibling = $h2->nextSibling;\n\t\t\t$this->jumpToNextTag($h2NextSibling);\n\n\t\t\tswitch($h2NextSibling->getAttribute('class')){\n\t\t\tcase 'FeatureByline':\n\t\t\t\t$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'GAByline':\n\t\t\t\t$text = $h2NextSibling->textContent;\n\t\t\t\t$item['author'] = substr($text, strpos($text, 'by '));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item['author'] = 'LWN';\n\t\t\t\tbreak;\n\t\t\t};\n\n\t\t\t$h2FirstChild = $h2->firstChild;\n\t\t\t$this->jumpToNextTag($h2FirstChild);\n\t\t\tif($h2FirstChild->nodeName === 'a'){\n\t\t\t\t$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');\n\t\t\t}else{\n\t\t\t\t$item['uri'] = $realURI . '#' . $URICounter;\n\t\t\t}\n\t\t\t$URICounter++;\n\n\t\t\t$item['timestamp'] = $editionTimeStamp + $URICounter;\n\n\t\t\t$h2PrevSibling = $h2->previousSibling;\n\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\tswitch($h2PrevSibling->getAttribute('class')){\n\t\t\tcase 'Cat2HL':\n\t\t\t\t$cat2 = $h2PrevSibling->textContent;\n\t\t\t\t$h2PrevSibling = $h2PrevSibling->previousSibling;\n\t\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\t\tif($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'Cat1HL':\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\t$cat2 = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$h2PrevSibling = null;\n\n\t\t\t$item['title'] = '';\n\t\t\tif(!empty($cat1)){\n\t\t\t\t$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';\n\t\t\t}\n\t\t\t$item['title'] .= $h2->textContent;\n\n\t\t\t$node = $h2;\n\t\t\t$content = '';\n\t\t\t$contentEnd = false;\n\t\t\twhile(!$contentEnd){\n\t\t\t\t$node = $node->nextSibling;\n\t\t\t\tif(!$node || (\n\t\t\t\t\t\t$node->nodeType !== XML_TEXT_NODE && (\n\t\t\t\t\t\t\t$node->nodeName === 'h2' || (\n\t\t\t\t\t\t\t\t!is_null($node->attributes) &&\n\t\t\t\t\t\t\t\t!is_null($class = $node->attributes->getNamedItem('class')) &&\n\t\t\t\t\t\t\t\tin_array($class->nodeValue, array('Cat1HL', 'Cat2HL'))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t){\n\t\t\t\t\t$contentEnd = true;\n\t\t\t\t}else{\n\t\t\t\t\t$content .= $node->C14N();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$item['content'] = $content;\n\t\t\t$this->items[] = $item;\n\t\t}\n\t}", "protected function _readPage($pageNumber) {}", "public function loadPage()\n {\n /*if(!isset(self::$user_id)) {\n self::$user_id = $_GET['user_id'];\n self::$id_wp_user = $_GET['id_wp_page'];\n self::$id_post = $_GET['id_post'];\n self::$nonce_img_upload = \"<input type='hidden' id='nonce_img_upload' name='nonce_img_upload' value='{$_GET['nonce_img_upload']}'>\n <input type='hidden' name='_wp_http_referer' value='/stomshop/'>\";\n self::$nonce_img_del = \"<input type='hidden' id='nonce_img_del' name='nonce_img_del' value='{$_GET['nonce_img_del']}'>\n <input type='hidden' name='_wp_http_referer' value='/stomshop/'>\";\n Profile_user::getUserListGods($_GET['id_wp_page']);\n self::$list = Profile_user::$page;\n self::$profile = Profile_user::getUserProfileObject($_GET['id_wp_page'])[0];\n }\n $page = $_GET['page']??0;\n $this->get_page($page = parent::$list[$page]);*/\n }", "public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}", "function pageController()\n\t{\n\t $data = [];\n\t $counter = 0;\n\n\t /*if is a query string get request, update data counter so that counter adds one for up and subtracts one for down*/\n\t if(isset($_GET['request'])){\n\t \tif ($_GET['request'] == 'up'){\n\t \t\t$_GET['count']++;\n\t \t\t$data['counter']=$_GET['count'];\n\t \t} elseif ($_GET['request'] == 'down'){\n\t \t\t$_GET['count']--;\n\t \t\t$data['counter']=$_GET['count'];\n\t \t}\n \t\t}\n\t return $data; \n\t}", "public function _render_page($data = [])\n {\n \t$this->load->view('layouts/main', $data);\n }", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "function book_together() {\r\n $data['page_meta'] = get_page_meta(ADVERTISING_BOOK_TOGETHER_PAGE, null);\r\n \r\n $data = get_page_navigation($data, $data['is_mobile'], ADVERTISING_BOOK_TOGETHER_PAGE);\r\n \r\n $data['main_view'] = load_view('advertising/book_together', $data, $data['is_mobile']);\r\n \r\n return $data;\r\n }", "public function page_2() \n\t{\n\t\t$question = new TblQuestions();\n \n\t\t$get_total_question = $question->get_total(\"client_project_planner\");\n\t\n\t if($this->input->post()) $this->get_answers_page_2();\n\t\n\t\t$this->template->content = new View(\"creative_page_two\");\n\t\t$this->template->content->question = $get_total_question->execute();\n\t}", "function page($num = 1)\n {\n // retrieve all data from history table per sorting\n $source = $this->factory->sortAll($this->sort);\n $records = array(); // start with an empty extract\n\n // use a foreach loop, because the record indices may not be sequential\n $index = 0; // where are we in the tasks list\n $count = 0; // how many items have we added to the extract\n $start = ($num - 1) * $this->itemsPerPage;\n \n foreach($source as $record) {\n if ($index++ >= $start) {\n $records[] = $record;\n $count++;\n }\n if ($count >= $this->itemsPerPage) break;\n }\n \n $this->data['pagination'] = $this->pagenav($num);\n $this->showPage($records);\n }", "function set_page_vars($id) {\n global $_PAGE_TITLE, $_IMAGE_URL, $_PAGE_ID;\n\n $json = file_get_contents(\"http://1504.nl/api/?t=page&a=get&i=\" . $id);\n $json = Page_helper::remove_utf8_bom($json);\n $page = json_decode($json);\n // print_r($page);\n\n $_PAGE_ID = $page[0]->id;\n $_PAGE_TITLE = $page[0]->name;\n $_IMAGE_URL = $page[0]->image_url;\n }", "public function do_paging()\n {\n }", "public function read($slug_page)\n {\n $page = $this->page_model->read($slug_page);\n\n $data = array( 'id_user' => $this->session->userdata('id_user'),\n 'title' =>'Judul',\n 'deskripsi' => 'deskripsi', //$page->judul_page,\n 'keywords' => 'keywords', //$page->keywords,\n 'page' => $page,\n 'tanggal_post' => date('Y-m-d'),\n 'isi' => 'page/read'\n );\n\n\n\n\n $this->load->view('layout/wrapper', $data, FALSE);\n }", "public function go($page) {\n if($this->session->user) {\n $data['user'] = $this->session->user;\n } else {\n $data['user'] = null;\n }\n\n //Check and load user session data\n if($this->session->user['u_email'] === '[email protected]') {\n $data['user'] = $this->session->user;\n } else {\n $data['user'] = null;\n redirect('/');\n }\n\n if($page === 'locations') {\n $data['countries'] = $this->admin_model->get_locations_countries();\n $data['cities'] = $this->admin_model->get_locations_cities();\n $data['states'] = $this->admin_model->get_locations_states();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/locations', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'listings') {\n\n $data['items'] = $this->admin_model->get_listings();\n $data['categories'] = $this->admin_model->get_categories();\n\n $data['countries'] = $this->admin_model->get_locations_countries();\n $data['cities'] = '';\n $data['states'] = '';\n\n $data['makes'] = $this->admin_model->get_makes();\n $data['models'] = '';\n\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/listings', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'categories') {\n $data['categories'] = $this->admin_model->get_categories();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/categories', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'automobile') {\n $data['makes'] = $this->admin_model->get_makes();\n $data['models'] = $this->admin_model->get_models();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/automobile', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'users') {\n $data['users'] = $this->admin_model->get_users();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/users', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'advertisers') {\n $data['advertisers'] = $this->admin_model->get_advertisers();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/advertisers', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'advertisements') {\n $data['advertisements'] = $this->admin_model->get_advertisements();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/advertisements', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'comments') {\n $data['comments'] = $this->admin_model->get_comments();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/comments', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n if($page === 'settings') {\n $data['settings'] = $this->admin_model->get_settings();\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/settings', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }\n }", "public function loadNextPage()\n {\n $nextPage = $this->results->getNextPage();\n $this->search($nextPage);\n }", "function wisdom() {\r\n $this->data['pagebody'] = 'justone';\r\n \r\n $source = $this->quotes->get(6);\r\n \r\n $this->data = array_merge($this->data, $source);\r\n \r\n $this->render();\r\n }", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "static function init($data){\n \n $pages = ceil($data['count_all'] / $data['limit']);\n \n $res = \"\";\n \n for($i = 1; $i <= $pages; $i++){\n \n if($i == $data['current_page'] ){ \n $res .= \"<b>$i</b>\";\n }\n else{\n $res .= \"<a href='\".$data['url'].\"&page=$i'>$i</a>\";\n }\n \n }\n \n \n return $res;\n \n \n \n \n }", "public function pageAction()\n {\n $page = $this->getRequest()->getParam('page', 1);\n $count = $this->getRequest()->getParam('count', 20);\n $collectionJson = Mage::helper('neklo_productposition/product')->getCollectionJson($page, $count);\n $this->getResponse()->setBody($collectionJson);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n }", "public function getPage()\n\t{\n\t $url = URL::segment(1);\n\t\treturn $this->crud->_where(\"url = $url\")\n\t\t\t\t\t->read('row')\n\t\t;\n\t}", "public function initPage() {}", "public function initPage() {}", "protected function getPageData()\n {\n return [\n 'page_name' => 'top_buyers'\n ];\n }", "public function run()\n {\n //\n $page = [\n [\n 'id' => 1,\n 'name' => 'home',\n 'url' => '/'\n ],\n [\n 'id' => 2,\n 'name' => 'service',\n 'url' => '/services'\n ],\n [\n 'id' => 3,\n 'name' => 'promotion',\n 'url' => '/promotions'\n ],\n [\n 'id' => 4,\n 'name' => 'event',\n 'url' => '/events'\n ]\n ];\n Page::insert($page);\n }", "function page_settings( $view_file, $view_data, $data_name = 'result', $page_title = '', $module = '' )\n {\n\t$data[ $data_name ] = $view_data;\n\t$data[ 'view_file' ] = $view_file;\n\t$data[ 'page_title' ] = $page_title;\n\tif ( $module != '' ) {\n\t $data[ 'module' ] = $module;\n\t}\n\treturn $data;\n }", "public function indexTypo3PageContent() {}", "function information()\n\t\t{\n\t\t\t$this->directPageDetails(\"information\");\n\t\t}", "public function getPageHandler();", "public function run()\n {\n //\n $page = \\CDeep\\Models\\Page::find(1);\n if (!$page) {\n $pages = [\n ['id' => 1, 'owner_user_id' => 1, 'owner_group_id' => 1, 'uri' => 'index', 'title' => 'cDeep Site', 'topic' => 'cDeep Site', 'menu' => 'Home', 'keywords' => '', 'description' => '', 'template_resource' => 'site', 'template_env' => '_env/index', 'template_view' => 'main/index', 'show_in_menu' => 1, 'menu_sort_order' => 100, 'is_published' => 1, 'is_enabled' => 1,],\n\n ['id' => 2, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 1, 'uri' => 'sadm',\n 'title' => 'Администрирование', 'topic' => 'Администрирование', 'menu' => 'Администрирование', 'keywords' => '', 'description' => '',\n 'template_resource' => 'sadm', 'template_env' => '_env/index', 'template_view' => 'main/index',\n 'show_in_menu' => 0, 'menu_sort_order' => 100, 'is_published' => 1, 'is_enabled' => 1,],\n ['id' => 9999, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 2, 'uri' => 'logout',\n 'title' => 'Выход', 'topic' => 'Выход', 'menu' => 'Выход', 'keywords' => '', 'description' => '',\n 'template_view' => 'errors/404',\n 'show_in_menu' => 0, 'menu_sort_order' => 100, 'is_published' => 1, 'is_enabled' => 1,],\n\n ['id' => 3, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 1, 'uri' => 'errors', 'title' => 'Ошибка', 'topic' => 'Ошибка', 'template_view' => 'errors/index',\n 'show_in_menu' => 0,\n 'is_published' => 1,\n 'is_enabled' => 1\n ],\n ['id' => 401, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 3, 'uri' => '401', 'title' => 'Доступ ограничен', 'topic' => 'Доступ ограничен', 'template_view' => 'errors/401', 'is_published' => 1, 'is_enabled' => 1,],\n ['id' => 402, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 3, 'uri' => '403', 'title' => 'Доступ запрещен', 'topic' => 'Доступ запрещен', 'template_view' => 'errors/403', 'is_published' => 1, 'is_enabled' => 1,],\n ['id' => 404, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 3, 'uri' => '404', 'title' => 'Не найдено', 'topic' => 'Не найдено', 'template_view' => 'errors/404', 'is_published' => 1, 'is_enabled' => 1,],\n\n ['id' => 10001, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'signin',\n 'title' => 'Вход',\n 'topic' => 'Вход',\n 'menu' => 'Вход',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'signin/index',\n 'show_in_menu' => 0,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10010, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'about',\n 'title' => 'О сервисе',\n 'topic' => 'Что это такое?',\n 'menu' => 'О сервисе',\n 'keywords' => '',\n 'description' => '', \n 'template_view' => 'about/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10015, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 10010, 'uri' => 'start',\n 'title' => 'С чего начать?',\n 'topic' => 'Инструкция для старта',\n 'menu' => 'С чего начать?',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'about/start',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10040, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'prices',\n 'title' => 'Тарифы',\n 'topic' => 'Стоимость',\n 'menu' => 'Тарифы',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'prices/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10050, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'signup',\n 'title' => 'Регистрация',\n 'topic' => 'Регистрация',\n 'menu' => 'Зерегистрироваться',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'signup/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10500, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'help',\n 'title' => 'Поддержка',\n 'topic' => 'Поддержка',\n 'menu' => 'Поддержка',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'help/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n ['id' => 10501, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'terms',\n 'title' => 'Условия использования',\n 'topic' => 'Условия использования',\n 'menu' => 'Условия использования',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'help/terms',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n ['id' => 10502, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'feedback',\n 'title' => 'Связь',\n 'topic' => 'Связь',\n 'menu' => 'Связь',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'help/feedback',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n ];\n\n foreach ($pages as $p) {\n $page = new \\CDeep\\Models\\Page($p);\n $page->save();\n }\n }\n }", "public function getPageDetails()\n {\n global $mysqli,$_GET;\n\n $offer_query = $mysqli->query(\"SELECT OFR.title, OFR.type, OFR.hotel_id, HTL.title AS hotelname FROM offers OFR INNER JOIN hotels HTL ON HTL.id=OFR.hotel_id WHERE OFR.id=\".$_GET[\"ofrid\"]);\n $result = $offer_query->fetch_object();\n\n $type=($result->type!='')? ' <small>(type - '.$result->type.')</small>':'';\n\n $title = $result->title. $type . ' <small>in '.$result->hotelname.'</small>';\n\n //inputs to add modal on page load\n $statuses = $this->getDateStatusOptions();\n $arrivals = $this->getArrivalOptions();\n $room_inputs = $this->getRoomInputs($result->hotel_id);\n\n\n return [\"title\"=>$title,\"hid\"=>$result->hotel_id,\"status_opt\"=>$statuses,\"arrival_opt\"=>$arrivals,'room_inputs'=>$room_inputs];\n }", "public static function processPageRequest($pagename,$request){\r\n\r\n }", "public function index()\n {\n load_datatable($this->data);\n load_daterangepicker($this->data);\n echo $this->blade->view()->make('page/page', $this->data)->render();\n }", "function getSubMenuPageContent() {\n \tif(isSet($_GET['page'])) {\n \t\tswitch($_GET['page']) {\n \t\t\tcase 'lepress-my-subscriptions':\n \t\t\tcase 'lepress':\n \t\t\t\trequire_once('student_include/subscriptions.php');\n \t\t\t\tbreak;\n \t\t\tcase 'lepress-assignments':\n \t\t\t\trequire_once('student_include/assignments.php');\n \t\t\t\tbreak;\n \t\t\tcase 'lepress-groups':\n \t\t\t\trequire_once('student_include/my-groups.php');\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\techo \"tere\";\n \t\t\t\tbreak;\n \t\t}\n \t}\n }", "function rowpage() {\n $dir = APPPATH . 'controllers/';\n $this->load->library('directoryinfo');\n $arr = $this->directoryinfo->readDirectory($dir, array(\"Auth.php\", \"Ajax.php\"));\n $arr = array($arr);\n // $sortedarray2 = $this->directoryinfo->readDirectory($dirmodule, true);\n // $arr = array_merge(array($sortedarray1), $sortedarray2);\n// echo \"<pre>\";\n// print_r($arr);\n// die();\n $dataselect = array();\n foreach ($arr as $key => $row) {\n $module = mb_strtolower($key, 'UTF-8');\n foreach ($row as $key1 => $row1) {\n $class = mb_strtolower($key1, 'UTF-8');\n foreach ($row1 as $row2) {\n $method = mb_strtolower($row2, 'UTF-8');\n if ($module) {\n $page = $module . \"/\" . $class . \"/\" . $method;\n } else {\n $page = $class . \"/\" . $method;\n }\n $dataselect[$page] = $page;\n }\n }\n }\n $arr_page = $this->page_model->where(array(\"deleted\" => 0))->as_array()->get_all();\n $page_ava = array_map(function($item) {\n return $item['link'];\n }, $arr_page);\n $this->data['page_ava'] = $page_ava;\n $this->data['link'] = $dataselect;\n echo $this->blade->view()->make('ajax/ajaxpage', $this->data)->render();\n }", "public function getPages() {}", "public function getPage() {\r\n\t\tif (isset ( $_POST ['page'] )) {\r\n\t\t\tswitch ($_POST ['page']) {\r\n\t\t\t\tcase 'getconfig' :\r\n\t\t\t\t\t$this->getConfig();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'save':\r\n\t\t\t\t\t$this->saveConfig();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Exception('Invalid page request');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->logger->error ( 'A page was requested without a page identifier' );\r\n\t\t\tthrow new Exception('Invalid page request');\r\n\t\t}\r\n\t}", "function getSubMenuPageContent() {\n \tif(isSet($_GET['page'])) {\n \t\tswitch($_GET['page']) {\n \t\t\tcase 'lepress':\n \t\t\tcase 'lepress-student-roster':\n \t\t\t\trequire_once('teacher_include/subscriptions.php');\n \t\t\t\tbreak;\n \t\t\tcase 'lepress-classbook':\n \t\t\t\trequire_once('teacher_include/classbook.php');\n \t\t\t\tbreak;\n \t\t\tcase 'lepress-import-export':\n \t\t\t\trequire_once('teacher_include/import_export.php');\n \t\t\t\tbreak;\n \t\t}\n \t}\n }", "private function getPurchasePageData(){\n\t\t$this->template->imgurl = $this->getParam('imgurl');\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\t$this->getItem();\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\n\t\t// TODO Add 'name' to productdata\n\t\t$itemView = $this->template->item;\n\t\t$name = substr($itemView->description, 0, 35);\n\t\t$itemView->name = $name . '...';\n\n\t\t// Build shippng costs (including insurance)\n\t\t$shippingbase = shop_shipping_fee;\n\t\t$optionShipping = array();\n\t\t$options = $itemView->options;\n\t\tfor ($i = 0; $i < sizeof($options); $i++) {\n\t\t\t$option = $options[$i];\n\t\t\tif ($option->price < 100) {\n\t\t\t\t$ship = $shippingbase + 4;\n\t\t\t} else {\n\t\t\t\t$ship = $shippingbase + 8;\n\t\t\t}\n\t\t\t$optionShipping[$option->seq] = $ship;\n\t\t}\n\t\t$this->template->optionShipping = $optionShipping;\n\t\t\n\t\tLogger::info('Purchase page view ['.$this->template->item->id.']['.$this->template->item->code.']');\n\t}", "protected function getPageData()\n {\n return [\n 'page_name' => 'latest_subscriptions'\n ];\n }", "public function getPageData()\n {\n return $this->pageData;\n }", "public function run()\n {\n $pages = [\n [\n 'id' => 1,\n 'title' => 'About Minecrafter',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 2,\n 'title' => 'Privacy policy',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 3,\n 'title' => 'General Terms',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 4,\n 'title' => 'Store Terms',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 5,\n 'title' => 'Reports',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 6,\n 'title' => 'Rules',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 7,\n 'title' => 'Youtuber Apply',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n ];\n\n ContentPage::insert($pages);\n }", "public function getNextPage();", "function data_page($dbc, $id){\n\t# Page Setup query\n\t$query = \"SELECT * FROM pages WHERE id = $id \";\n\t\n\t$result = mysqli_query($dbc, $query);\n\t$data = mysqli_fetch_assoc($result);\n\t\n\t$data['body_nohtml'] = strip_tags($data['body']);\n\tif($data['body_nohtml'] == $data['body']){\n\t\t$data['body_formatted'] = '<p>'.$data['body'] .'</p>';\t\n\t}else{\n\t\t$data['body_formatted'] = $data['body'];\n\t}\n\t\n\treturn $data;\n\t}", "function index() {\r\n $this->page();\r\n }", "public function pageAction(){\n $this->_request->setParam('table', 'Page'); \n \t$this->view->gridIndexRoute = Rhema_Constant::ROUTE_GRID_INDEX ; \t \n \t$this->_helper->displayGrid(); \t \n }", "function load_page($args=''){//$page,$maxrows,$order,$ordertype,$capa,\n\t\t$r= getResponse();\t\t\n\t\tsetLocaleMode();\n\t\tif (!xvalidaAcceso($r,PAGE_PRIV)){\n\t\t\t$r->assign($capa,inner,'Acceso denegado');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t//$r->alert($args);\n\t\t$c = new connection();\n\t\t$c->open();\n\t\t\n\t\t\n\t\t$sa_paquetes = $c->sa_v_paquetes;\n\t\t$query = new query($c);\n\t\t$query->add($sa_paquetes);\n\t\t$paginador = new fastpaginator('xajax_load_page',$args,$query);\n\t\t$arrayFiltros=array(\n\t\t\t'Empresa'=>array(\n\t\t\t\t'change'=>'h_empresa',\n\t\t\t\t'addevent'=>\"obj('empresa').value='';\"\n\t\t\t),\n\t\t\t'busca'=>array(\n\t\t\t\t'title'=>'B&uacute;squeda',\n\t\t\t\t'event'=>'restablecer();'\n\t\t\t),\n\t\t\t'fecha'=>array(\n\t\t\t\t'title'=>'Fecha'\n\t\t\t)\n\t\t);\n\t\t$argumentos = $paginador->getArrayArgs();\n\t\t$aplica_iva=($argumentos['iva']==1);\n\t\t$id_empresa=$argumentos['h_empresa'];\n\t\t$query->where(new criteria(sqlEQUAL,$sa_paquetes->id_empresa,$id_empresa));\n\t\t\n\t\tif($id_empresa==null){\n\t\t\t$r->assign($paginador->layer,inner,'Seleccione una Empresa');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t$rec=$paginador->run();\n\t\tif($rec){\n\t\t\tforeach($rec as $v){\n\t\t\t\t//buscando las unidades basicas del paquete\n\t\t\t\t$unidades=$c->sa_v_informe_tempario_unidades->doSelect($c, new criteria(sqlEQUAL,'id_paquete',$v->id_paquete))->getAssoc('id_paq_unidad','nombre_unidad_basica');\n\t\t\t\t$lista_unidades=implode(',',$unidades);\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"40%\" /><thead>';\n\t\t\t\t\n\t\t\t\t$html.='<tr><td>PAQUETE</td><td>Descripci&oacute;n</td><td>Unidades</td></tr></thead><tbody>';\n\t\t\t\t$html.='<tr><td>'.$v->codigo_paquete.'</td><td>'.$v->descripcion_paquete.'</td><td>'.$lista_unidades.'</td></tr></tbody></table>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"20%\" /><thead><tr><td>Codigo</td><td>Descripci&oacute;n</td><td>Unidad</td><td>Cantidad</td><td style=\"display:none;\">Precio</td><td style=\"display:none;\">Importe</td></tr></thead><tbody>';\n\t\t\t\t//cargando los detalles de tempario\n\t\t\t\t$sa_v_paq_tempario=$c->sa_paq_tempario;\n\t\t\t\t$sa_tempario= new table('sa_v_tempario','',$c);\n\t\t\t\t$join= $sa_tempario->join($sa_v_paq_tempario,$sa_tempario->id_tempario,$sa_v_paq_tempario->id_tempario);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_tempario->id_paquete,$v->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $temp){\n\t\t\t\t\t\t$html.='<tr><td>'.$temp->codigo_tempario.'</td><td>'.$temp->descripcion_tempario.'</td><td>'.$temp->descripcion_modo.'</td><td>N/A</td><td style=\"display:none;\">'.$temp->precio.'</td><td style=\"display:none;\">'.$temp->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sa_v_paq_repuestos=$c->sa_paquete_repuestos;\n\t\t\t\t$iv_articulos= new table('iv_articulos','',$c);\n\t\t\t\t$join= $iv_articulos->join($sa_v_paq_repuestos,$iv_articulos->id_articulo,$sa_v_paq_repuestos->id_articulo);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_repuestos->id_paquete,$rec->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $rep){\n\t\t\t\t\t\t$html.='<tr><td>'.$rep->codigo_articulo.'</td><td>'.$rep->descripcion.'</td><td>'.$rep->unidad.'</td><td>'.$rep->cantidad.'</td><td style=\"display:none;\">'.$rep->precio.'</td><td style=\"display:none;\">'.$rep->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html.='</tbody></table><br />';\n\t\t\t}\n\t\t}\n\t\t$html.='<br />Informe Generado el '.date(DEFINEDphp_DATETIME12).' - Empresa: '.$argumentos['Empresa'].'<strong>'.$tiva.'</strong>';\n\t\t$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div>');\n\t\t\n\t\t/*if($argumentos['busca']!=''){\n\t\t\t$query->where(\n\t\t\t\tnew criteria(sqlOR, array(\n\t\t\t\t\tnew criteria(' like ',$sa_paquetes->descripcion_paquete,\"'%\".$argumentos['busca'].\"%'\")//,\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->chasis,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->color,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$c->pg_empresa->nombre_empresa,\"'%\".$argumentos['busca'].\"%'\")\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t}\n\t\tif($argumentos['fecha']!=''){\n\t\t\t$query->where(new criteria(' = ',\"DATE_FORMAT(\".$sa_paquetes->fecha_rev.\",'%d-%m-%Y')\",\"'\".$argumentos['fecha'].\"'\"));\t\t\t\n\t\t}\n\t\tif($argumentos['h_empresa']!=''){\n\t\t\t$query->where(new criteria(sqlEQUAL,\"id_empresa\",\"'\".$argumentos['h_empresa'].\"'\"));\t\t\t\n\t\t}else{\n\t\t\t$arrayFiltros['Empresa']['hidden']=1;\n\t\t}*/\n\t\t//$r->alert($argumentos['h_empresa']);\n\t\t\n\t\t//$rec=$paginador->run();\n\t\t\n\t\t/*if($rec){\n\t\t\tif($rec->getNumRows()==0){\n\t\t\t\t$html.='<div class=\"order_empty\">No se han encontrado registros</div>';\n\t\t\t}else{\n\t\t\t\t$html.='<table class=\"order_table\"><thead><tr class=\"xajax_order_title\">\n\t\t\t\t\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->id_paquete,'ID').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->codigo_paquete,'C&oacute;digo').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->descripcion_paquete,'Descripci&oacute;n').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->nombre_empresa_sucursal,'Empresa').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->fecha_rev,'Fecha').'</td>\n\t\t\t\t</tr></thead><tbody>';\n\t\t\t\t$class='';\n\t\t\t\tforeach($rec as $v){\n\t\t\t\t\tif ($rec->parcial == '1')\n\t\t\t\t\t\t$parcial = 'Si';\n\t\t\t\t\telse\n\t\t\t\t\t\t$parcial = 'No';\n\t\t\t\t\t$html.='<tr class=\"'.$class.'\">\n\t\t\t\t\t\n\t\t\t\t\t<td align=\"center\">'.$rec->id_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->codigo_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->descripcion_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->nombre_empresa_sucursal.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->fecha_rev.'</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t\tif($class==''){\n\t\t\t\t\t\t$class='impar';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$class='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html.='</tbody></table>';\n\t\t\t}\n\t\t\t\n\t\t}*/\n\t\t\n\t\t$r->assign($paginador->layer,inner,$html);\n\t\t\n\t\t\n\t\t//$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div><div class=\"ifilter\">'.$paginador->getRemoveFilters('datos',$arrayFiltros).'</div>');\n\n\t\t$r->assign('campoFecha','value',$fec);\n\t\t\n\t\t$r->script($paginador->fillJS('datos'));\n\t\n\t\t$c->close();\n\t\treturn $r;\n\t}", "public function inPageEdit() {\n\t\t\n\t\t$output = array();\n\t\t$context = Request::post('context');\n\t\t$postData = Request::post('data');\n\t\t$url = Request::post('url');\n\t\t\n\t\tif ($context) {\n\t\t\n\t\t\t// Check if page actually exists.\n\t\t\tif ($Page = $this->Automad->getPage($context)) {\n\t\t\t\t\n\t\t\t\t// If data gets received, merge and save.\n\t\t\t\t// Else send back form fields.\n\t\t\t\tif ($postData && is_array($postData)) {\n\t\t\t\t\t\n\t\t\t\t\t// Merge and save data.\n\t\t\t\t\t$data = array_merge(Core\\Parse::textFile($this->getPageFilePath($Page)), $postData);\n\t\t\t\t\tFileSystem::writeData($data, $this->getPageFilePath($Page));\n\t\t\t\t\tCore\\Debug::log($data, 'saved data');\n\t\t\t\t\tCore\\Debug::log($this->getPageFilePath($Page), 'data file');\n\t\t\t\t\t\n\t\t\t\t\t// If the title has changed, the page directory has to be renamed as long as it is not the home page.\n\t\t\t\t\tif (!empty($postData[AM_KEY_TITLE]) && $Page->url != '/') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Move directory.\n\t\t\t\t\t\t$newPagePath = FileSystem::movePageDir(\n\t\t\t\t\t\t\t$Page->path, \n\t\t\t\t\t\t\tdirname($Page->path), \n\t\t\t\t\t\t\t$this->extractPrefixFromPath($Page->path), \n\t\t\t\t\t\t\t$postData[AM_KEY_TITLE]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tCore\\Debug::log($newPagePath, 'renamed page');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Clear cache to reflect changes.\n\t\t\t\t\t$this->clearCache();\n\t\t\t\t\t\n\t\t\t\t\t// If the page directory got renamed, find the new URL.\n\t\t\t\t\tif ($Page->url == $url && isset($newPagePath)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// The page has to be redirected to a new url in case the edited context is actually \n\t\t\t\t\t\t// the requested page and the title of the page and therefore the URL has changed.\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Rebuild Automad object, since the file structure has changed.\n\t\t\t\t\t\t$Automad = new Core\\Automad();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Find new URL and return redirect URL.\n\t\t\t\t\t\tforeach ($Automad->getCollection() as $key => $Page) {\n\n\t\t\t\t\t\t\tif ($Page->path == $newPagePath) {\n\t\t\t\t\t\t\t\t$output['redirect'] = AM_BASE_INDEX . $key;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// There are two cases where the currently requested page has to be\n\t\t\t\t\t\t// simply reloaded without redirection:\n\t\t\t\t\t\t// \n\t\t\t\t\t\t// 1.\tThe context of the edits is not the current page and another\n\t\t\t\t\t\t// \t\tpages gets actually edited.\n\t\t\t\t\t\t// \t\tThat would be the case for edits of pages displayed in pagelists or menus.\n\t\t\t\t\t\t// \t\n\t\t\t\t\t\t// 2.\tThe context is the current page, but the title didn't change and\n\t\t\t\t\t\t// \t\ttherefore the URL stays the same.\n\t\t\t\t\t\t$output['redirect'] = AM_BASE_INDEX . $url;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Append query string if not empty.\n\t\t\t\t\t$queryString = Request::post('query');\n\n\t\t\t\t\tif ($queryString) {\n\t\t\t\t\t\t$output['redirect'] .= '?' . $queryString;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t// Return form fields if key is defined.\n\t\t\t\t\tif ($key = Request::post('key')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!empty($Page->data[$key])) {\n\t\t\t\t\t\t\t$value = $Page->data[$key];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Note that $Page->path has to be added to make image previews work in CodeMirror.\n\t\t\t\t\t\t$output['html'] = Components\\InPage\\Edit::render($this->Automad, $key, $value, $context, $Page->path);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\n\t}", "function showPage($page_name, $data)\n\t{\n\t\t$instance_name = & get_instance();\n\t\t$instance_name->load->view(\"admin/header\", $data);\n\t\t$instance_name->load->view(\"admin/navbar\", $data);\n\t\t$instance_name->load->view(\"admin/{$page_name}\", $data);\n\t\t$instance_name->load->view(\"admin/footer\", $data);\n\t}", "public function HandlePage()\n\t{\n\t\tif(!gzte11(ISC_HUGEPRINT)) {\n\t\t\texit;\n\t\t}\n\n\t\t$this->SetVendorData();\n\n\t\tif($this->displaying == 'products') {\n\t\t\t$this->ShowVendorProducts();\n\t\t}\n\t\telse if($this->displaying == 'page') {\n\t\t\t$this->ShowVendorPage();\n\t\t}\n\t\telse if($this->displaying == 'profile') {\n\t\t\t$this->ShowVendorProfile();\n\t\t}\n\t\telse {\n\t\t\t$this->ShowVendors();\n\t\t}\n\t}", "public function testDetailPageContent() \n {\n $this->visit('/detail/brandonvega/')\n ->see('<strong>Title:</strong>')\n ->see('<strong>Email:</strong> <a href=\"mailto:')\n ->see('<strong>Telephone:</strong> <a href=\"tel:')\n ->see('<strong>Office Address:</strong>')\n ->see('<strong>Mailing Address:</strong>');\n }", "public function getPages();", "public function page_content() {\n\t\t$tab = empty( $_REQUEST['tab'] ) ? 'new' : wp_strip_all_tags( wp_unslash( $_REQUEST['tab'] ) ); // Input var okay.\n\t\t$paged = ! empty( $_REQUEST['paged'] ) ? (int) $_REQUEST['paged'] : 1; // Input var okay.\n\n\t\t$tab = esc_attr( $tab );\n\t\t$paged = esc_attr( $paged );\n\n\t\t$filters = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'filters' );\n\t\t$defaults = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'defaults' );\n\n\t\t$args = array(\n\t\t\t'tab' => $tab,\n\t\t\t'page' => $paged,\n\t\t\t'filters' => $filters,\n\t\t\t'defaults' => $defaults,\n\t\t);\n\n\t\t$table = $this->create_list_table( $this->args['page_slug'], $this->args['parent'], $args );\n\n\t\t// Outputs the tabs, filters and search bar.\n\t\t$table->views();\n\n\t\t/**\n\t\t * Fires on the Add-ons browser tab after the top navigation bar.\n\t\t *\n\t\t * The dynamic part of the hook name refers to the tab slug (i.e. new or popular)\n\t\t *\n\t\t * @param APP_Addons_List_Table $table The content generator instance.\n\t\t */\n\t\tdo_action( \"appthemes_addons_mp_{$tab}\", $table );\n\t}" ]
[ "0.71514285", "0.6979558", "0.6905746", "0.6811881", "0.6467601", "0.64252055", "0.636551", "0.6335914", "0.63266915", "0.63266027", "0.62969697", "0.62865645", "0.62376577", "0.6216737", "0.6203885", "0.6125107", "0.61211383", "0.60461956", "0.60067147", "0.5993459", "0.5991128", "0.5991128", "0.5963669", "0.5963669", "0.5961233", "0.5959701", "0.5948601", "0.59477663", "0.59348744", "0.59264326", "0.5921416", "0.5914204", "0.59121484", "0.59111613", "0.5894297", "0.5882588", "0.5880947", "0.5826686", "0.58158445", "0.5813949", "0.58016163", "0.57954675", "0.57920676", "0.5787779", "0.57788175", "0.57694966", "0.5763405", "0.576276", "0.57608116", "0.57607347", "0.57598305", "0.57557267", "0.5755564", "0.57484025", "0.5734618", "0.5724793", "0.5720828", "0.5719647", "0.57143986", "0.57136685", "0.5709374", "0.5705547", "0.5701376", "0.56986505", "0.56916493", "0.5682737", "0.56764716", "0.56764126", "0.56634986", "0.56586593", "0.56586593", "0.56565577", "0.56542987", "0.5653439", "0.56484115", "0.5646599", "0.5646427", "0.56454134", "0.56453234", "0.56443226", "0.5635181", "0.562311", "0.56212974", "0.56194854", "0.5618539", "0.5616485", "0.5613125", "0.5610429", "0.5604991", "0.5602879", "0.5595474", "0.5589601", "0.55887395", "0.5587823", "0.5580095", "0.5578415", "0.5572178", "0.5566504", "0.5561652", "0.5559582", "0.55588245" ]
0.0
-1
Takes data to corresponding page's save method
public function add_to_store(Request $request) { Log::info("TransactionController->add_to_store :- Inside "); return $this->store_transaction($request, "remote"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save( $data ){\n\t\t\t$pageIDs = array_values( array_diff($data['chosenPages'], array('0')) );\n\t\t\t$args['serializedPageIDs'] = Loader::helper('json')->encode( $pageIDs );\n\t\t\tparent::save( $args );\n\t\t}", "public function save( $data ){\n\t\t\t$args['numToShow'] \t = (int) $data['numToShow'];\n $args['displayBeneath'] = (int) $data['displayBeneath'];\n $args['parentPageID'] = (int) $data['parentPageID'];\n\t\t\tparent::save( $args );\n\t\t}", "function savePage(PageInterface $page);", "public static function save() {\n\t\t\t$page_title = $_POST['page_title'];\n\t\t\t$meta['dod_custom_css'] = $_POST['custom_css'];\n\t\t\t$meta['_wp_page_template'] = $_POST['page_template'];\n\t\t\treturn dd_update_page(get_option('dod_page_id'), $page_title, '', $meta);\n\t\t}", "public function saveData()\r\n {\r\n \r\n }", "function savepage()\r\n\t{\r\n\t\t$model\t\t=& $this->getModel( 'Formsession' );\r\n\t\t$model->savePage();\r\n\t}", "function Save()\n\t{\n\t\treturn RecentPageOperations::InsertPage($this);\n\t}", "abstract protected function save($data);", "abstract public function save( $data );", "public function save($data);", "public function save($data);", "public function save($data);", "function customcert_save_page_data($data) {\n global $DB;\n\n // Set the time to a variable.\n $time = time();\n\n // Get the existing pages and save the page data.\n if ($pages = $DB->get_records('customcert_pages', array('customcertid' => $data->id))) {\n // Loop through existing pages.\n foreach ($pages as $page) {\n // Get the name of the fields we want from the form.\n $width = 'pagewidth_' . $page->id;\n $height = 'pageheight_' . $page->id;\n // Create the page data to update the DB with.\n $p = new stdClass();\n $p->id = $page->id;\n $p->width = $data->$width;\n $p->height = $data->$height;\n $p->timemodified = $time;\n // Update the page.\n $DB->update_record('customcert_pages', $p);\n }\n }\n}", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n {\n }", "public function save($data)\n\t{\n\t}", "function save_page() {\n \t$forceXHR = setXHRDebug($this, 0);\n $this->layout = null;\n $ret = 0;\n\t\tif ($this->data) {\n /*\n\t\t\t * COPIED FROM /pagemaker/save_page !!!\n * POST - save/append/delete PageGallery file\n */ \t\n // allow guest users to save\n $dest = $this->data['dest'];\t// dest\tfile, book\n if (isset($this->data['key']) && $this->data['key']!=='undefined') $secretKeyDest = $this->data['key'];\n\t\t\tif (empty($secretKeyDest)) {\n\t\t\t\t// NOTE: to save different stories for the same dest/filename, make sure key is empty\n\t\t\t\t$uuid = AppController::$userid ? AppController::$userid : String::uuid();\n\t\t\t\t$secretKeyDest = $this->__getSecretKey($uuid, $this->__getSeed($dest));\n\t\t\t}\n \tif ($secretKeyDest) {\t\n\t $content = $this->data['content'];\t\t// page content\n\t /*\n\t * read content from page\n\t */\n\t \t\tif (empty($content)) {\n\t \t\t\t$src = $this->data['src'];\t\t// source file, stored in /svc/pages\n\t \t\t\t$secretKeySrc = $this->__getSecretKey($uuid, $this->__getSeed($src));\n\t\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$src.'_'.$secretKeySrc.'.div';\n\t\t $content = @file_get_contents($File);\n\t \t\t}\n\t /*\n\t * append or write content to book\n\t */\n\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$dest.'_'.$secretKeyDest.'.div';\n\t // append page to book\n\t $mode = isset($this->data['reset']) ? 'w' : 'a';\n\t $Handle = fopen($File, $mode);\n\t fwrite($Handle, $content);\n\t fclose($Handle);\n\t // don't unlink\n\t $ret = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$ret = false;\n\t\t}\n\t\t$this->autoRender = false;\n\t\theader('Content-type: application/json');\n\t\theader('Pragma: no-cache');\n\t\theader('Cache-control: no-cache');\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); \t\t\n\t\t$success = $ret ? true : false;\n\t\tif ($success) {\n\t\t\theader(\"HTTP/1.1 201 CREATED\");\n\t\t\t$message = \"Your Story was saved.\";\n\t\t\t$response = array(\n\t\t\t\t'key'=>$secretKeyDest, \n\t\t\t\t'link'=>\"/gallery/story/{$dest}_{$secretKeyDest}\",\n\t\t\t);\n\t\t} else {\n\t\t\t$message = \"There was an error saving your Story. Please try again.\";\n\t\t\t$response = array();\n\t\t}\n\t\techo json_encode(compact('success', 'message', 'response'));\n\t\treturn;\n }", "public function store($data)\n {\n $this->pagamento = $data['pagamento'];\n $this->sconto = $data['sconto'];\n self::save();\n }", "public function save(BannerInterface $page);", "protected function saving() {\n // This will get reimplemented by children when necessary\n }", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "public function postSave() {}", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "public function store()\n {\n $this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);\n\n Page::updateOrCreate(['id' => $this->page_id], [\n 'title' => $this->title,\n 'body' => $this->body,\n 'published' => true\n\n ]);\n\n session()->flash('message',\n $this->page_id ? 'Page Updated Successfully.' : 'Page Created Successfully.');\n\n $this->closeModal();\n $this->closeShowModal();\n $this->resetInputFields();\n }", "protected function _postSave()\r\n\t{\r\n\t}", "public function save() {}", "public function save() {}", "public function save() {}", "public function save($data): void;", "public function save()\r\n {\r\n \r\n }", "function save_postdata( $post_id ) {\n\tglobal $post, $new_meta_boxes;\n\n\tif(isset($post) && $post->post_type=='page'){\n\t\t$new_meta_boxes=$GLOBALS['new_meta_boxes'];\n\t\tpexeto_save_meta_data($new_meta_boxes, $post_id);\n\t}\n}", "public function save()\r\n {\r\n //\r\n }", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save() {\n\t\t\t\n\t\t}", "function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public abstract function save();", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_TOTAL_KEY, $this->total_reports );\n\t}", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "public function save()\n {\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "protected function save_meta() {}", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function save()\n {\n $this->data = [\n 'pb_name' => \\Input::get('pb_name'),\n 'title' => \\Input::get('title'),\n 'subtitle' => \\Input::get('subtitle'),\n 'description' => \\Input::get('description'),\n 'css_classes' => \\Input::get('css_classes'),\n 'image_ref' => \\Pageblok::uploadFile(\\Input::file('image_ref')),\n 'hyperlink' => \\Input::get('hyperlink'),\n 'template' => \\Input::get('template'),\n 'content_type' => \\Input::get('content_type'),\n 'content' => \\Input::get('content'),\n 'published' => \\Input::get('published'),\n 'start_datetime' => \\Carbon::parse(\\Input::get('start_datetime'))->format('Y-m-d H:i:s'),\n 'end_datetime' => \\Carbon::parse(\\Input::get('end_datetime'))->format('Y-m-d H:i:s'),\n 'address' => \\Input::get('address'),\n 'city' => \\Input::get('city'),\n 'country' => \\Input::get('country'),\n 'group' => \\Input::get('group'),\n 'created_by' => \\Auth::user()->id,\n ];\n\n if ($this->data['address'] && $this->data['city']) {\n $this->data['latitude'] = \\TsEvent::getLatitudeLongitude(\n \\Input::get('address'),\n \\Input::get('city'),\n \\Input::get('country')\n )['latitude'];\n }\n $this->data['longitude'] = \\TsEvent::getLatitudeLongitude(\n \\Input::get('address'),\n \\Input::get('city'),\n \\Input::get('country')\n )['longitude'];\n\n return parent::save();\n }", "public function saving(Page $page)\n {\n if ((bool) $page->is_home) {\n $query = Page::where('is_home', 1);\n if ($page->id) {\n $query->where('id', '!=', $page->id);\n }\n $query->update(['is_home' => 0]);\n }\n }", "public final function save() {\n }", "function save ($info) {\r\n\t\t// 2) copy $this into store\t\r\n\t}", "public function save()\n {\n //\n }", "public function save() {\n }", "public function save() {\n }", "public function save() {\n }", "public function save()\n\t{\n\n\t}", "public function Save()\n {\n $required = array(\n \"title\" => \"Título\",\n \"src\" => \"Imagem\"\n );\n $this->validateData($required);\n parent::Save();\n }", "public function savePage(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'slug' => 'required',\n 'metaTitle' => 'required',\n 'metaKeyword' => 'required',\n 'metaDescription' => 'required',\n 'pageCategoryId' => 'required|numeric|min:1',\n ]);\n $userId = Auth::id();\n $addPage = Page::savePageDetails($request, $userId);\n $message = $request->id != '' ? 'updated' : 'saved';\n return redirect('/admin/pages/list')->with('successMessage', 'Page ' . $message . ' successfully');\n }", "public function save()\n {\n }", "public function save()\n {\n }", "abstract protected function saveItems();", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "public final function save()\n {\n }", "function save();", "function save();", "public function savePageContent($data){\n $this->db->insert($data,'page_docs');\n return $this->db->getLastInsertId();\n\n }", "public function saved(Page $page)\n {\n if ((bool) !$page->is_home) {\n if (Page::where('is_home', 1)->count() === 0) {\n Page::whereNull('parent_id')->orderBy('position')->take(1)->update(['is_home' => 1]);\n }\n }\n }", "public function sitePageSaveAction ()\n {\n \t$response = new stdClass();\n\t $response->success = true;\n\t \n \ttry {\n \t\t$pageId = $this->_getParam ('id',0);\n \t\t$parentId = $this->_getParam ('parentId',0);\n \t\t\n \t\tif ($pageId<=0 && $parentId<=0)\n\t\t\t\tthrow new Zend_Exception (\"Page updated failed - no page id or parentId\");\n \t\telseif ($pageId>0) {\n\t\t \t$Page = Tg_Site::getInstance ()->getPageById($pageId);\n\t\t\t\tif (!$Page)\n\t\t\t\t\tthrow new Zend_Exception (\"Page updated failed - page not found\");\n\n foreach ($Page->getParent()->getPages() as $subPage)\n {\n if ($subPage->name == $_POST['name'] && $subPage->id != $_POST['id'])\n {\n throw new Zend_Exception (\"Page updated failed - path already used\");\n }\n }\n\n\n\t\t\t\t$Page->update ($_POST);\n\t\t\t\t\n\t\t\t\t$response->msg = \"Page updated\";\n\t\t\t} elseif ($parentId>0) {\n\t\t\t\t$Parent = Tg_Site::getInstance ()->getPageById($this->_getParam ('parentId'));\n\t\t\t\tif (!$Parent)\n\t\t\t\t\tthrow new Zend_Exception (\"Page updated failed - parent page not found\");\n\n\n foreach ($Parent->getPages() as $subPage)\n {\n if ($subPage->name == $_POST['name'])\n {\n throw new Zend_Exception (\"Page updated failed - path already used\");\n }\n }\n\n\t\t\t\t$Page = Tg_Site::getInstance ()->appendPage ($_POST, $Parent);\n\t\t\t\t\n\t\t\t\t$response->msg = \"Page added\";\n\t\t\t} else {\n\t\t\t\t$Page->update ($_POST);\n\t\t\t\t\n\t\t\t\t$response->msg = \"Page updated\";\n\t\t\t}\n\t\t\t$response->page=$Page->toStdObject('read',false);\n\t\t} catch (Zend_Exception $exp)\n\t\t{\n\t\t\t$response->success = false;\n\t\t\t$response->msg = $exp->getMessage ();\t\n\t\t}\n\t\t\n\t\techo Zend_Json::encode ($response);\n\t\tdie;\t\t\n }", "public function saveData($request, $page_id = '')\n {\n //Get data from form\n $page_titles = $request->input('page_title');\n $page_contents = $request->input('page_contents');\n $languages = AppLanguage::orderBy('language_name')->get();\n foreach ($languages as $language) {\n $page_detail = self::where('static_page_id', '=', $page_id)\n ->where('language_code', '=', $language->code)\n ->first();\n if (!$page_detail) {\n $page_detail = new self();\n }\n $page_detail->static_page_id = $page_id;\n $page_detail->language_code = $language->code;\n $page_detail->page_title = $page_titles[$language->code];\n $page_detail->page_contents = $page_contents[$language->code];\n $page_alias = str_slug($page_titles[$language->code].'-'.$page_id, '-');\n $page_detail->page_alias = $page_alias;\n $results = $page_detail->save();\n if (!$results) {\n return $results;\n }\n }\n\n return $results;\n }", "public function save(){\n }", "public function store(Request $request)\n {\n\n $data = $request->all();\n\n $newPage = new Page;\n\n $newPage->user_id = $data['user_id'];\n\n $newPage->title = $data['title_page'];\n\n $newPage->slug = Str::slug($data['title_page']);\n\n $newPage->description = $data['description_page'];\n\n $newPage->save();\n\n\n $pageId = $newPage->id;\n\n\n $newSection = new Section;\n\n $newSection->page_id = $pageId;\n\n $newSection->title = $data['title_section'];\n\n $newSection->slug = Str::slug($data['title_section']);\n\n $newSection->save();\n\n\n $sectionId = $newSection->id;\n\n\n $newTitle = new Title;\n\n $newTitle->section_id = $sectionId;\n\n $newTitle->title = $data['element_title_title'];\n\n $newTitle->slug = Str::slug($data['element_title_title']);\n\n $newTitle->text = $data['element_text_title'];\n\n $newTitle->save();\n\n\n $newSubtitle = new Subtitle;\n\n $newSubtitle->section_id = $sectionId;\n\n $newSubtitle->title = $data['element_title_subtitle'];\n\n $newSubtitle->slug = Str::slug($data['element_title_subtitle']);\n\n $newSubtitle->text = $data['element_text_subtitle'];\n\n $newSubtitle->save();\n\n\n $newDescription = new Description;\n\n $newDescription->section_id = $sectionId;\n\n $newDescription->title = $data['element_title_description'];\n\n $newDescription->slug = Str::slug($data['element_title_description']);\n\n $newDescription->text = $data['element_text_description'];\n\n $newDescription->save();\n\n\n $newImage = new Image;\n\n $slug = Str::slug($data['element_title_image']);\n\n $newImage->section_id = $sectionId;\n\n $newImage->title = $data['element_title_image'];\n\n $newImage->slug = $slug;\n\n Storage::disk('public')->put('pageImage', $data['image']);\n\n $filename = $data['image']->hashName();\n\n $path = 'http://localhost:8000/storage/pageImage/' . $filename;\n\n $newImage->path = $path;\n\n $newImage->save();\n\n return redirect()->route('admin.pages.index');\n\n }", "function save()\n {\n }", "function save()\n {\n }", "public function save():void;", "public function save()\n {\n Session::clear(\"Checkout.PostageID\");\n \n // Extend our save operation\n $this->extend(\"onBeforeSave\");\n\n // Save cart items\n Session::set(\n \"Checkout.ShoppingCart.Items\",\n serialize($this->items)\n );\n\n // Save cart discounts\n Session::set(\n \"Checkout.ShoppingCart.Discount\",\n serialize($this->discount)\n );\n\n // Update available postage\n if ($data = Session::get(\"Form.Form_PostageForm.data\")) {\n $country = $data[\"Country\"];\n $code = $data[\"ZipCode\"];\n $this->setAvailablePostage($country, $code);\n }\n }", "public function saveToDatabase($data)\n {\n }", "private function saveData()\n { \n // Save form data in session\n if (count($this->post) > 0) {\n $_SESSION['gentlesource_voting_configuration'] = $this->post;\n $this->data = $this->post;\n $this->votingOptions = $this->post['votingOptions'];\n } else {\n if (isset($_SESSION['gentlesource_voting_configuration'])) {\n $this->data = $_SESSION['gentlesource_voting_configuration'];\n $this->votingOptions = $this->data['votingOptions'];\n }\n }\n }", "public function save()\n\t{\n\t\n\t\tif ($this->id == null) throw new Exception(\"Cannot save. id is null\");\n\t\t\n\t\t//store the data in the content column so that our worker will be searchable.\n\t\t$wp_content = \"\";\n\t\t\n\t\tforeach($this->values as $field=>$value)\n\t\t{\n\t\t\tupdate_post_meta($this->id, $field, $value);\n\t\t\t$wp_content .= \"<div>$value</div>\";\n\t\t}\n\t\t\n\t\t//wp_die($wp_content);\n\n\t\t//save the data entry in wp_posts\n\t\tglobal $wpdb;\n\t\t$wpdb->update(\n\t\t\t$wpdb->posts, \n\t\t\tarray(\n\t\t\t\t\"post_content\" => $wp_content,\n\t\t\t\t\"post_title\" => \"{$this->values['lastname']}, {$this->values['firstname']} {$this->values['middlename']}\" \n\t\t\t),\n\t\t\tarray(\"ID\" => $this->id),\n\t\t\tarray(\"%s\"),\n\t\t\tarray(\"%d\")\n\t\t);\n\t\t\n\t\t\n\t}", "public function savePage($pageId, $page)\n {\n $this->setEdittedOCRStream($pageId, $page);\n }", "public function saveData(): void\n {\n studentLoader::saveStudent(new student($_POST['lastName'], $_POST['firstName'], $_POST['email'], new group($_POST['className']), $_POST['id']), $this->pdo);\n }" ]
[ "0.7460094", "0.73460484", "0.7229155", "0.72168255", "0.69829553", "0.6969521", "0.6950547", "0.68590856", "0.6858103", "0.6772109", "0.6772109", "0.6772109", "0.67505443", "0.67444974", "0.67444974", "0.6743579", "0.6743579", "0.6743397", "0.6681818", "0.66732275", "0.6658988", "0.6655571", "0.66541684", "0.6610771", "0.66039443", "0.65810084", "0.65810084", "0.65810084", "0.65810084", "0.65810084", "0.65747505", "0.65670085", "0.65481025", "0.65481025", "0.6544501", "0.6539642", "0.65321964", "0.6486978", "0.648671", "0.6482167", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6482126", "0.6481567", "0.64752537", "0.6469214", "0.6387401", "0.6374498", "0.63634866", "0.63627654", "0.63229984", "0.6320768", "0.63204414", "0.6308353", "0.6298565", "0.6285932", "0.62849575", "0.6272097", "0.6265074", "0.6265074", "0.62642664", "0.62610114", "0.62605345", "0.6247849", "0.6247849", "0.6241972", "0.62373257", "0.6236378", "0.62304056", "0.6224376", "0.6224376", "0.62054324", "0.620058", "0.62002254", "0.6197827", "0.61956453", "0.61890554", "0.61749256", "0.61749256", "0.6165741", "0.61573565", "0.61536306", "0.6142393", "0.61414355", "0.61353546", "0.6131516" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request) { Log::info("TransactionController->update :- Inside "); return $this->store_transaction($request, "update"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id,$module_name=false) { Log::info("TransactionController->edit :- Inside id ".$id); $now = Carbon::now(); $current_date = $now->format('Y-m-d H:i:s'); $add_date = date("Y-m-d H:i:s", strtotime("+1 hours")); $organization_id = Session::get('organization_id'); if($module_name){ $module_name=$module_name; }else{ $module_name = Session::get('module_name'); } //dd($module_name); $item_status = VehicleJobItemStatus::where('name','Open')->first()->id; $vehicle_sevice_type = ServiceType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_sevice_type->prepend('Select Service type', ''); $job_card_status = VehicleJobcardStatus::where('status', '1')->pluck('name', 'id'); $job_card_status->prepend('Select Jobcard Status', ''); $vehicle_make_id = VehicleMake::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_make_id->prepend('Select Vehicle Make', ''); $vehicle_model_id = VehicleModel::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_model_id->prepend('Select Vehicle Model', ''); $vehicle_tyre_size = VehicleTyreSize::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_tyre_size->prepend('Select Tyre Size', ''); $vehicle_tyre_type = VehicleTyreType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_tyre_type->prepend('Select Tyre Type', ''); $vehicle_variant = VehicleVariant::orderBy('name')->pluck('name', 'id'); $vehicle_variant->prepend('Select Vehicle Variant', ''); $vehicle_wheel = VehicleWheel::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_wheel->prepend('Select Vehicle Wheel', ''); $fuel_type = VehicleFuelType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $fuel_type->prepend('Select Fuel Type', ''); $rim_type = VehicleRimType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $rim_type->prepend('Select Rim Type', ''); $body_type = VehicleBodyType::where('status', '1')->orderBy('name')->pluck('name', 'id'); $body_type->prepend('Select Body Type', ''); $vehicle_category = VehicleCategory::where('organization_id', $organization_id)->orderBy('name')->pluck('name', 'id'); $vehicle_category->prepend('Select Vehicle Category', ''); $vehicle_drivetrain = VehicleDrivetrain::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_drivetrain->prepend('Select Vehicle Drivetrain', ''); $service_type = ServiceType::where('organization_id', $organization_id)->orderBy('name')->pluck('name', 'id'); $service_type->prepend('Select Service Type', ''); $vehicle_usage = VehicleUsage::where('status', '1')->orderBy('name')->pluck('name', 'id'); $vehicle_usage->prepend('Select Vehicle Usage', ''); $maintanance_reading = VehicleMaintenanceReading::where('status', '1')->pluck('name', 'id'); $maintanance_reading->prepend('Select Maintenance Reading', ''); /*$vehicles_register = VehicleRegisterDetail::where('organization_id', $organization_id)->pluck('registration_no', 'id'); $vehicles_register->prepend('Select Vehicle', '');*/ $vehicles_register = VehicleRegisterDetail::leftjoin('wms_vehicle_organizations','wms_vehicle_organizations.vehicle_id','=','vehicle_register_details.id')->where('wms_vehicle_organizations.organization_id', $organization_id)->pluck('registration_no', 'vehicle_register_details.id'); $vehicles_register->prepend('Select Vehicle', ''); $reading_factor = WmsReadingFactor::select('wms_reading_factors.id AS reading_factor_id', 'wms_reading_factors.name AS reading_factor_name', 'wms_applicable_divisions.id AS wms_division_id', 'wms_applicable_divisions.division_name') ->leftJoin('wms_applicable_divisions', 'wms_applicable_divisions.id','=','wms_reading_factors.wms_division_id') ->where('wms_reading_factors.organization_id', $organization_id)->get(); $people_list = People::select('person_id AS id', DB::raw('IF(mobile_no, CONCAT(display_name, " - " , mobile_no), display_name) AS name'), 'person_id')->where('user_type', 0)->where('organization_id', Session::get('organization_id')); $business_list = People::select('business_id AS id', DB::raw('IF(mobile_no, CONCAT(display_name, " - " , mobile_no), display_name) AS name'), 'business_id')->where('user_type', 1)->where('organization_id', Session::get('organization_id')); $transactions = Transaction::where('id',$id)->where('organization_id',$organization_id)->first(); $stock_item_update = TransactionItem::where('transaction_id', $transactions->id)->first(); $cus_name = ($transactions->name.'-'.$transactions->mobile); $print_templates = MultiTemplate::select('multi_templates.id','multi_templates.voucher_id','account_voucher_types.display_name','multi_templates.print_temp_id','print_templates.display_name','print_templates.data') ->leftjoin('account_voucher_types','account_voucher_types.id','=','multi_templates.voucher_id') ->leftjoin('print_templates','print_templates.id','=','multi_templates.print_temp_id') ->where('multi_templates.organization_id',$organization_id) ->where('voucher_id',22) ->groupby('multi_templates.print_temp_id') ->get(); $estimation_print_templates = MultiTemplate::select('multi_templates.id','multi_templates.voucher_id','account_voucher_types.display_name','multi_templates.print_temp_id','print_templates.display_name','print_templates.data') ->leftjoin('account_voucher_types','account_voucher_types.id','=','multi_templates.voucher_id') ->leftjoin('print_templates','print_templates.id','=','multi_templates.print_temp_id') ->where('multi_templates.organization_id',$organization_id) ->where('voucher_id',21) ->groupby('multi_templates.print_temp_id') ->get(); $wms_transaction_readings = WmsReadingFactor::select('wms_reading_factors.name As reading_factor_name','wms_reading_factors.id AS reading_factor_id', 'wms_transaction_readings.reading_values','wms_transaction_readings.reading_notes','wms_transaction_readings.id As id')->LeftJoin('wms_transaction_readings', function($join) use ($id) { $join->on('wms_transaction_readings.reading_factor_id', '=', 'wms_reading_factors.id') ; $join->where('wms_transaction_readings.transaction_id', '=',$id) ;}) ->where('wms_reading_factors.organization_id', $organization_id)->get(); $wms_attachments_before=WmsAttachment::select('id','organization_id','image_name','image_origional_name','thumbnail_file','thumbnail_file','origional_file','transaction_id')->where('transaction_id', $id)->where('image_category', 1)->where('organization_id',$organization_id)->get(); $wms_attachments_progress=WmsAttachment::select('id','organization_id','image_name','image_origional_name','thumbnail_file','thumbnail_file','origional_file','transaction_id')->where('transaction_id', $id)->where('image_category', 2)->where('organization_id',$organization_id)->get(); $wms_attachments_after=WmsAttachment::select('id','organization_id','image_name','image_origional_name','thumbnail_file','thumbnail_file','origional_file','transaction_id')->where('transaction_id', $id)->where('image_category', 3)->where('organization_id',$organization_id)->get(); $wms_checklist_query=VehicleChecklist::select('vehicle_checklists.name','vehicle_checklists.id as checklist_id','wms_checklists.transaction_id','wms_checklists.checklist_status','wms_checklists.checklist_notes','wms_checklists.id as id') ->LeftJoin('wms_checklists', function($join) use ($id) { $join->on('wms_checklists.checklist_id', '=', 'vehicle_checklists.id') ; $join->where('wms_checklists.transaction_id', '=',$id); }) ->orderBy('vehicle_checklists.id','ASc'); $wms_checklist=$wms_checklist_query->get(); $reference_transaction_type = null; $reference_transaction = Transaction::find($transactions->reference_id); $wms_transaction = WmsTransaction::select('wms_transactions.*','wms_transactions.service_type','wms_transactions.jobcard_status_id','wms_transactions.purchase_date','vehicle_register_details.*','wms_transactions.next_visit_mileage','wms_transactions.vehicle_next_visit','wms_transactions.vehicle_next_visit_reason','wms_transactions.name as name_of_job','wms_transactions.job_date','wms_transactions.job_due_date','wms_transactions.job_completed_date','wms_transactions.registration_id','wms_transactions.vehicle_note','wms_transactions.vehicle_complaints','vehicle_variants.vehicle_configuration','wms_transactions.driver','wms_transactions.driver_contact','wms_transactions.shift_id','wms_transactions.pump_id') ->leftjoin('vehicle_register_details', 'vehicle_register_details.id', '=', 'wms_transactions.registration_id') ->leftjoin('vehicle_variants','vehicle_variants.id','=','vehicle_register_details.vehicle_configuration_id') ->where('wms_transactions.organization_id', $organization_id) ->where('wms_transactions.transaction_id', $transactions->id) ->first(); Log::info("TransactionController->Edit :- getLastjob card Number with transaction Id after line 2905 - ".json_encode($transactions->id)); Log::info("TransactionController->Edit :- getLastjob card Number with after line 2906 - ".json_encode($wms_transaction)); if($module_name == "trade_wms") { $last_job_card_id = ''; $copy_job = Transaction::where('order_no',$wms_transaction->vehicle_last_job)->exists(); if($copy_job == true) { $last_job_card_id = Transaction::where('order_no',$wms_transaction->vehicle_last_job) ->where('organization_id',$organization_id)->where('deleted_at',NULL)->first(); Log::info("TransactionController->Edit :- getLastjob card Number with after line 2894 - ".$last_job_card_id); if($last_job_card_id) { $last_job_card_id = $last_job_card_id->id; } else { $last_job_card_id = ""; } Log::info("TransactionController->Edit :- getLastjob card Number with after line 2903 - ".$last_job_card_id); } } if($reference_transaction != null) { $reference_transaction_account = AccountVoucher::find($reference_transaction->transaction_type_id); if($reference_transaction_account != null) { $reference_transaction_type = $reference_transaction_account->name; } } $transaction_type = AccountVoucherType::select('account_vouchers.*', 'modules.name AS module') ->leftjoin('module_voucher', 'module_voucher.voucher_type_id', '=', 'account_voucher_types.id') ->leftjoin('account_vouchers', 'account_vouchers.voucher_type_id', '=', 'account_voucher_types.id') ->leftjoin('modules', 'modules.id', '=', 'module_voucher.module_id') ->where('account_vouchers.organization_id', $organization_id) ->where('modules.name', $module_name) ->where('account_vouchers.id', $transactions->transaction_type_id) ->first(); //AccountVoucher::where('name', $type)->where('organization_id', $organization_id)->first(); //dd($transaction_type); if($transaction_type == null) { return null; } /*$transaction_type = AccountVoucher::find($transactions->transaction_type_id);*/ $type = $transaction_type->name; // $previous_entry = Transaction::where('transaction_type_id', $transaction_type->id)->where('organization_id', $organization_id)->orderby('id', 'desc')->first(); // $gen_no = ($previous_entry != null) ? ($previous_entry->gen_no + 1) : $transaction_type->starting_value; Log::info("TransactionController->Edit :- Custom::getLastGenNumber - ".$transaction_type->id. ' -- '.$organization_id); $getGen_no=Custom::getLastGenNumber( $transaction_type->id, $organization_id ); Log::info("TransactionController->Edit :- after Custom::getLastGenNumber - ".$getGen_no); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } $voucher_no = Custom::generate_accounts_number($transaction_type->name, $gen_no, false); $sale_account = AccountGroup::where('name', 'sale_account')->where('organization_id', $organization_id)->first()->id; $account_ledgers = AccountLedger::where('group_id', $sale_account)->where('organization_id', $organization_id)->pluck('name', 'id'); $account_ledgers->prepend('Select Account', ''); $employees = HrmEmployee::select('hrm_employees.id', DB::raw('CONCAT(first_name, " ", COALESCE(last_name, "")) AS name'))->where('organization_id', $organization_id)->pluck('name', 'id'); $employees->prepend('Select Sales Person', ''); $person_id = Auth::user()->person_id; $employee = HrmEmployee::select('hrm_employees.id') ->where('hrm_employees.organization_id', $organization_id) ->where('hrm_employees.person_id', $person_id) ->first(); $selected_employee = ($employee != null) ? $employee->id : null; $shipment_mode = ShipmentMode::where('organization_id', $organization_id)->pluck('name', 'id'); $shipment_mode->prepend('Select Shipment Mode', ''); $job_item_status = VehicleJobItemStatus::where('status', '1')->pluck('name', 'id'); $job_item_status->prepend('Select Status', ''); $payment_terms = PaymentTerm::where('status', '1')->pluck('display_name','id'); $payment_terms->prepend('Select Payment Term ',''); $payment_term = PaymentTerm::where('name', 'Immediate')->first()->id; $items = InventoryItem::select('inventory_items.id', 'inventory_items.name', 'global_item_categories.display_name AS category', 'inventory_items.include_tax', 'inventory_items.include_purchase_tax') ->leftjoin('global_item_models', 'global_item_models.id', '=', 'inventory_items.global_item_model_id') ->leftjoin('global_item_categories','global_item_categories.id','=','global_item_models.category_id') ->where('inventory_items.organization_id', $organization_id) ->where('inventory_items.status', 1) ->orderby('global_item_categories.display_name') ->get(); /*$items = InventoryItem::where('status', '1')->pluck('name','id'); $items->prepend('Select Item ','');*/ $tax = TaxGroup::select('tax_groups.id', 'tax_groups.display_name', 'tax_types.name as tax_type', DB::raw('SUM(taxes.value) AS value'),'taxes.id as tax_id', 'taxes.display_name AS tax_name', DB::raw("CONCAT('[', GROUP_CONCAT('{', '\"id\":', taxes.id, ',', '\"name\": ', '\"',taxes.name,'\"', ',', '\"value\":', taxes.value, '}'),']') AS tax_value")); $tax->leftjoin('tax_types', 'tax_types.id', '=', 'tax_groups.tax_type_id'); $tax->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id'); $tax->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id'); $tax->where('tax_groups.organization_id', $organization_id); $tax->groupby('tax_groups.id'); $taxes = $tax->get(); $discount = Discount::select('id', 'display_name', 'value'); $discount->where('organization_id', $organization_id); $discounts = $discount->get(); $weekdays = Weekday::pluck('display_name','id'); $weekday = Weekday::where('name','monday')->first()->id; $days = []; for ($i=1; $i <= 28; $i++) { $days[$i] = $i; } $days[0] = "Last"; if($transaction_type == null) abort(404); $country = Country::where('name', 'India')->first(); $state = State::where('country_id', $country->id)->pluck('name', 'id'); $state->prepend('Select State', ''); $title = PeopleTitle::pluck('display_name','id'); $title->prepend('Title',''); $payment = PaymentMode::where('status', '1')->pluck('display_name','id'); $payment->prepend('Select Payment Method',''); $voucher_terms = Term::select('id', 'name', 'display_name', 'days')->where('organization_id', $organization_id)->get(); $terms = Term::select('id', 'display_name')->where('organization_id', $organization_id)->pluck('display_name', 'id'); $terms->prepend('Select Term',''); $selected_term = Term::where('organization_id', $organization_id)->where('name', 'on_receipt')->first(); $make = VehicleMake::where('status', 1)->orWhere('organization_id', $organization_id)->pluck('display_name', 'id'); $make->prepend('Select Make', ''); $job_type = JobType::where('status', 1)->orWhere('organization_id', $organization_id)->pluck('display_name', 'id'); $address_type = BusinessAddressType::where('name','business')->first(); $business_id = Organization::find($organization_id)->business_id; $business_communication_address = BusinessCommunicationAddress::select('business_communication_addresses.placename', 'business_communication_addresses.mobile_no', 'business_communication_addresses.email_address', 'business_communication_addresses.address', 'cities.name AS city', 'states.name AS state', 'business_communication_addresses.pin') ->leftjoin('cities', 'business_communication_addresses.city_id', '=', 'cities.id') ->leftjoin('states', 'cities.state_id', '=', 'states.id') ->where('address_type', $address_type->id) ->where('business_id', $business_id) ->first(); $date_label = null; $due_date_label = null; $term_label = null; $order_type = null; $address_label = null; $order_type_value = []; $order_label = null; $payment_label = null; $sales_person_label = null; $include_tax_label = null; $customer_type_label = null; $customer_label = null; $discount_option = false; $person_type = null; $due_date = null; $shipping_date = null; $transaction_address_type = null; $company_label = false; $company_name = null; $company_email = null; $company_mobile = null; $company_address = null; $service_type_label = null; $business_company_address = $business_communication_address->address; if($business_communication_address->address != "" && $business_communication_address->city != "") { $business_company_address .= "\n"; } $business_company_address .= $business_communication_address->city; if($business_communication_address->city != "" && $business_communication_address->state != "") { $business_company_address .= "\n"; } $business_company_address .= $business_communication_address->state." ".$business_communication_address->pin; switch($type) { case 'estimation': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct'))->where('status', 1)->orderby('id')->get(); //$order_type_value = AccountVoucher::whereIn('name', array('Direct'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); //$order_type_value->prepend('Direct', ''); $due_date_label = 'Expiry Date'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $due_date = Carbon::now()->addDays(30)->format('d-m-Y'); $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'sale_order': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'estimation'))->where('status', 1)->orderby('id')->get(); $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'sales': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'sale_order', 'estimation'))->where('status', 1)->orderby('id')->get(); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sale_order', 'estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'sales_cash': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sale_order', 'estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_card': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'estimation'))->where('status', 1)->orderby('id')->get(); //$order_type = "Order Type"; /*$order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', '');*/ $service_type_label = 'Service Type'; $sales_person_label = 'Assigned To'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_request': $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $term_label = 'Terms'; $service_type_label = 'Service Type'; $service_type_label = 'Service Type'; $address_label = 'Customer Address'; $due_date_label = 'Expiry Date'; $sales_person_label = 'Attended By'; $date_label = 'Date'; $due_date = Carbon::now()->addDays(30)->format('d-m-Y'); $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_invoice': $address_label = 'Customer Address'; $service_type_label = 'Service Type'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'sale_order', 'estimation'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $due_date_label = 'Payment Due Date'; $term_label = 'Payment Terms'; $order_type = "Order Type"; $order_label = 'Job Card Number#'; $payment_label = 'Payment Method'; $sales_person_label = 'Invoice By'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'job_invoice_cash': $address_label = 'Customer Address'; $service_type_label = 'Service Type'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'sale_order', 'estimation'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('job_card'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $due_date_label = 'Payment Due Date'; $term_label = 'Payment Terms'; $order_type = "Order Type"; $order_label = 'Job Card Number#'; $payment_label = 'Payment Method'; $sales_person_label = 'Invoice By'; $date_label = 'Invoice Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'delivery_note': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('sale_order', 'sales','sales_cash'))->where('status', 1)->orderby('name', 'desc')->get(); $order_label = 'Order#'; $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sale_order', 'sales', 'sales_cash','job_invoice','job_invoice_cash'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $payment_label = 'Payment Method'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); $discount_option = true; break; case 'receipt': $address_label = 'Customer Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('sales'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sales'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); break; case 'payment': $address_label = 'Vendor Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('purchases'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchases'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Vendor Type'; $customer_label = 'Vendor'; $person_type = "vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Vendor', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $company_label = true; $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'credit_note': $address_label = 'Customer Address'; $order_type = "Order Type"; //$reference_voucher = $reference_vouchers->whereIn('name', array('sales', 'delivery_note'))->where('status', 1)->orderby('id')->get(); $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('sales', 'delivery_note'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Sales Person'; $date_label = 'Date'; $customer_type_label = 'Customer Type'; $customer_label = 'Customer'; $person_type = "customer"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Customer', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_sales', '1'); $discount->where('is_sales', '1'); break; case 'purchase_order': $address_label = 'Supplier Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct'))->where('status', 1)->orderby('id')->get(); $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Supplier Type'; $customer_label = 'Supplier'; $person_type = "Vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Supplier', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'purchases': $address_label = 'Supplier Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('direct', 'purchase_order'))->where('status', 1)->orderby('id')->get(); $due_date_label = 'Due Date'; $term_label = 'Terms'; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchase_order', 'estimation'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_type_value->prepend('Direct', ''); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Supplier Type'; $customer_label = 'Supplier'; $person_type = "Vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Supplier', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $discount_option = true; $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'debit_note': $address_label = 'Vendor Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('purchases', 'goods_receipt_note'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchases', 'goods_receipt_note'))->where('organization_id', $organization_id)->orderby('name', 'desc')->pluck('display_name', 'name'); $order_label = 'Order#'; $payment_label = 'Payment Method'; $sales_person_label = 'Created By'; $date_label = 'Date'; $customer_type_label = 'Vendor Type'; $customer_label = 'Vendor'; $person_type = "vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Vendor', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; case 'goods_receipt_note': $address_label = 'Vendor Address'; //$reference_voucher = $reference_vouchers->whereIn('name', array('purchase_order', 'purchases'))->where('status', 1)->orderby('id')->get(); $order_type = "Order Type"; $order_type_value = AccountVoucher::select('display_name', 'name')->whereIn('name', array('purchase_order', 'purchases'))->where('organization_id', $organization_id)->pluck('display_name', 'name'); $order_label = 'Order#'; $payment_label = 'Payment Method'; $date_label = 'Date'; $customer_type_label = 'Vendor Type'; $customer_label = 'Vendor'; $person_type = "vendor"; $people = $people_list->pluck('name', 'id'); $business = $business_list->pluck('name', 'id'); $people->prepend('Select Vendor', ''); $business->prepend('Select Business', ''); $tax->where('tax_groups.is_purchase', '1'); $discount->where('is_purchase', '1'); $discount_option = true; $company_name = $business_communication_address->placename; $company_email = $business_communication_address->email_address; $company_mobile = $business_communication_address->mobile_no; $company_address = $business_company_address; break; } $field_types = FieldType::select('field_types.id', 'field_types.display_name', 'field_types.name', 'field_formats.id AS format_id', 'field_formats.name AS format') ->leftjoin('field_formats', 'field_formats.id', '=', 'field_types.field_format_id') ->get(); $transaction_fields = TransactionField::select('transaction_fields.id', 'transaction_fields.name', 'field_formats.name as field_format', 'field_types.name as field_type', 'transaction_fields.field_format_id', 'transaction_fields.field_type_id', DB::Raw('GROUP_CONCAT(group_fields.name SEPARATOR "`")as group_name'), 'transaction_fields.sub_heading') ->leftjoin('field_formats', 'field_formats.id', '=', 'transaction_fields.field_format_id') ->leftjoin('field_types', 'field_types.id', '=', 'transaction_fields.field_type_id') ->leftjoin('transaction_fields as group_fields', 'group_fields.group_id', '=', 'transaction_fields.id') ->where('transaction_fields.transaction_type_id', $transaction_type->id) ->where('transaction_fields.status', 1) ->groupby('transaction_fields.id') ->orderby('transaction_fields.sub_heading') ->get(); $sub_heading = TransactionField::select(DB::Raw('DISTINCT(transaction_fields.sub_heading)'))->whereNotNull('transaction_fields.sub_heading')->get(); $selected_make = null; $model = ['' => 'Select Model']; $approvel_status =$transactions->approval_status; $approved_date = $transactions->approved_on; if($module_name == "trade_wms"){ $spec_values = RegisteredVehicleSpec::select('registered_vehicle_specs.spec_id','vehicle_spec_masters.display_name', 'registered_vehicle_specs.spec_value') ->leftjoin('vehicle_spec_masters','vehicle_spec_masters.id','=','registered_vehicle_specs.spec_id') ->where('registered_vehicle_specs.organization_id',$organization_id) ->where('registered_vehicle_specs.registered_vehicle_id',$wms_transaction->registration_id) ->get(); } $shift=HrmShift::where('hrm_shifts.organization_id',$organization_id) ->pluck('hrm_shifts.name','hrm_shifts.id'); $pump_name=FsmPump::where('fsm_pumps.organization_id',$organization_id)->pluck('fsm_pumps.name','fsm_pumps.id'); $org_id = Session::get('organization_id'); $complaints_completed_status = WmsTransactionComplaintService::select(DB::raw('COUNT( wms_transaction_complaint_services.service_group_name_type)as total_complints'), DB::raw('COUNT(IF(wms_transaction_complaint_services.service_status = 1,wms_transaction_complaint_services.service_status,NULL))as completed_count')) ->where('transaction_id',$id) ->where('organization_id',$organization_id) ->first(); $total_complaints = $complaints_completed_status->total_complints; $total_completed = $complaints_completed_status->completed_count; Log::info("TransactionController->edit :- return id ".$id); return view('inventory.transaction_edit', compact('people', 'business', 'voucher_no', 'account_ledgers', 'employees', 'shipment_mode', 'items', 'taxes', 'discounts', 'transaction_type', 'state', 'title', 'payment', 'terms', 'voucher_terms', 'weekdays', 'days', 'weekday', 'type', 'due_date_label', 'term_label', 'order_label', 'payment_label', 'sales_person_label', 'include_tax_label', 'date_label', 'customer_type_label', 'customer_label', 'person_type', 'field_types', 'transaction_fields', 'make', 'selected_make', 'model', 'job_type', 'sub_heading', 'discount_option', 'due_date', 'order_type', 'order_type_value', 'address_label', 'transaction_address_type', 'company_name', 'company_email', 'company_mobile', 'company_address', 'company_label' , 'transactions', 'id','shipping_date', 'reference_transaction_type','service_type_label','vehicle_make_id', 'vehicle_model_id', 'vehicle_tyre_size', 'vehicle_tyre_type', 'vehicle_variant', 'vehicle_wheel', 'fuel_type', 'rim_type', 'body_type', 'vehicle_category', 'vehicle_drivetrain','service_type', 'vehicle_usage', 'maintanance_reading', 'vehicles_register','reading_factor','wms_transaction','vehicle_sevice_type','job_card_status','wms_transaction_readings','wms_attachments_before','wms_attachments_progress','wms_attachments_after','wms_checklist','approvel_status','approved_date','job_item_status','payment_terms','spec_values','org_id','print_templates','shift','pump_name','cus_name','total_complaints','total_completed','estimation_print_templates','last_job_card_id','selected_employee','current_date','add_date','item_status','stock_item_update','selected_term','payment_term')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Request $request) { $organization_id = Session::get('organization_id'); $transaction = Transaction::findOrFail($request->id); Log::info("TransactionController->destroy :- Inside id ".$transaction->id); $stock_item_update = TransactionItem::where('transaction_id', $transaction->id)->first(); if($transaction->reference_id != null){ $reference_status = Transaction::find($transaction->reference_id); } $transaction_type = AccountVoucher::find($transaction->transaction_type_id); $transaction_id = TransactionFieldValue::where('transaction_id', $transaction->id)->get(); if(count($transaction_id) > 0) { foreach($transaction_id as $id) { TransactionFieldValue::where('id', $id->id)->first()->delete(); } } if($transaction->approval_status == 1) { if($transaction_type->name == "credit_note" || $transaction_type->name == "purchases") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } $items = TransactionItem::where('transaction_id', $transaction->id)->get(); if($stock_item_update->stock_update == 1){ foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first(); //dd($inventory_item_batch); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id) ->first(); if($stock != null) { //$inventory_stock = $stock->in_stock - $item->quantity; if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; } $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; /*$stock->entry_id = Custom::add_entry($stock->date, $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false,null,null,null,null,null,null);*/ $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Item Batch Update */ if($inventory_item_batch != null) { /*if($inventory_item_batch->quantity <= $item->quantity) { $inventory_item_batch->quantity= 0.00; } else{ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; } $inventory_item_batch->save();*/ InventoryItemBatch::where('id', $inventory_item_batch->id)->first()->delete(); } /* End */ } } } } if($transaction_type->name == "goods_receipt_note") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } $items = TransactionItem::where('transaction_id', $transaction->id)->get(); if($stock_item_update->stock_update == 0 && $reference_status->approval_status == 1){ foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first(); //dd($inventory_item_batch); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id) ->first(); if($stock != null) { //$inventory_stock = $stock->in_stock - $item->quantity; if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; } $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; /*$stock->entry_id = Custom::add_entry($stock->date, $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false,null,null,null,null,null,null);*/ $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Item Batch Update */ if($inventory_item_batch != null) { /*if($inventory_item_batch->quantity <= $item->quantity) { $inventory_item_batch->quantity= 0.00; } else{ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; } $inventory_item_batch->save();*/ InventoryItemBatch::where('id', $inventory_item_batch->id)->first()->delete(); } /* End */ } } } } if( $transaction_type->name == "debit_note" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::find($item->batch_id); //dd($inventory_item_batch); //$inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first(); /*$data = Custom::get_least_closest_date(json_decode($stock->data, true)); $qty = $data['quantity'];*/ $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id) ->first(); if($stock != null) { $inventory_stock = $stock->in_stock + $item->quantity; $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Item Batch Update */ if($inventory_item_batch != null) { $inventory_item_batch->quantity = $inventory_item_batch->quantity + $item->quantity; $inventory_item_batch->save(); } /* End */ } } } if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } $items = TransactionItem::where('transaction_id', $transaction->id)->get(); if($stock_item_update->stock_update == 1){ foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::find($item->batch_id); //dd($inventory_item_batch); //$inventory_item_batch = InventoryItemBatch::where('transaction_id',$item->transaction_id)->first(); /*$data = Custom::get_least_closest_date(json_decode($stock->data, true)); $qty = $data['quantity'];*/ $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id) ->first(); if($stock != null) { $inventory_stock = $stock->in_stock + $item->quantity; $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 0]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Item Batch Update */ if($inventory_item_batch != null) { $inventory_item_batch->quantity = $inventory_item_batch->quantity + $item->quantity; $inventory_item_batch->save(); } /* End */ } } } } if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { Custom::delete_revenue('total_revenue',$transaction->total); } } $transaction->delete(); if(!empty($transaction->entry_id)) { AccountEntry::where('account_entries.id', $transaction->entry_id)->first()->delete(); } /*over all addon transaction delete*/ Custom::delete_addon('transaction'); /* end */ /* If we need separately addon delete use this */ /*if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { Custom::delete_addon('invoice'); } if($transaction_type->name == "purchases"){ Custom::delete_addon('purchase'); } if($transaction_type->name == "goods_receipt_note"){ Custom::delete_addon('grn'); } if($transaction_type->name == "job_card"){ Custom::delete_addon('job_card'); }*/ /*end*/ Log::info("TransactionController->destroy :- return id ".$transaction->id); return response()->json(['status' => 1, 'message' => 'Transaction'.config('constants.flash.deleted'), 'data' =>['gen_no'=>$transaction->gen_no]]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Inline add to account
public function add_to_transaction(Request $request) { Log::info("TransactionController->add_to_transaction :- Inside "); $organization_id = Session::get('organization_id'); $organization = Organization::findOrFail($organization_id); //dd($organization); $entry = []; /*$existing_transaction = Transaction::find($request->id); $transaction_type = AccountVoucher::find($existing_transaction->transaction_type_id); $reference_voucher = ReferenceVoucher::select('name', 'display_name', 'id')->where('name', $transaction_type->name)->where('status', 1)->get(); $remote_reference_no = $existing_transaction->order_no; $remote_order_id = $existing_transaction->id; */ $transaction_type = AccountVoucher::where('name', $request->transaction_name)->where('organization_id', $organization_id)->first(); $previous_entry = Transaction::where('transaction_type_id', $transaction_type->id)->where('organization_id', $organization)->orderby('id', 'desc')->first(); $existing_transaction = Transaction::where('id', $request->id) ->first(); /* Update for status colour */ DB::table('transactions')->where('id',$existing_transaction->id)->update(['notification_status'=> "2"]); /* end */ $remote_order = Organization::select('organizations.id','organizations.business_id','businesses.business_name','business_communication_addresses.mobile_no','business_communication_addresses.email_address','business_communication_addresses.address') ->leftjoin('businesses','businesses.id','=','organizations.business_id') ->leftjoin('business_communication_addresses','business_communication_addresses.business_id','=','businesses.id') ->where('organizations.id', $existing_transaction->organization_id) ->first(); $existing_transaction_items = TransactionItem::where('transaction_id', $existing_transaction->id)->get(); $transaction = new Transaction; $transaction->user_type = $existing_transaction->user_type; $transaction->reference_no = $existing_transaction->order_no; $transaction->reference_id = $existing_transaction->id; $transaction->people_id = $remote_order->business_id; $transaction->ledger_id = $existing_transaction->ledger_id; $transaction->date = $existing_transaction->date; $transaction->due_date = $existing_transaction->due_date; $transaction->transaction_type_id = $transaction_type->id; $transaction->payment_mode_id = $existing_transaction->payment_mode_id ; $transaction->tax_type = $existing_transaction->tax_type; $transaction->term_id = $existing_transaction->term_id; $transaction->pin = Custom::otp(4); $transaction->name = $remote_order->business_name; $transaction->mobile = $remote_order->mobile_no; $transaction->email = $remote_order->email_address; $transaction->address = $remote_order->address; $transaction->billing_name = $existing_transaction->billing_name; $transaction->billing_mobile = $existing_transaction->billing_mobile; $transaction->billing_email = $existing_transaction->billing_email; $transaction->billing_address = $existing_transaction->billing_address; $transaction->shipping_name = $existing_transaction->shipping_name; $transaction->shipping_mobile = $existing_transaction->shipping_mobile; $transaction->shipping_email = $existing_transaction->shipping_email; $transaction->shipping_address = $existing_transaction->shipping_address; $transaction->shipment_mode_id = $existing_transaction->shipment_mode_id; $transaction->shipping_date = $existing_transaction->shipping_date; $transaction->discount_is_percent = $existing_transaction->discount_is_percent; $transaction->discount = $existing_transaction->discount; $transaction->organization_id = $organization_id; $transaction->sub_total = $existing_transaction->sub_total; $transaction->total = $existing_transaction->total; $transaction->notification_status = 2; $transaction->approval_status = 1; /*if($transaction_type->name == "purchases" || $transaction_type->name == "goods_receipt_note") { $transaction->notification_status = 1; }*/ $transaction->save(); Custom::userby($transaction, true); $account_ledgers = AccountLedger::select('account_ledgers.id'); if($transaction->user_type == 0) { $account_ledgers->where('person_id', $transaction->people_id); $person_id = $transaction->people_id; $business_id = null; } else if($transaction->user_type == 1) { $account_ledgers->where('business_id', $transaction->people_id); $person_id = null; $business_id = $transaction->people_id; } $account_ledger = $account_ledgers->first(); if($account_ledger != null) { $customer_ledger = $account_ledger->id; } else { $impersonal_ledger = AccountLedgerType::where('name', 'impersonal')->first(); $people = People::find($transaction->people_id); if($transaction_type->name == "purchases") { $ledgergroup = AccountGroup::where('name', 'sundry_creditor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'credit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } else if($transaction_type->name == "sales") { $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } else if($transaction_type->name == "job_invoice") { $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } } if($transaction->id != null) { foreach ($existing_transaction_items as $transaction_item) { $item = new TransactionItem; $item->transaction_id = $transaction->id; $item->item_id = $transaction_item->item_id; $item->quantity = $transaction_item->quantity; $item->rate = $transaction_item->rate; $item->amount = $transaction_item->amount; $item->tax = $transaction_item->tax; $item->tax_id = $transaction_item->tax_id; $item->is_tax_percent = $transaction_item->is_tax_percent; $item->discount = $transaction_item->discount; $item->discount_id = $transaction_item->discount_id; $item->is_discount_percent = $transaction_item->is_discount_percent; $item->save(); $item_account = InventoryItem::where('id', $item->item_id)->where('organization_id', $organization_id)->first(); //dd($item_account); if($item->tax_id != null) { $tax_amount = json_decode($item->tax, true); foreach ($tax_amount as $tax) { $tax_value = Tax::find($tax["id"]); if($transaction_type->name == "purchases" || $transaction_type->name == "credit_note") { //Sales Tax is expense, All expenses are debit //Vendor (Payables) gives the item, Credit the giver $entry[] = ['debit_ledger_id' => $tax_value->purchase_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $tax["amount"]]; } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "debit_note" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { //Sales Tax is liability, Liabilities are credit //Customer (Receivables) pays the tax, Debit the receiver $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $tax_value->sales_ledger_id, 'amount' => $tax["amount"]]; } } } if($transaction_type->name == "purchases") { //Item is expense, All expenses are debit //Vendor gives the item, Credit the giver if($item_account != null) { $entry[] = ['debit_ledger_id' => $item_account->expense_account , 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount]; }else{ $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount]; } if($item->discount_id != null) { $discount_amount = json_decode($item->discount); $discount_ledger_id = Discount::findOrFail($item->discount_id)->purchase_ledger_id; //Discount is income, All incomes are credit //Vendor loses amount on discount, All expenses are debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $discount_amount["amount"]]; } } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash") { //Item sale is income, All incomes are credit //Customer gets the item, Debit the receiver $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $item_account->income_account, 'amount' => $item->amount]; if($item->discount_id != null) { $discount_amount = json_decode($item->discount); $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id; //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $discount_amount["amount"]]; } } else if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { //Item sale is income, All incomes are credit //Customer gets the item, Debit the receiver $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount]; if($item->discount_id != null) { $discount_amount = json_decode($item->discount); $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id; //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $discount_amount["amount"]]; } } else if($transaction_type->name == "credit_note") { $sale_return = AccountLedger::where('name', 'sale_return')->where('organization_id', $organization_id)->first()->id; //Sales Return Account Debit //Debtor or Customer Account Credit $entry[] = ['debit_ledger_id' => $sale_return, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount]; if($item_discount_amount != 0) { $discount_ledger = Discount::find($item->discount_id); if($discount_ledger == null) { $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id; } else { $discount_ledger_id = $discount_ledger->purchase_ledger_id; } //Accounts Receivable credit //Discount Allowed debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount]; } } else if($transaction_type->name == "debit_note") { $purchase_return = AccountLedger::where('name', 'purchase_return')->where('organization_id', $organization_id)->first()->id; //Purchase Return Account Credit //Creditor Account Debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $purchase_return, 'amount' => $item->amount]; if($item_discount_amount != 0) { $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id; if($discount_ledger_id == null) { $discount_ledger_id = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first()->id; } //Accounts Payable debit //Discount credit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount]; } } } if($transaction_type->name == "purchases" || $transaction_type->name == "credit_note") { if($transaction->discount != null && $transaction->discount != 0) { $discount_ledger = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first(); //Discount is income, All incomes are credit //Vendor loses amount on discount, All expenses are debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger->id, 'amount' => $transaction->discount]; } } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "debit_note") { if($transaction->discount != null && $transaction->discount != 0) { $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first(); //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount]; } } else if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash" || $transaction_type->name == "debit_note") { if($transaction->discount != null && $transaction->discount != 0) { $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first(); //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount]; } } usort($entry, function ($item1, $item2) { return $item1['debit_ledger_id'] - $item2['debit_ledger_id']; }); $transaction->entry_id = Custom::add_entry($transaction->date, $entry, null, $transaction_type->name, $organization_id, 0, false); $transaction->save(); if($transaction->entry_id != null) { $account_entry = AccountEntry::find($transaction->entry_id); $transaction->order_no = $account_entry->voucher_no; $transaction->gen_no = $account_entry->gen_no; $transaction->save(); } else { // $gen_no = ($previous_entry != null) ? ($previous_entry->gen_no + 1) : $transaction_type->starting_value; $getGen_no=Custom::getLastGenNumber( $transaction_type->id, $organization_id ); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } $transaction->order_no = Custom::generate_accounts_number($transaction_type->name, $gen_no, false); $transaction->gen_no = $gen_no; $transaction->save(); } } Log::info("TransactionController->add_to_transaction :- Return "); return response()->json(['status' => 1, 'message' => $transaction_type->display_name.config('constants.flash.added'), 'data' => []]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAccount(){\n\n\t}", "function InlineAddMode() {\n\t\tglobal $Security, $Language;\n\t\tif (!$Security->CanAdd())\n\t\t\t$this->Page_Terminate(\"login.php\"); // Return to login page\n\t\t$this->CurrentAction = \"add\";\n\t\t$_SESSION[EW_SESSION_INLINE_MODE] = \"add\"; // Enable inline add\n\t}", "function account_add()\r\n {\r\n $page_data['module_type'] = 'account';\r\n $page_data['page_name'] = 'account_add';\r\n $page_data['page_title'] = lang_key('create_new_account');\r\n $this->load->view('admin/index', $page_data);\r\n }", "public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "function InlineAddMode() {\r\n\t\tglobal $Security, $Language;\r\n\t\tif (!$Security->CanAdd())\r\n\t\t\t$this->Page_Terminate(\"login.php\"); // Return to login page\r\n\t\tif ($this->CurrentAction == \"copy\") {\r\n\t\t\tif (@$_GET[\"identries\"] <> \"\") {\r\n\t\t\t\t$this->identries->setQueryStringValue($_GET[\"identries\"]);\r\n\t\t\t\t$this->setKey(\"identries\", $this->identries->CurrentValue); // Set up key\r\n\t\t\t} else {\r\n\t\t\t\t$this->setKey(\"identries\", \"\"); // Clear key\r\n\t\t\t\t$this->CurrentAction = \"add\";\r\n\t\t\t}\r\n\t\t\tif (@$_GET[\"id\"] <> \"\") {\r\n\t\t\t\t$this->id->setQueryStringValue($_GET[\"id\"]);\r\n\t\t\t\t$this->setKey(\"id\", $this->id->CurrentValue); // Set up key\r\n\t\t\t} else {\r\n\t\t\t\t$this->setKey(\"id\", \"\"); // Clear key\r\n\t\t\t\t$this->CurrentAction = \"add\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$_SESSION[EW_SESSION_INLINE_MODE] = \"add\"; // Enable inline add\r\n\t}", "public function addAccount(array $data)\n {\n return parent::addAccount($data);\n }", "public function addAccount()\n {\n $this->_initAddAccountPageDynamicData();\n $user = User::find(Auth::user()->id);\n $userp = Profile::where('id', '=', Auth::user()->id)->first();\n $userb = Business::where('user_id', '=', Auth::user()->id)->first();\n\n return view('User.dashboard.accounts.add', compact('user', 'userp', 'userb'))->with('accountNumberRules', $this->_accountNumberRules)->with('fieldCountries', $this->_fieldCountries);\n }", "public function addAccountId() {\n $accountId = AftmConfiguration::getValue('paypal','accountid');\n if (empty($accountId)) {\n throw new Exception('Account id not found in AFTM configuration file.');\n }\n $this->addHiddenField(\"business\",$accountId);\n }", "function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }", "function InlineInsert() {\n\t\tglobal $Language, $objForm, $gsFormError;\n\t\t$this->LoadOldRecord(); // Load old recordset\n\t\t$objForm->Index = 0;\n\t\t$this->LoadFormValues(); // Get form values\n\n\t\t// Validate form\n\t\tif (!$this->ValidateForm()) {\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t\treturn;\n\t\t}\n\t\t$this->SendEmail = TRUE; // Send email on add success\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\n\t\t\tif ($this->getSuccessMessage() == \"\")\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\n\t\t} else { // Add failed\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t}\n\t}", "function femail_user_add($form_state, $account){\n $form['femail_email'] = array(\n '#type' => 'textfield',\n '#title' => t('Email')\n );\n $form['femail_uid'] = array(\n '#type' => 'hidden',\n '#value' => $account->uid\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add an additional Email')\n );\n return $form;\n}", "function InlineInsert() {\r\n\t\tglobal $Language, $objForm, $gsFormError;\r\n\t\t$this->LoadOldRecord(); // Load old recordset\r\n\t\t$objForm->Index = 0;\r\n\t\t$this->LoadFormValues(); // Get form values\r\n\r\n\t\t// Validate form\r\n\t\tif (!$this->ValidateForm()) {\r\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\r\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\r\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->SendEmail = TRUE; // Send email on add success\r\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\r\n\t\t\tif ($this->getSuccessMessage() == \"\")\r\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\r\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\r\n\t\t} else { // Add failed\r\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\r\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\r\n\t\t}\r\n\t}", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "public function add() {\n\t\t$user_id = $this->UserAuth->getUserId();\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data[\"Contact\"][\"user_id\"] = $user_id;\n\t\t\t$this->Contact->saveAssociated($this->request->data, array(\"deep\" => true));\n\t\t}\n\t\t\n\t\t$this->render('form');\n\t}", "public function add(){\n $this->edit();\n }", "public function mass_add()\n {\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "protected function add() {\n\t}", "public static function add() {\n\t\tif (\n\t\t\t( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) ||\n\t\t\t'true' !== get_user_option( 'rich_editing' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<a href=\"#\" id=\"sgdg-tinymce-button\" class=\"button\"><img class=\"sgdg-tinymce-button-icon\" src=\"' .\n\t\t\tesc_attr( plugins_url( '/skaut-google-drive-gallery/admin/icon.png' ) ) .\n\t\t\t'\">' .\n\t\t\tesc_html__( 'Google Drive gallery', 'skaut-google-drive-gallery' ) .\n\t\t\t'</a>';\n\t\tadd_thickbox();\n\t}", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function addUser(){\n\t}", "public function addUser(){}", "function add() {\n }", "public function add();", "public function add();", "public function add()\n {\n $originalInput = Request::input();\n $request = Request::create('/users/add', 'POST', array('email'=>Input::get('email'),'name'=>Input::get('name')));\n Request::replace($request->input());\n $userId = Route::dispatch($request)->getContent();\n Request::replace($originalInput);\n\n Task::create(array('user_id'=>$userId,'title'=>Input::get('title'),'description'=>Input::get('description'),'priority'=>Input::get('priority'),'flag'=>'n','duedate'=>Input::get('duedate')));\n\n echo true;\n }", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "public function adduseraccount() {\n\n $usr = new UserAccount();\n\n if(!$usr->access()) {\n\n return \"connection failure!\";\n\n }\n\n if($this->ruseript('name', 'username')) {\n\n return \"username already exists\";\n\n }\n\n else if($this->ruseript('mail', 'email')) {\n\n return \"email already exists\";\n\n }\n\n else {\n\n $usr->insertuserinfo($_POST);\n\n return;\n\n }\n\n }", "function add_create_account()\n {\n\t\t\n\t\tglobal $imported_ids;\n global $current_user;\n\n\t\t$acc_name = trim($this->column_fields['accountid']);\n\n\t\tif ((! isset($acc_name) || $acc_name == '') )\n\t\t{\n\t\t\treturn; \n\t\t}\n\n $arr = array();\n\n\t\t// check if it already exists\n $focus = new Accounts();\n\n\t\t$query = '';\n\n\t\t// if user is defining the ec_account id to be associated with this contact..\n\n\t\t//Modified to remove the spaces at first and last in ec_account name -- after 4.2 patch 2\n\t\t$acc_name = trim(addslashes($acc_name));\n\n\t\t//Modified the query to get the available account only ie., which is not deleted\n\t\t$query = \"select ec_account.* from ec_account WHERE accountname like '{$acc_name}%' \n\t\t\t\t\tand ec_account.deleted=0 ORDER BY accountname \";\n\t\t$result = $this->db->query($query);\n\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t// we found a row with that id\n\t\tif (isset($row['accountid']) && $row['accountid'] != -1)\n\t\t{\n\t\t\t$focus->id = $row['accountid'];\n\t\t}\n\n\t\t// if we didnt find the ec_account, so create it\n\t\tif (! isset($focus->id) || $focus->id == '')\n\t\t{\n\t\t\t$focus->column_fields['accountname'] = $acc_name;\n\t\t\t$focus->column_fields['assigned_user_id'] = $current_user->id;\n\t\t\t$focus->column_fields['modified_user_id'] = $current_user->id;\n\n\t\t\t$focus->save(\"Accounts\");\n\t\t\t$acc_id = $focus->id;\n\t\t\t// avoid duplicate mappings:\n\t\t\tif (!isset( $imported_ids[$acc_id]) )\n\t\t\t{\n\t\t\t\t$imported_ids[$acc_id] = 1;\n\t\t\t}\n\t\t}\n\t\t// now just link the ec_account\n $this->column_fields[\"account_id\"] = $focus->id;\n\n }", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "public function admin_add()\n {\n if ($this->request->is('post')) {\n $this->User->create();\n\n $this->request->data['Impi']['auth_scheme'] = 127;\n\n if ($this->User->saveAll($this->request->data)) {\n $this->Session->setFlash(__('The user has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n }\n }\n $utilityFunctions = $this->User->UtilityFunction->find('list');\n\n $this->set(compact('utilityFunctions', 'utilityFunctionsParameters'));\n }", "function createAccountButton(){\n\t\techo '<form name=\"accounts\" method=\"post\" action=\"CheckBook.php/:Add\">';\n\t\techo '<button type=\"submit\">Add an Account</button>';\n\t\techo '</form>';\n\t}", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "function add() \n {\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n \n // Render the action with template\n $this->renderWithTemplate('users/add', 'AdminPageBaseTemplate');\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $this->Notes->add($user);\n }", "public function addAccount()\n {\n return new AccountDefinition($this,$this->now);\n }", "public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "function AfterAdd(&$values, &$keys, $inline, &$pageObject)\n{\n\n\t\t/*\n$month=date('m');\n$year=date('Y');\n$yearPart=substr($year,2,2);\n\n$id=$keys['id'];\n$payID=sprintf(\"%05s\",$id);\n\n$tx='R'.$yearPart.$month.$payID;\nglobal $conn;\n\n$sql_up= \"UPDATE payments SET tx ='$tx' WHERE id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n*/\nglobal $conn;\n$cid=$values['cid'];\n$userID=$values['userID'];\n$sql_up= \"UPDATE participate SET confirm ='Yes' WHERE userID='$userID' AND cid='$cid'\";\n$query_up=db_exec($sql_up,$conn);\n\n;\t\t\n}", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function add()\n {\n require_code('form_templates');\n\n $to = get_param_string('to', '');\n\n $products = find_all_products();\n $list = new Tempcode();\n foreach ($products as $type_code => $details) {\n if ($details[0] == PRODUCT_INVOICE) {\n $text = do_lang_tempcode('CUSTOM_PRODUCT_' . $type_code);\n if ($details[1] != '?') {\n $text->attach(escape_html(' (' . $details[1] . ' ' . get_option('currency') . ')'));\n }\n $list->attach(form_input_list_entry($type_code, false, $text));\n }\n }\n if ($list->is_empty()) {\n inform_exit(do_lang_tempcode('NOTHING_TO_INVOICE_FOR'));\n }\n $fields = new Tempcode();\n $fields->attach(form_input_list(do_lang_tempcode('PRODUCT'), '', 'type_code', $list));\n $fields->attach(form_input_username(do_lang_tempcode('USERNAME'), do_lang_tempcode('DESCRIPTION_INVOICE_FOR'), 'to', $to, true));\n $fields->attach(form_input_float(do_lang_tempcode('AMOUNT'), do_lang_tempcode('INVOICE_AMOUNT_TEXT', escape_html(get_option('currency'))), 'amount', null, false));\n $fields->attach(form_input_line(do_lang_tempcode('INVOICE_SPECIAL'), do_lang_tempcode('DESCRIPTION_INVOICE_SPECIAL'), 'special', '', false));\n $fields->attach(form_input_text(do_lang_tempcode('NOTE'), do_lang_tempcode('DESCRIPTION_INVOICE_NOTE'), 'note', '', false));\n\n $post_url = build_url(array('page' => '_SELF', 'type' => '_add'), '_SELF');\n $submit_name = do_lang_tempcode('CREATE_INVOICE');\n\n return do_template('FORM_SCREEN', array('_GUID' => 'b8a08145bd1262c277e00a1151d6383e', 'HIDDEN' => '', 'TITLE' => $this->title, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_ICON' => 'buttons__proceed', 'SUBMIT_NAME' => $submit_name, 'TEXT' => do_lang_tempcode('DESCRIPTION_INVOICE_PAGE'), 'SUPPORT_AUTOSAVE' => true));\n }", "public function getAdd()\n {\n \treturn view(\"admin.user.add\");\n }", "public function add()\n {\n if (!current_user_can('manage_options')) {\n wp_die($this->translator->get('You do not have sufficient permissions to access this page.', true));\n }\n }", "function account_edit()\n {\n }", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}", "function add()\n\t{\n\t\t$data[\"title\"] = _e(\"Permission Modify\");\t\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\t## for check admin or not\t##\t\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\n\t\t\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\t\t\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"permission_modify\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"permission_modify_add\", $data, true, \"permission_modify\");\n\t\t$this->template->build_admin_output($data);\n\t}", "function add_money($account,$total_money,$input_money){\n\t\t$total_money += $input_money;\n\t\tglobal $connection;\n\t\t$query_mn = mysqli_query($connection,\"UPDATE khachhang SET `money`=$total_money WHERE account='$account'\" );\n\t\treturn $total_money;\n\t}", "protected function instantAdd() {\r\n\t\t$this->redirect(array('action' => 'edit', 'id' => $this->{$this->modelClass}->bsAdd()));\r\n }", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('activities', $_POST);\n\n # Send them back to home page\n Router::redirect('/activities/index');\n\n }", "public function add()\n\t{\n\t\tPhpfox::getComponent('language.admincp.phrase.add', array('sReturnUrl' => $this->get('return'), 'sVar' => $this->get('phrase'), 'bNoJsValidation' => true), 'controller');\n\t}", "public function add()\n {\n $data = [\n 'user_id' => $this->CurrentUser->getId(),\n 'entry_id' => $this->request->getData('entry_id'),\n ];\n\n $bookmark = $this->Bookmarks->createBookmark($data);\n if (!$bookmark) {\n throw new GenericApiException('The bookmark could not be created.');\n }\n\n $this->set('bookmark', $bookmark);\n }", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "public function admin_add() {\r\n if(isset($this->data[$this->modelClass])) {\r\n\t\t\t$this->_message($this->{$this->modelClass}->bsSave($this->data, 'add'));\r\n }\r\n\t\t$this->render('admin_edit');\r\n }", "public function add(){\n if ($_POST) {\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->save(\"transactions\", $_POST)) {\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }else{\n $this->redirect(array(\"controller\"=>\"transactions\", \"method\"=>\"add\"));\n }\n }\n \n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n $this->_view->setView(\"add\");\n /* }else{\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }*/\n }", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "public function admin_add() {\n\t\tparent::admin_add();\n\n\t\t$users = $this->ShopList->User->find('list');\n\t\t$shopShippingMethods = $this->ShopList->ShopShippingMethod->find('list');\n\t\t$shopPaymentMethods = $this->ShopList->ShopPaymentMethod->find('list');\n\t\t$this->set(compact('users', 'shopShippingMethods', 'shopPaymentMethods'));\n\t}", "public function addField();", "public function add() {\n\t\tRouter::redirect('/users/profile');\t\n\t}", "public function AddAccount($node_id, $social, $identifier , $displayName, $photoUrl, $meta = ''){\n return $this->db->AddAccount($node_id, $social, $identifier , $displayName, $photoUrl, $meta);\n }", "function subscribeUser()\n\t\t{\n\t\t\techo $this->email.\"add to the database !!\";\n\t\t}", "function add_account($name) {\n $this_account = new Account;\n $this->list[$name] = $this_account;\n return $this_account;\n }", "function add(){\n\t\t\tif(!is_super_admin_login())\n\t\t\t\treturn $this->vista->acceso_restringido();\n if(!empty($this->params['programa'])){\n TPrograma::add($this->params['programa']);\n }\n }", "function guildMemberAdd(GuildMember $member);", "public function registerAccount($key, Account $account);", "function mint_update_account($session, $token, $account_id, $account_name, $total) {\n $_post = array(\n \"accountId\" => $account_id,\n \"types\" => \"ot\",\n \"accountName\" => $account_name, \n \"accountValue\" => $total,\n \"associatedLoanRadio\" => \"No\", \n \"accountType\" => \"3\", \n \"accountStatus\" => \"1\",\n \"token\" => $token,\n );\n $session->URLFetch(\"https://wwws.mint.com/updateAccount.xevent\", $_post);\n}", "function add_money() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$user_id = $_REQUEST['recharge_user_id'];\n\t\t$user_amount = $_REQUEST['recharge_amount'];\n\t\t$transaction_id = $_REQUEST['transection_id'];\n\t\t$final_amount = $coupon_amount + $user_amount;\n\t\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type = 1;\n\t\t// credit\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_category = 1;\n\t\t// 1-Add moeny, 2-Recharge\n\t\t$w_category = 6;\n\t\t$w_desc = \"Amount Recieved when add money \" . $user_amount . \" with get amount \" . $coupon_amount;\n\t\t$wt_desc = \"Add Money\";\n\t\tif (!empty($user_id) && !empty($user_amount) && !empty($transaction_id)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet = $wallet_amount + $final_amount;\n\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif (!empty($add_money)) {\n\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif ($add_money) {\n\t\t\t\t\t\t$records_coupon = $this -> conn -> get_table_row_byidvalue('offer_coupon', 'coupon_id', $coupon_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$coupon_count = $records_coupon['0']['coupon_limit'];\n\t\t\t\t\t\tif($coupon_count>0){\n\t\t\t\t\t\t\t$data_coupon['coupon_limit'] = $coupon_count - 1;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('offer_coupon', 'coupon_id', $coupon_id, $data_coupon);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$transaction_ids = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' . $transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Add amount successfully\", \"transaction_id\" => $transaction_id, 'add_amount' => $user_amount, 'wallet_amount' => $user_wallet, 'transaction_date' => $current_date);\n\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $user_id, 'recharge_amount' => $user_amount, 'transection_id' => $transection_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function addUser(UserAddForm $form);", "public function add_user($id) {\n UserToPres::create_entry($id,$this->id);\n }", "function add_multi() {\n \t\t//-- step 1 pilih kode pelanggan\n \t\t$this->load->model('customer_model');\n\t\t$this->load->model('bank_accounts_model');\n \t\t$data['no_bukti']=$this->nomor_bukti();\n\t\t$data['date_paid']=date('Y-m-d');\n\t\t$data['how_paid']='Cash';\n\t\t$data['amount_paid']=0;\n\t\t$data['mode']='add';\n\t\t$data['customer_number']='';\n\t\t$data['how_paid_acct_id']='';\n\t\t$data['how_paid']='';\n\t\t$data['customer_list']=$this->customer_model->customer_list();\n\t\t$data['account_list']=$this->bank_accounts_model->account_number_list();\n\t\t$data['credit_card_number']='';\n\t\t$data['expiration_date']=date('Y-m-d');\n\t\t$data['from_bank']='';\n\t\t$this->template->display_form_input('sales/payment_multi',$data,'');\t\t\t\n\t\t\n }", "public function add()\n {\n return view('admin.user.add');\n }", "public function insert($medAccount);", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function create()\n {\n return view('fix_account.add');\n }", "public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public function _friendadd() {\n\t\t$this->history = false;\n\n\t\t// for authenticated only\n\t\tif ($this->user && csrf::valid()) {\n\n\t\t\t// require valid user\n\t\t\t$this->member = new User_Model($username);\n\t\t\tif ($this->member->id) {\n\t\t\t\t$this->user->add_friend($this->member);\n\n\t\t\t\t// News feed event\n\t\t\t\tnewsfeeditem_user::friend($this->user, $this->member);\n\n\t\t\t}\n\t\t}\n\n\t\turl::back('members');\n\t}", "public function add_user(){\n\n $data['header'] = 'รายชื่อในระบบ';\n return view('admin.bitcoin.add_user', $data);\n }", "protected function addAdminAccount()\n {\n //disconnect existing DB connection to reconnect with new updated config variables.\n\n $this->line(\"Deleting any existing admin accounts.\");\n //empty users table.\n User::truncate();\n\n $this->line(\"Creating admin account.\");\n $username = 'admin';\n $password = 'AccessManager3';\n\n $user = new User([\n 'username' => $username,\n 'password' => $password,\n 'name' => 'Administrator',\n 'email' => 'access@manager',\n ]);\n $user->saveOrFail();\n\n $this->line(\"Account successfully created.\");\n $this->info(\"Username: $username\");\n $this->info(\"Password: $password\");\n $this->line(\"Run 'php artisan admin:reset' to reset admin password.\");\n }", "public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => '[email protected]',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }", "public function user_add()\n\t{\n\t\t$data = array( 'isi' \t=> 'admin/user/v_user_add',\n\t\t\t\t\t\t'nav'\t=>\t'admin/nav',\n\t\t\t\t\t\t'title' => 'Tampil Dashboard Admin');\n\t\t$this->load->view('layout/wrapper',$data);\n\t}", "function my_account_endpoint_content() {\n echo do_shortcode('[wcj_product_add_new]');\n }", "public function addUser(UserInterface $user);", "public function addUser(UserInterface $user);", "function addUser($link,$user)\n\t\t{\n\t\t\t$account_id = mysqli_escape_string($link,$user['account_id']);\n\t\t\t$fname = mysqli_escape_string($link,$user['first_name']);\n\t\t\t$lname = mysqli_escape_string($link,$user['last_name']);\n\t\t\t$birthday = mysqli_escape_string($link,$user['birthday']);\n\t\t\t$sex = mysqli_escape_string($link,$user['sex']);\n\t\t\t$photo = mysqli_escape_string($link,$user['photo']);\n\t\t\t$phone = mysqli_escape_string($link,$user['phone']);\n\t\t\t$sql = 'INSERT INTO profile (account_id,first_name,last_name,birthday,sex,photo,phone_number,num_follower,num_review,num_invited) VALUES ('.$account_id.',\"'.$fname.'\",\"'.$lname.'\",'.$birthday.','.$sex.',\"'.$photo.'\",\"'.$phone.'\",0,0,0)';\n\t\t\tif (mysqli_query($link, $sql)) {\n\t\t\t\t//success\n\t\t\t\treturn \"success\";\n\t\t\t}else{\n\t\t\t\t//error\n\t\t\t\treturn '{\"status\":\"error\",\"message\":\"user not inserted\"}';\n\t\t\t}\n\t\t}", "function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}", "public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}", "public function add($data)\n {\n }", "public function add()\n {\n //renderView('add');\n }", "function add($message = '') {\n\t$add_certificates = open_table_form('Add New Admin User','add_admin_user',SITE_ADMIN_SSL_URL.'?sect=admin_users&mode=new_user_check&uid='.$_GET['uid'],'post',$message);\n\t$add_certificates .= $this->form();\n\t$add_certificates .= close_table_form();\n return $add_certificates;\n }", "public function add_entry($entry);", "private function addInvoice($money, $options)\n {\n $this->post['amount'] = $this->amount($money / 100);\n $this->post['currency'] = self::$default_currency;\n $this->post['description'] = $options['description'];\n }", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "protected function confirm_add()\n\t{\n\t\t$msg =\n\t\t\t$this->fields['FirstName'] . \" \" . $this->fields['LastName'] .\n\t\t\t\" added as administrator.\"\n\t\t;\n\n\t\treturn '<font color=\"green\">' . $msg . '</font><br>';\n\n\t}" ]
[ "0.74921334", "0.6509599", "0.64581937", "0.6393711", "0.6354729", "0.6258549", "0.61621463", "0.6133756", "0.60612303", "0.60568166", "0.6028023", "0.6018229", "0.5881672", "0.5881672", "0.5881672", "0.5864861", "0.58585894", "0.5830937", "0.57958305", "0.57497656", "0.57497656", "0.5749579", "0.57195795", "0.570971", "0.56901896", "0.5689988", "0.56813633", "0.56531763", "0.56531763", "0.5648953", "0.5645586", "0.56156236", "0.55964833", "0.5587323", "0.55712825", "0.55503464", "0.5549221", "0.55442053", "0.55408514", "0.55393106", "0.55335736", "0.5528642", "0.5527477", "0.5504149", "0.5498535", "0.5484597", "0.5483198", "0.5473255", "0.54517406", "0.5431366", "0.5427242", "0.5424526", "0.54221904", "0.5421761", "0.54113483", "0.5407336", "0.5407203", "0.53937876", "0.53884876", "0.5383636", "0.5382688", "0.5378951", "0.53701377", "0.53688633", "0.53658926", "0.53620774", "0.536197", "0.5358685", "0.5348007", "0.5347227", "0.53461146", "0.53420514", "0.53402174", "0.5332513", "0.5329607", "0.53264433", "0.53245157", "0.53131056", "0.5309557", "0.53089637", "0.5307801", "0.5305674", "0.53037596", "0.53026825", "0.52997315", "0.52965707", "0.5284412", "0.5281591", "0.5280699", "0.52780384", "0.52780384", "0.5276018", "0.52738583", "0.52730536", "0.52618694", "0.52530426", "0.52530193", "0.52525914", "0.52485394", "0.52431905", "0.5240563" ]
0.0
-1
Add remote transaction as expense
public function add_to_expense(Request $request) { Log::info("TransactionController->add_to_expense :- Inside "); //dd($request->all()); $organization_id = Session::get('organization_id'); $organization = Organization::findOrFail($organization_id); $entry = []; $other_transaction = Transaction::where('id', $request->id)->first(); //dd($other_transaction); //return false; $transaction_type_name = AccountVoucher::where('id', $other_transaction->transaction_type_id)->first()->name; $type = null; $type_name = "Transaction"; if($transaction_type_name == "purchase_order") { $type = "sale_order"; $type_name = "Sale Order"; } else if($transaction_type_name == "purchases") { $type = "sales"; $type_name = "Invoice"; } else if($transaction_type_name == "goods_receipt_note") { $type = "delivery_note"; $type_name = "Delivery Note"; } else if($transaction_type_name == "sale_order") { $type = "purchase_order"; $type_name = "Purchase Order"; } else if($transaction_type_name == "sales" || $transaction_type_name == "job_invoice" || $transaction_type_name == "job_invoice_cash") { $type = "purchases"; $type_name = "Purchases"; } else if($transaction_type_name == "delivery_note") { $type = "goods_receipt_note"; $type_name = "Goods Receipt Note"; } if($type != null) { $transaction_type = AccountVoucher::where('name', 'journal')->where('organization_id', $organization_id)->first(); $other_organization = Organization::findOrFail($other_transaction->organization_id); $people_exist = People::where('business_id', $other_organization->business_id) ->where('organization_id', $organization_id) ->first(); if($people_exist == null) { $business = Business::find($other_organization->business_id); $business_address_type = BusinessAddressType::find($business->address_type)->id; $business_communication_address = BusinessCommunicationAddress::select('mobile_no', 'address', 'city_id', 'pin'); $people = new People(); $people->user_type = 1; $people->business_id = $person->id; $people->company = $business->alias; $people->display_name = $business->alias; $people->mobile_no = $business_communication_address->mobile_no; $people->organization_id = $organization_id; $people->save(); Custom::add_addon('records'); Custom::add_addon('customer'); if($people->id) { $people_address = new PeopleAddress(); $people_address->people_id = $people->id; $people_address->address_type = 0; $people_address->address = $business_communication_address->address; $people_address->city_id = $business_communication_address->city_id; $people_address->pin = $business_communication_address->pin; $people_address->save(); } } else { $people = $people_exist; } $account_ledgers = AccountLedger::select('account_ledgers.id'); $account_ledgers->where('business_id', $people->business_id); $business_id = $people->business_id; $person_id = null; $account_ledger = $account_ledgers->first(); $impersonal_ledger = AccountLedgerType::where('name', 'impersonal')->first(); if($account_ledger != null){ $customer_ledger = $account_ledger->id; } else { if($transaction_type->name == "purchases") { $ledgergroup = AccountGroup::where('name', 'sundry_creditor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'credit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } else if($transaction_type->name == "sales" || $transaction_type->name == "job_invoice" || $transaction_type_name == "job_invoice") { $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } } $purchase_account = AccountLedger::where('name', 'purchases')->where('organization_id', $organization_id)->first()->id; //Item is expense, All expenses are debit //Vendor gives the item, Credit the giver $entry[] = ['debit_ledger_id' => $purchase_account, 'credit_ledger_id' => $customer_ledger, 'amount' => $other_transaction->total]; usort($entry, function ($item1, $item2) { return $item1['debit_ledger_id'] - $item2['debit_ledger_id']; }); Custom::add_entry(date('Y-m-d'), $entry, null, $transaction_type->name, $organization_id, 0, false,null, null, null,$other_transaction->id); //$transaction->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, null, $transaction_type->name, $organization_id, 1, false, null, null, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); } $other_transaction->notification_status = 2; $other_transaction->save(); Log::info("TransactionController->add_to_expense :- return "); return response()->json(['status' => 1, 'message' => $transaction_type->display_name.config('constants.flash.added'), 'data' => ['url' => route('transaction.index', [$type])]]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sellTrasactionPendingAddsMoney(){\n\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function expenseLedgerEntry()\n {\n $items = $this->getVoucherItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $expenseLedgerRecord = $financeLedger->fetchByName('Indirect expense');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId; \n \n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $expenseLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function addExpense($amount)\n {\n $account = Account::findOne([\n 'username' => $this->getCurrentUser()->username,\n ]);\n\n $account->balance -= $amount;\n\n $account->update(true, ['balance']);\n }", "public function testStoreExpense()\n {\n $attributes = array(\n 'amount' => 432424,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'notes' => 'Lorem ipsum set amet.',\n 'attachment_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('POST', 'v1/expenses', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been created.', $data->message);\n }", "function addExpense($week, $money){\n global $db;\n \n $get = getRecentPurchaseId();\n $idPurchase=$get['idPurchase'];\n $stmt =$db->prepare(\"INSERT INTO invoices (week, expense, idPurchase) VALUES (:week, :expense, :idPurchase)\");\n \n $binds= array(\n \":week\"=> $week,\n \":expense\"=> $money,\n \":idPurchase\"=>$idPurchase\n );\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n return true;\n }\n else{\n return false;\n }\n }", "public function addExpense($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "public function add() {\n\t\t$entry = $this->getEntryToAdd('clov_expense');\n\t\t\n\t\t// Default to the logged-in user.\n\t\t$loggedInUser = new User;\n\t\t$entry->setAttribute('clov_expense_payer', $loggedInUser->getUserID());\n\t\t\n\t\t// If the user got here from a project page, pre-fill the project \n\t\t// attribute.\n\t\tLoader::helper('clov_url', 'clov');\n\t\tif($project = ClovUrlHelper::loadReferrerPage('clov_project')) {\n\t\t\t$entry->setAttribute('clov_expense_project', $project->getCollectionID());\n\t\t}\n\t\t\n\t\t$this->set('entry', $entry);\n\t\t$this->set('showSaveDraft', true);\n\t\t$this->render('clov/default/add');\n\t}", "public function additionExpenses()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `expenses`(`idem`, `billex`, `dateex`, `priceex`, `discountex`, `totalex`, `notsex`, `deletex`)\n VALUES ('$this->idem' ,'$this->billex' ,'$this->dateex' ,'$this->priceex' ,'$this->discountex' ,'$this->totalex' ,'$this->notsex' ,'$this->deletex')\");\n $result = $sql->execute();\n $idex = $dbh->lastInsertId();\n return array ($result,$idex);\n }", "public function addExpenseAction()\n\t{\n\t\t$expense = new Expense($_POST);\n\t\t\n\t\tif ($expense->addExpense()) {\n\t\t\tFlash::addMessage('Add expense successful!');\n\t\t\t\n\t\t\t$this->redirect('/profile/expenseForm');\n\t\t} else {\n\t\t\tFlash::addMessage('Add expense unsuccessful, please try again!', Flash::WARNING);\n\t\t\t\n\t\t\tView::renderTemplate('Expense/addExpense.html', [\n\t\t\t'date' => $expense->date,\n\t\t\t'payments' => Payment::getPaymentsCategories(),\n\t\t\t'expenses' => Expense::getExpensesCategories(),\n\t\t\t'expense' => $expense\n\t\t]);\n\t\t}\n\t}", "function charge_deposit($acc_number,$sum)\n\t{\n\t $this->db->query(\"UPDATE pamm_summaries SET deposit = deposit+$sum WHERE acc_number=$acc_number\");\n\t}", "public function generateExpenses()\n {\n \t//Iva\n \t$iva_expense = new Expense();\n \t$iva_expense->type = 'iva';\n \t$iva_expense->value = ($this->value * $this->iva_percetage)/100;\n \t$iva_expense->exchange_rate_cop = $this->exchange_rate_cop;\n \t$iva_expense->income_id = $this->id;\n \t$iva_expense->currency_id = $this->currency_id;\n \t$iva_expense->save();\n\n \t//Trsoft utility, se calcula con el valor después de descontar el iva\n\t\t$trsoft_utility_expense = new Expense();\n\t\t$trsoft_utility_expense->type = 'trsoft utility';\n\t\t//En la compra de una licencia la utilidad de trsoft aumenta\n\t\tif($this->type == 'license'){\n\t\t\t$trsoft_utility_expense->value = (\n\t\t\t\t//Valor despues de restarle el iva\n\t\t\t\t($this->value - $iva_expense->value) \n\t\t\t\t//Se calcula el % de utilidad de TrSoft, se separa la utilidad de socios\n\t\t\t\t* (100 - $this->partners_utility)\n\t\t\t)/100;\n\t\t}else if($this->type == 'commission'){\n\t\t\t//Cuando se paga una comisión la utiliad de TrSoft es la establecida\n\t\t\t$trsoft_utility_expense->value = (($this->value - $iva_expense->value) * $this->trsoft_utility)/100;\n\t\t}\n\n\t\t$trsoft_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$trsoft_utility_expense->state = 'paid out';\n\t\t$trsoft_utility_expense->income_id = $this->id;\n\t\t$trsoft_utility_expense->currency_id = $this->currency_id;\n\t\t$trsoft_utility_expense->save(); \n\n \t//Partners utility, se calcula con el valor después de descontar el iva\n\t\t$partners_utility_expense = new Expense();\n\t\t$partners_utility_expense->type = 'partners utility';\n\t\t$partners_utility_expense->value = (($this->value - $iva_expense->value) * $this->partners_utility)/100;\n\t\t$partners_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$partners_utility_expense->income_id = $this->id;\n\t\t$partners_utility_expense->currency_id = $this->currency_id;\n\t\t$partners_utility_expense->save(); \t\n\n\t\t//Si es el pago de una comisión se deben generar los egresos\n\t\t//para pago de comisión de traders y desarrollador\n\t\tif($this->type == 'commission'){\n\n\t\t}\n }", "public function testUpdateExpense()\n {\n $attributes = array(\n 'amount' => 24344,\n 'merchant_id' => 1,\n 'category_id' => 1,\n 'created_at' => date('Y-m-d H:i:s')\n );\n\n $response = $this->call('PUT', 'v1/expenses/1', $attributes);\n $data = json_decode($response->getContent());\n\n $this->assertFalse($data->error);\n $this->assertEquals('Expense has been updated.', $data->message);\n }", "function addTransaction($account, $expensetype, $amount, $type, $date){\n\t\t// check if input data is valid\n\t\tif($expensetype == null || strlen($expensetype) == 0){\n\t\t\tthrow new Exception (\"Please enter a valid transaction type.\");\n\t\t}\n\t\telse if ($amount == null || strlen($amount) == 0 || !(is_numeric($amount))){\n\t\t\tthrow new Exception (\"Please enter a valid amount.\");\n\t\t} \n\t\telse if ($date == null){\n\t\t\tthrow new Exception (\"Please enter a date.\");\n\t\t} else {\n\t\t\t$urlms = $this->urlms;\n\t\t\t$urlmsLab = $urlms->getLab_index(0);\n\t\t\t// find the account that receives a transaction\n\t\t\t$fundingAccount = $this->findFundingAccount($account);\n\t\t\t// create a new expense and add it to the account that was previously found using the input\n\t\t\t$newExpense = new Expense($amount, $date, $expensetype, $fundingAccount);\n\t\t\t$fundingAccount->addExpense($newExpense);\n\t\t\t\n\t\t\t// check if transaction is an expense or a fund\n\t\t\t// and add or substract from balance accordingly\n\t\t\tif($type == \"expense\"){\n\t\t\t\t$fundingAccount->setBalance($fundingAccount->getBalance() - $newExpense->getAmount());\n\t\t\t\t$newExpense->setAmount(-$amount);\n\t\t\t} \n\t\t\telse if ($type == \"fund\"){\n\t\t\t\t$fundingAccount->setBalance($fundingAccount->getBalance() + $newExpense->getAmount());\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception (\"Please choose a valid type of transaction.\");\n\t\t\t}\n\t\t\t// Write data\n\t\t\t//$persistence = new Persistence();\n\t\t\t$this->persistence->writeDataToStore($urlms);\n\t\t\t\n\t\t\t?>\n\t\t\n\t\t\t<!-- Refresh back to funding view -->\n\t\t\t<HTML>\n\t\t\t\t<meta http-equiv=\"refresh\" content=\"0; URL='../view/FundingView.php'\" />\n\t\t\t\t<p>New transation item successfully added!</p>\n\t\t\t\t<a href=\"../view/FundingView.php\">Back</a>\n\t\t\t</HTML><?php\n\t\t}\n\t}", "public function actionExp()\n {\n try {\n // 根据手机号归属地 修改 客户的位置\n CRMStockClient::phone_to_location();\n } catch (\\Exception $e) {\n\n }\n\n try {\n // 更新统计数据 /stock/trend\n TrendStockService::init(TrendStockService::CAT_TREND)->chartTrend(date('Y-m-d'), 1);\n } catch (\\Exception $e) {\n\n }\n\n }", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "public function testTransactionInsert()\n {\n $initialCount = ExchangeRate::count();\n $response = $this->postJson('/api/rates', [\n 'userId' => 134256,\n 'currencyFrom' => 'EUR',\n 'currencyTo' => 'GBP',\n 'amountSell' => 3000,\n 'amountBuy' => 2700,\n 'rate' => 0.7500,\n 'timePlaced' => '27-JAN-18 10:27:44',\n 'originatingCountry' => 'FR',\n ], ['Content-Type' => 'application/json', 'Accept' => 'application/json']);\n $newCount = ExchangeRate::count();\n $response->assertStatus(200);\n $this->assertEquals($initialCount + 1, $newCount);\n }", "function add_money() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$user_id = $_REQUEST['recharge_user_id'];\n\t\t$user_amount = $_REQUEST['recharge_amount'];\n\t\t$transaction_id = $_REQUEST['transection_id'];\n\t\t$final_amount = $coupon_amount + $user_amount;\n\t\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type = 1;\n\t\t// credit\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_category = 1;\n\t\t// 1-Add moeny, 2-Recharge\n\t\t$w_category = 6;\n\t\t$w_desc = \"Amount Recieved when add money \" . $user_amount . \" with get amount \" . $coupon_amount;\n\t\t$wt_desc = \"Add Money\";\n\t\tif (!empty($user_id) && !empty($user_amount) && !empty($transaction_id)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet = $wallet_amount + $final_amount;\n\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif (!empty($add_money)) {\n\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif ($add_money) {\n\t\t\t\t\t\t$records_coupon = $this -> conn -> get_table_row_byidvalue('offer_coupon', 'coupon_id', $coupon_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$coupon_count = $records_coupon['0']['coupon_limit'];\n\t\t\t\t\t\tif($coupon_count>0){\n\t\t\t\t\t\t\t$data_coupon['coupon_limit'] = $coupon_count - 1;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('offer_coupon', 'coupon_id', $coupon_id, $data_coupon);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$transaction_ids = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' . $transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Add amount successfully\", \"transaction_id\" => $transaction_id, 'add_amount' => $user_amount, 'wallet_amount' => $user_wallet, 'transaction_date' => $current_date);\n\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $user_id, 'recharge_amount' => $user_amount, 'transection_id' => $transection_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function deposit($amount) {\n $this->balance += $amount;\n }", "public function assestLedgerEntry()\n {\n $items = $this->getVoucherItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $assestLedgerRecord = $financeLedger->fetchByName('Current Asset');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId; \n \n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $assestLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function implement_local_activation($sum,$symbol,$id_trader,$acc_number)\n\t{\n $this->db->trans_start();\n\t\t $this->db->query(\"UPDATE investroom_personal_accounts SET $symbol = $symbol-$sum WHERE id=$id_trader\");\n $this->db->trans_complete();\n\n\t $data['active'] = '1';\n\t return $this->db->where('login',$acc_number)\n\t ->update('pamm_accounts', $data);\n\n\t}", "public function saveExpensePayment(Request $request)\r\n {\r\n try {\r\n $business_id = $request->session()->get('business.id');\r\n $settlement = Settlement::where('settlement_no', $request->settlement_no)->where('business_id', $business_id)->first();\r\n $data = array(\r\n 'business_id' => $business_id,\r\n 'settlement_no' => $settlement->id,\r\n 'expense_number' => $request->expense_number,\r\n 'category_id' => $request->category_id,\r\n 'reference_no' => $request->reference_no,\r\n 'account_id' => $request->account_id,\r\n 'reason' => $request->reason,\r\n 'amount' => $request->amount,\r\n );\r\n\r\n //Update reference count\r\n $ref_count = $this->transactionUtil->setAndGetReferenceCount('expense');\r\n //Generate reference number\r\n if (empty($request->reference_no)) {\r\n $data['reference_no'] = $this->transactionUtil->generateReferenceNumber('expense', $ref_count);\r\n }\r\n\r\n $settlement_expense_payment = SettlementExpensePayment::create($data);\r\n\r\n $expense_number = $this->getExpenseNumber($request->settlement_no);\r\n\r\n $output = [\r\n 'success' => true,\r\n 'expense_number' => $expense_number,\r\n 'reference_no' => $settlement_expense_payment->reference_no,\r\n 'settlement_expense_payment_id' => $settlement_expense_payment->id,\r\n 'msg' => __('petro::lang.success')\r\n ];\r\n } catch (\\Exception $e) {\r\n Log::emergency('File: ' . $e->getFile() . 'Line: ' . $e->getLine() . 'Message: ' . $e->getMessage());\r\n $output = [\r\n 'success' => false,\r\n 'msg' => __('messages.something_went_wrong')\r\n ];\r\n }\r\n\r\n return $output;\r\n }", "function add_money(){\n\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t$user_id=$_REQUEST['recharge_user_id'];\n\t\t$user_amount=$_REQUEST['recharge_amount'];\n\t\t$final_amount=$coupon_amount+$user_amount;\n\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type=1; // credit\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t$wt_category=1; // 1-Add moeny, 2-Recharge\n\t\t$w_category=6; // Amount Recieved when coupon code apply\n\t\t//$card_no=$_REQUEST['card_number'];\n\t\t//$cvv_no=$_REQUEST['cvv_no'];\n\t\t$w_desc=\"Amount Recieved when add money \".$user_amount .\" with get amount \".$coupon_amount;\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t//$transaction_id =$_POST['recharge_transaction_id']; // if wt_category=1 then payment gateway transaction id and 2 for recharge id;\n\t\t$wt_desc=\"Add Money\"; // description of transaction like as add moeny, recharge;\n\t\tif(!empty($user_id) && !empty($user_amount) && !empty($transaction_id)){\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet=$wallet_amount + $final_amount;\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif(!empty($add_money)){\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif($add_money){\n\t\t\t\t\t\t$transaction_ids= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' .$transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t $data['wallet_amount']=$user_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user','user_id',$user_id, $data);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Add amount successfully\", \"transaction_id\" =>$transaction_id,'add_amount'=>$user_amount,'wallet_amount'=>$user_wallet,'transaction_date'=>$current_date,'card_no'=>$card_no);\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$user_id,'recharge_amount'=>$user_amount,'card_number'=>$card_no,'cvv_no'=>$cvv_no);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function createDispense( $block_index=null, $asset=null, $hash=null ){\n global $mysqli;\n // get message_index from messages table for this dispense\n $dispense_hash = $mysqli->real_escape_string($hash);\n $results = $mysqli->query(\"SELECT message_index FROM messages WHERE command='insert' AND category='credits' AND block_index='{$block_index}' AND bindings LIKE '%{$dispense_hash}%' AND bindings LIKE '%\\\"asset\\\": \\\"{$asset}\\\"%' LIMIT 1\");\n if($results){\n $row = $results->fetch_assoc();\n $index = $row['message_index'];\n // Get the next message after dispense, which will be the dispenser update message, and extract the dispenser transaction hash\n $results = $mysqli->query(\"SELECT bindings FROM messages WHERE message_index>'{$index}' AND category='dispensers' ORDER BY message_index ASC LIMIT 1\");\n if($results){\n $row = $results->fetch_assoc();\n $obj = json_decode($row['bindings']);\n $dispense_tx_id = createTransaction($dispense_hash);\n $dispenser_tx_id = createTransaction($obj->tx_hash);\n // Check to see if a record already exists\n $results = $mysqli->query(\"SELECT id FROM dispenses WHERE block_index='{$block_index}' AND dispenser_tx_id='{$dispenser_tx_id}' AND dispense_tx_id='{$dispense_tx_id}'\");\n if($results){\n if($results->num_rows==0){\n $results = $mysqli->query(\"INSERT INTO dispenses (block_index, dispenser_tx_id, dispense_tx_id) values ('{$block_index}','{$dispenser_tx_id}','{$dispense_tx_id}')\");\n if(!$results)\n byeLog('Error while trying to create record in dispenses table');\n }\n } else {\n byeLog('Error while trying to lookup record in dispenses table');\n }\n } else {\n byeLog('Error while trying to locate dispenser update record in messages table');\n }\n } else {\n byeLog('Error while trying to locate dispense record in messages table');\n }\n}", "public function addExp($user_id, $amount) {\n syslog(LOG_DEBUG, \"addExp($user_id, $amount)\");\n $user_level_config = $this->getGameConfig('user_level');\n if (!$user_level_config) {\n syslog(LOG_ERR, \"updateExp($user_id, $amount) error:user_level_config not configured\");\n return false;\n }\n $user = $this->getUser($user_id);\n $current_level = $user['level'];\n $exp = $user['exp'] + $amount;\n $level_boundary = $user_level_config['level_exp_boundary'];\n $level_config = $user_level_config['level_config'];\n\n $new_level = $current_level;\n $max_level = count($level_boundary);\n $max_exp = $level_boundary[$max_level-1];\n # level1 [0,100) level2 [100,200) ..., level9 [800,900), level10[900,900], \n # level_boundary [0=>0, 1=>100, 2=>200,..., 9=>900]\n if ($exp >= $max_exp) {\n $exp = $max_exp;\n $new_level = $max_level;\n } else {\n // stop condition: $new_level==$max_level or $exp<$level_boundary[$new_level]\n while ($new_level < $max_level && $exp >= $level_boundary[$new_level]) {\n $new_level++;\n }\n }\n syslog(LOG_DEBUG, \"new level $new_level for $user_id\");\n\n $res = array('level'=> $new_level, 'exp'=> $exp);\n\n $resque_lib = $this->_di->getShared('resque_lib');\n if ($new_level != $current_level) {\n // level up\n if (intval($new_level) < intval($current_level)) {\n syslog(LOG_ERR, \"unexpected condition, level $new_level less than old $current_level for $user_id\");\n return false;\n }\n # new mission energy limit\n $current_mission_energy_limit = $level_config[$current_level]['mission_energy_limit'];\n $new_mission_energy_limit = $level_config[$new_level]['mission_energy_limit'];\n // do not set energy to db\n $this->incrProfBy($user_id, self::$USER_PROF_FIELD_EXP, $exp - $user['exp']);\n $this->setProf($user_id, self::$USER_PROF_FIELD_LEVEL, $new_level);\n # done: update db\n $resque_lib->setJob('user', 'profchange', array('uid'=> $user_id, \n 'level'=>$new_level-$current_level, 'exp'=>$exp - $user['exp']));\n // done: add mission energy to redis if exists\n $energy_bonus = ($new_level-$current_level) * 40;\n $res['mission_energy'] = $this->addMissionEnergy($user_id, $energy_bonus);\n /*\n $e_inc = $new_mission_energy_limit - $current_mission_energy_limit;\n if ($e_inc > 0) {\n //$energy = $this->incrProfBy($user_id, self::$USER_PROF_FIELD_ENERGY, $e_inc);\n $energy = $this->addMissionEnergy($user_id, $e_inc);\n syslog(LOG_DEBUG, \"increase mission energy $e_inc to $user_id\");\n $res['mission_energy'] = $energy;\n #$res['mission_energy_limit'] = $new_mission_energy_limit;\n }\n */\n // done: enque job to udpate fragment index\n $resque_lib->setJob('fragindex', 'FragmentIndex', array('cmd'=>'levelup', 'role_id'=> $user_id, 'old_level'=> $current_level, 'new_level'=> $new_level));\n //$resque_lib->setJob('user', 'levelup', array('uid'=> $user_id, 'old_level'=> $current_level, 'new_level'=> $new_level));\n if (isset($user[self::$USER_PROF_FIELD_LAST_LOGIN])) {\n $loginindex_lib = $this->_di->getShared('loginindex_lib');\n $loginindex_lib->levelUpEvent($user_id, $current_level, $new_level, $user[self::$USER_PROF_FIELD_LAST_LOGIN]);\n }\n } else if ($exp != $user['exp']) {\n // done: update new exp to db\n syslog(LOG_DEBUG, \"$user_id add exp $amount level $current_level\");\n $this->incrProfBy($user_id, self::$USER_PROF_FIELD_EXP, $exp - $user['exp']);\n # done: update db\n $resque_lib->setJob('user', 'profchange', array('uid'=> $user_id, 'exp'=> $exp-$user['exp']));\n }\n return $res;\n }", "public function add(Money $money): self;", "public function buyGoldTicket(): M_member\n\t{\n\n\t\t$this->db->set($this->pointField(), $this->point - $this->config->item('gold_ticket_price'));\n\t\t$this->db->set($this->goldTicketField(), $this->goldTicket + 1);\n\t\t$this->db->where($this->idField(), $this->id);\n\t\t$this->db->update($this->tableName());\n\n\t\treturn $this->getData();\n\t}", "public function addGoldTicket(int $count): M_member\n\t{\n\t\t$this->db->set($this->goldTicketField(), $this->goldTicket + $count);\n\t\t$this->db->where($this->idField(), $this->id);\n\t\t$this->db->update($this->tableName());\n\n\t\treturn $this->getData();\n\t}", "function add_money($account,$total_money,$input_money){\n\t\t$total_money += $input_money;\n\t\tglobal $connection;\n\t\t$query_mn = mysqli_query($connection,\"UPDATE khachhang SET `money`=$total_money WHERE account='$account'\" );\n\t\treturn $total_money;\n\t}", "function buyPostage()\n {\n\n $this->PartnerTransactionID = substr(uniqid(rand(), true), 0, 10);\n\n $xml = '<RecreditRequest>\n <RequesterID>'. $this->RequesterID.'</RequesterID>\n <RequestID>' . $this->PartnerTransactionID . '</RequestID>\n <CertifiedIntermediary>\n <AccountID>'.$this->AccountID.'</AccountID>\n <PassPhrase>'. $this->PassPhrase.'</PassPhrase>\n </CertifiedIntermediary>\n <RecreditAmount>500</RecreditAmount>\n </RecreditRequest>';\n\n\n $data = array(\"RecreditRequestXML\" => $xml);\n $request = $this->client->post('/LabelService/EwsLabelService.asmx/BuyPostageXML', array(), $data);\n $this->send_request($request);\n\n\n }", "public function add(){\n if ($_POST) {\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->save(\"transactions\", $_POST)) {\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }else{\n $this->redirect(array(\"controller\"=>\"transactions\", \"method\"=>\"add\"));\n }\n }\n \n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n $this->_view->setView(\"add\");\n /* }else{\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }*/\n }", "public function transaction();", "public function transaction();", "function CreateDeposit() {\r\n $conn = conn();\r\n\r\n $sql = \"INSERT INTO `deposit`(`CompanyId`, `DepositAmount`, `PreviousBalance`, `CurrentBalance`, `Comments`, `RecEntered`, `RecEnteredBy`) VALUES \"\r\n . \"('$this->CompanyId','$this->DepositAmount','$this->PreviousBalance','$this->CurrentBalance','$this->Comments',NOW(), '$this->ReEnteredBy')\";\r\n if ($conn->exec($sql)) {\r\n $this->auditok = 1;\r\n } else {\r\n $this->auditok = 0;\r\n }\r\n $conn = NULL;\r\n }", "function add_interest($amount, $date_start, $date_end, $period, $extra) {\n $extra = $this->earning->interest_extra;\n $this->earning->add_interest($amount, $date_start, $date_end, $period, $extra);\n }", "private function publishOffer() {\n if ($this->Session->check('addOffer')) {\n\n // salvando oferta\n $params ['Offer'] = $this->Session->read('addOffer.Offer');\n\n if ($params ['Offer'] ['parcels'] == 1) {\n $params ['Offer'] ['parcels'] = 'ACTIVE';\n\n if ($params ['Offer'] ['parcels_off_impost'] == 1)\n $params ['Offer'] ['parcels_off_impost'] = 'ACTIVE';\n else\n $params ['Offer'] ['parcels_off_impost'] = 'INACTIVE';\n } else {\n $params ['Offer'] ['parcels'] = 'INACTIVE';\n $params ['Offer'] ['parcels_off_impost'] = 'INACTIVE';\n }\n\n $params ['Offer'] ['company_id'] = $this->Session->read('CompanyLoggedIn.Company.id');\n $params ['Offer'] ['status'] = 'ACTIVE';\n\n $params ['Offer'] ['begins_at'] = $this->Utility->formataData($params ['Offer'] ['begins_at']);\n $params ['Offer'] ['ends_at'] = $this->Utility->formataData($params ['Offer'] ['ends_at']);\n\n // trabalhando especificacao e descricao para insert no banco\n $params ['Offer'] ['description'] = strip_tags($params ['Offer'] ['description'], '<a><strong><p><br><b><li><ul><img>');\n $params ['Offer'] ['specification'] = strip_tags($params ['Offer'] ['specification'], '<a><strong><p><br><b><li><ul><img>');\n\n // $params['Offer']['description'] = substr($params['Offer']['description'], 0, 1000);\n // $params['Offer']['specification'] = substr ($params['Offer']['specification'], 0 ,1000);\n\n $ofertaPublica = $params ['Offer'] ['public'];\n $params ['Offer'] ['value'] = str_replace(',', '.', str_replace('.', '', $params ['Offer'] ['value']));\n $addOffer = $this->Utility->urlRequestToSaveData('offers', $params);\n if ($addOffer ['status'] == 'SAVE_OK') {\n if ($this->Session->read('addOffer.update') == true) {\n // deletando publico alvo e filtros selecionados\n $offerId = $this->Session->read('addOffer.Offer.id');\n\n $query = \"DELETE FROM offers_filters where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferFilter = $this->Utility->urlRequestToGetData('users', 'query', $params);\n\n $query = \"DELETE FROM offers_users where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferUser = $this->Utility->urlRequestToGetData('users', 'query', $params);\n\n $query = \"DELETE FROM offers_photos where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferUser = $this->Utility->urlRequestToGetData('users', 'query', $params);\n } else {\n // pegando id de oferta cadastrada\n $params = array(\n 'Offer' => array(\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $offer = $this->Utility->urlRequestToGetData('offers', 'first', $params);\n $offerId = $offer ['Offer'] ['id'];\n }\n\n // $offerId = 42;\n // pegando valores de filtros selecionados\n $gender = implode(',', $this->Session->read('addOffer.filters.gender'));\n $location = implode(',', $this->Session->read('addOffer.filters.location'));\n $age_group = implode(',', $this->Session->read('addOffer.filters.age_group'));\n $political = implode(',', $this->Session->read('addOffer.filters.political'));\n $relationship_status = implode(',', $this->Session->read('addOffer.filters.relationship_status'));\n $religion = implode(',', $this->Session->read('addOffer.filters.religion'));\n\n // fazendo insert de filtros\n $params = array(\n 'OffersFilter' => array(\n 'offer_id' => $offerId,\n 'gender' => $gender,\n 'location' => $location,\n 'age_group' => $age_group,\n 'political' => $political,\n 'religion' => $religion,\n 'relationship_status' => $relationship_status\n )\n );\n $addOfferFilters = $this->Utility->urlRequestToSaveData('offers', $params);\n\n // fazendo insert de fotos\n $photos = $this->Session->read('addOffer.OffersPhoto');\n foreach ($photos as $photo) {\n if (!empty($photo)) {\n $params = array(\n 'OffersPhoto' => array(\n 'offer_id' => $offerId,\n 'photo' => $photo ['photo']\n )\n );\n $addPhoto = $this->Utility->urlRequestToSaveData('offers', $params);\n }\n }\n\n if ($ofertaPublica == 'INACTIVE') {\n // fazendo insert de usuarios capturados\n $users = $this->Session->read('addOffer.users');\n foreach ($users as $user) {\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$offerId}', '{$user['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n }\n\n // verifica se oferta esta sendo cadastrada para usuario que fez desejo\n if ($this->Session->check('CadOfferUser.id_linha_wishlist')) {\n $data = date('Y/m/d');\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->Session->read('CadOfferUser.id_linha_wishlist'),\n 'status' => 'ACTIVE',\n 'offer_id' => $offerId\n )\n );\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n }\n }\n } else {\n echo \"<script>alert('email enviado com sucesso');</script>\";\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n }\n }", "function buy(Time $processingTime, Trade $updateExistingTrade = null, $cancelOffer = false, $price)\n\t{\n\t\t$sellingAsset = $this->settings->getBaseAsset();\n\t\t$buyingAsset = $this->settings->getCounterAsset();\n\t\t\n\t\t$budget = $this->getCurrentBaseAssetBudget(true);\n\t\t$sellAmount = \\GalacticHorizon\\Amount::createFromFloat($budget);\n\n\t\tif (!$cancelOffer && $sellAmount->toFloat() <= 0) {\n\t\t\t$this->data->logError(\"Manage buy offer failed, buying amount is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$cancelOffer && (float)$price <= 0)\n\t\t{\n\t\t\t$this->data->logError(\"Manage buy offer failed, price is zero.\");\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/*\n\t\tvar_dump(\"budget = \" . $budget);\n\t\tvar_dump(\"price = \" . $price);\n\t\tvar_dump(\"sellingAsset = \" . $sellingAsset->getCode());\n\t\tvar_dump(\"sellAmount = \" . $sellAmount->toFloat());\n\t\tvar_dump(\"buyingAsset = \" . $buyingAsset->getCode());\n\t\texit();\n\t\t*/\n\n\t\t$manageOffer = new \\GalacticHorizon\\ManageSellOfferOperation();\n\t\t$manageOffer->setSellingAsset($sellingAsset);\n\t\t$manageOffer->setBuyingAsset($buyingAsset);\n\t\t$manageOffer->setSellAmount($cancelOffer ? \\GalacticHorizon\\Amount::createFromFloat(0) : $sellAmount);\n\t\t$manageOffer->setPrice(\\GalacticHorizon\\Price::createFromFloat($price));\n\t\t$manageOffer->setOfferID($updateExistingTrade ? $updateExistingTrade->getOfferID() : null);\n\n\t\ttry {\n\t\t\t$transaction = new \\GalacticHorizon\\Transaction($this->settings->getAccountKeypair());\n\t\t\t$transaction->addOperation($manageOffer);\n\t\t\t$transaction->sign([$this->settings->getAccountKeypair()]);\n\t\t\t\n\t\t\t$buffer = new \\GalacticHorizon\\XDRBuffer();\n\t\t\t$transaction->toXDRBuffer($buffer);\n\n\t\t\t$automaticlyFixTrustLineWithAmount = \\GalacticHorizon\\Amount::createFromFloat(2000000);\n\n\t\t\t$transactionResult = $transaction->submit($automaticlyFixTrustLineWithAmount);\n\n\t\t\tif ($transactionResult->getErrorCode() == \\GalacticHorizon\\TransactionResult::TX_SUCCESS) {\n\t\t\t\t// Return when an offer is cancelled\n\t\t\t\tif ($cancelOffer)\n\t\t\t\t\treturn true;\n\n\t\t\t\t$trade = Trade::fromGalacticHorizonOperationResponseAndResultForBot(\n\t\t\t\t\t$manageOffer,\n\t\t\t\t\tTrade::TYPE_BUY,\n\t\t\t\t\t$transactionResult,\n\t\t\t\t\t$transactionResult->getResult(0),\n\t\t\t\t\t$buffer->toBase64String(),\n\t\t\t\t\t$transactionResult->getFeeCharged()->toString(),\n\t\t\t\t\t$this\n\t\t\t\t);\n\n\t\t\t\t$lastTrade = $this->data->getLastTrade();\n\n\t\t\t\tif ($lastTrade)\n\t\t\t\t\t$trade->setPreviousBotTradeID($lastTrade->getID());\n\n\t\t\t\t$trade->setProcessedAt($processingTime->getDateTime());\n\n\t\t\t\t$this->data->addTrade($trade);\n\n\t\t\t\treturn $trade;\n\t\t\t} else {\n\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, error code = \" . $transactionResult->getErrorCode());\n\n\t\t\t\tif ($transactionResult->getResultCount() > 0) {\n\t\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer result, error code = \" . $transactionResult->getResult(0)->getErrorCode());\n\t\t\t\t}\n\n\t\t\t\t$this->getDataInterface()->logError(\"Transaction envelope = \" . $buffer->toBase64String());\n\t\t\t}\n\t\t} catch (\\GalacticHorizon\\Exception $e) {\n\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, exception = \" . (string)$e);\n\t\t\t$this->getDataInterface()->logError(\"Response = \" . $e->getHttpResponseBody());\n\t\t}\t\n\n\t\treturn false;\n\t}", "function addIncome($week, $money){\n global $db;\n \n $get = getRecentSaleId();\n $idSale=$get['idSale'];\n $stmt =$db->prepare(\"INSERT INTO invoices (week, revenue, idSale) VALUES (:week, :revenue, :idSale)\");\n \n $binds= array(\n \":week\"=> $week,\n \":revenue\"=> $money,\n \":idSale\"=>$idSale\n );\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n return true;\n }\n else{\n return false;\n }\n }", "function purchaseItem($idItem, $unitCost, $amount, $week){ //Seems to be no add() so maybe pull the new amount from the website or call an updateItemAmount()\n global $db;\n \n $money = $amount * $unitCost;\n $stmt=$db->prepare(\"INSERT INTO purchases (week, idItem, amount, money) VALUES (:week, :idItem, :amount, :money)\");\n \n $binds= array (\n \":week\" => $week,\n \":idItem\" => $idItem,\n \":amount\" => $amount,\n \":money\" => $money\n );\n \n if($stmt->execute($binds) && $stmt->rowCount()>0){\n //Runs functions to keep the other dataTables working\n addExpense($week, $money);\n $invAmount = getAmount($idItem);\n $netAmount = $invAmount['amount'] + $amount;\n return updateItemAmount($idItem, $netAmount);//returns true if successful\n \n }\n else{\n return false;\n }\n }", "public function created(Expense $expense)\n {\n //\n }", "function mint_update_account($session, $token, $account_id, $account_name, $total) {\n $_post = array(\n \"accountId\" => $account_id,\n \"types\" => \"ot\",\n \"accountName\" => $account_name, \n \"accountValue\" => $total,\n \"associatedLoanRadio\" => \"No\", \n \"accountType\" => \"3\", \n \"accountStatus\" => \"1\",\n \"token\" => $token,\n );\n $session->URLFetch(\"https://wwws.mint.com/updateAccount.xevent\", $_post);\n}", "public function insertExpensesInfo($user_id, $expenses) {\n\n//\t\t$user_id = '1';\n $userExpensesInfoSql = \"INSERT into expenses VALUES ('',$user_id,$expenses->exp_rent,$expenses->exp_utilities,$expenses->exp_groceries,$expenses->exp_gas,$expenses->exp_entertainment,$expenses->exp_household,$expenses->exp_health,$expenses->exp_travel,$expenses->exp_emi,$expenses->exp_cc_month,$expenses->exp_others,'','')\";\n\n $connection = Yii::app()->db3;\n $command = $connection->createCommand($userExpensesInfoSql)->execute();\n\n return 1;\n }", "function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }", "public function payForInvitedUsers(){\n \n $userService = parent::getService('user','user');\n \n $refererUsers = $userService->getUsersWithRefererNotPaid();\n foreach($refererUsers as $user):\n // if created at least 30 days ago\n if(strtotime($user['created_at'])>strtotime('-30 days')){\n continue;\n }\n // if logged within last 5 days ago\n if(!(strtotime($user['last_active'])>strtotime('-7 days'))){\n $user->referer_not_active = 1;\n $user->save();\n continue;\n }\n \n $values = array();\n $values['description'] = 'Referencing FastRally to user '.$user['username'];\n $values['income'] = 1;\n \n \n if($user['gold_member_expire']!=null){\n $amount = 100;\n }\n else{\n $amount = 10;\n }\n \n \n $userService->addPremium($user['referer'],$amount,$values);\n $user->referer_paid = 1;\n $user->save();\n endforeach;\n echo \"done\";exit;\n }", "public static function AddOffer(){\n\n\t\t\t\n\n\t\t}", "public function addGold($amount) {\n\t\t$this->gold += $amount;\n\n\t\treturn $this->gold;\n\t}", "public function exp_inc(Request $request){\n $input = $request->all();\n $expenses = Budget::whereBetween('created_at',[$input['start'],$input['end']])->where('type','=','exp')->get();\n $incomes = IncomeNote::whereBetween('created_at',[$input['start'],$input['end']])->get();\n $total_expense = 0;\n $total_income = 0;\n foreach ($expenses as $values){\n $total_expense += $values['amount'];\n }\n foreach ($incomes as $values){\n $total_income += $values['amount'];\n }\n $remain = $total_income-$total_expense;\n return response()->json(['exp'=>money_format('$%i', $total_expense),'inc'=>money_format('$%i', $total_income),'remain'=>money_format('$%i', $remain)]);\n }", "public function add_gold(MeAPI_RequestInterface $request){\n $authorize = new MeAPI_Controller_AuthorizeController();\n if ($authorize->validateAuthorizeRequest($request) == true) {\n $params = $request->input_request();\n $games = json_decode($params[\"games\"], true);\n // init start_time\n $start_time = microtime(true);\n \n // check IPs\n if (!in_array($this->clientIP, $this->whiteListIP)){\n $this->_response = new MeAPI_Response_APIResponse($request, 'IP_REJECT');\n return;\n }\n \n // Kiểm tra tồn tại các input-params\n if (!is_required($params, array('mobo_service_id', 'user_name', 'server_id', 'transaction_id', 'time_stamp', 'type', 'amount', 'money', 'channel', 'platform'))) {\n $this->_response = new MeAPI_Response_APIResponse($request, 'INVALID_PARAMS');\n return;\n }\n \n if (!is_required($params, array('org_money'))) {\n $this->_response = new MeAPI_Response_APIResponse($request, 'INVALID_PARAMS org_money');\n return;\n }\n \n $this->CI->load->library('EdenAPI', NULL, 'EdenAPI');\n \n // call model set transaction\n $this->CI->load->model('../third_party/MeAPI/Models/PaymentModel', 'PaymentModel');\n \n // check duplicate transaction\n $isDuplicate = $this->CI->PaymentModel->checkDuplicateTransaction(trim($params['transaction_id']));\n if ($isDuplicate){\n $this->_response = new MeAPI_Response_APIResponse($request, 'DUPLICATE_TRANSACTION');\n return;\n }\n \n $idInserted = $this->CI->PaymentModel->setTransaction($params['mobo_service_id'], $params['user_name'], $params['transaction_id'],\n $params['server_id'], $params['time_stamp'], $params['type'], $params['amount'], \n $params['org_money'], $params['money'], $params['channel'], $params['platform'], $params['carrier'],\n $params['client_ip'], $games['order_id'], $params['games']);\n \n if ($idInserted == null){\n $this->_response = new MeAPI_Response_APIResponse($request, 'INSERT_TRANSACTION_FAIL');\n return;\n }\n \n // call API add money\n $result = $this->CI->EdenAPI->add_money($params['mobo_service_id'], $params['transaction_id'], $params['type'],\n $params['amount'], $params['server_id'], $params['time_stamp'], $params['org_money'], $params['money'], $games['order_id']);\n \n // calc latency\n $latency = (microtime(true) - $start_time);\n \n if ($result == true) {\n // push message queue\n $this->push_rabbit_mq($params, 1);\n \n $this->CI->PaymentModel->finishTransaction($idInserted, 1, $latency); // update status = 1: success\n $this->_response = new MeAPI_Response_APIResponse($request, 'ADD_MONEY_SUCCESS');\n } else {\t\t\n // push message queue\n $this->push_rabbit_mq($params, 0, 'ADD_MONEY_FAIL');\n \n $this->CI->PaymentModel->finishTransaction($idInserted, 2, $latency, $this->CI->EdenAPI->getErrorMessage()); // update status = 2: fail\n $this->_response = new MeAPI_Response_APIResponse($request, 'ADD_MONEY_FAIL', $this->CI->EdenAPI->getErrorMessage());\n }\n } else {\n $this->_response = $authorize->getResponse();\n }\n }", "public function addIncome($amount, $username)\n {\n $account = Account::findOne([\n 'username' => $username,\n ]);\n\n $account->balance += $amount;\n\n $account->update(true, ['balance']);\n }", "function buyFeature($feature_type, $world_id) {\n\twriteLog(\"buyFeature()\");\n\n\t$cost = calculateFeatureCost($feature_type, $world_id);\n\t\n\t# Determine if enough funds exist\n\t$current_funds = getCurrentFunds($world_id);\n\t\n\tif ($current_funds >= $cost) {\n\t\t# Update funds\n\t\t$dml = \"UPDATE oddworld.grid SET grid_money = grid_money - \" . $cost . \" WHERE grid_id = \" . $world_id . \";\";\n\t\twriteLog(\"buyFeature(): DML: \" . $dml);\n\t\t$status = doInsert($dml);\t\n\t}\n\t\n}", "function expense_tracker_add_row()\n{\n\t$this->layout='blank';\n\t$s_society_id=(int)$this->Session->read('society_id');\n\t$s_user_id=(int)$this->Session->read('user_id');\n\n\t\t$count = (int)$this->request->query('con');\n\t\t$this->set('count',$count);\n\n\t\t\t$this->loadmodel('accounts_group');\n\t\t\t$conditions=array(\"accounts_id\" => 4);\n\t\t\t$cursor1=$this->accounts_group->find('all',array('conditions'=>$conditions));\n\t\t\t$this->set('cursor1',$cursor1);\n\n\t\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t\t$conditions=array(\"ledger_id\" => 15);\n\t\t\t\t$cursor2=$this->ledger_sub_account->find('all',array('conditions'=>$conditions));\n\t\t\t\t$this->set('cursor2',$cursor2);\n}", "function post() {\n $this->check_closed();\n // Actual commission modification\n $t = new xTransaction();\n $t->start();\n $result = parent::post();\n // Archives evaluation if state becomes 'closed'\n if (@$this->params['items']['evaluation_evaluation_etat_id'] == 0) {\n xModel::load('evaluation', array(\n 'id' => $this->params['id']\n ))->archive();\n //Change the etat_id of the evaluation\n $t->execute(xModel::load('evaluation', array(\n 'id' => $this->params['id'],\n 'evaluation_etat_id' => 4)\n ), 'post');\n }\n $t->end();\n // Returns operation result\n return $result;\n }", "public function updated(Expense $expense)\n {\n if ($expense->status == 1 && $expense->wallet) {\n $wallet = $expense->wallet;\n $wallet->update([\n 'balance' => ($wallet->balance - $expense->amount)\n ]);\n }\n }", "public function buySilverTicket(): M_member\n\t{\n\n\t\t$this->db->set($this->pointField(), $this->point - $this->config->item('silver_ticket_price'));\n\t\t$this->db->set($this->silverTicketField(), $this->silverTicket + 1);\n\t\t$this->db->where($this->idField(), $this->id);\n\t\t$this->db->update($this->tableName());\n\n\t\treturn $this->getData();\n\t}", "public function newAction()\n {\n $securityContext = $this->get('security.context');\n if ($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n $userEntity = $securityContext->getToken()->getUser();\n } else {\n return $this->redirect($this->generateUrl('fos_user_security_login'));\n }\n\n $entity = new Expense();\n $entity->setUser($userEntity);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "function Give_Gold($amount = 0) {\r\n\t\tglobal $character, $gameinstance;\r\n\t\tif(isset($amount) && is_numeric($amount) && $amount >= 0) \r\n\t\t{\r\n\t\t\tdbn(__FILE__,__LINE__,\"update ${gameinstance}_characters set gold = gold + '$amount' where login_id = '$character[login_id]'\");\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tSystemMessage(CHAR_CANNOT_GIVE_GOLD);\r\n\t\t}\r\n\t}", "public function commit()\n {\n $this->voucherService->addVoucher($this->voucher);\n \n }", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "public function insertinvCredite()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `invcredite`(`idicre`, `idcrdite`, `amount`)VALUES('$this->idicre' ,'$this->idcrdite' ,'$this->amount')\");\n $result = $sql->execute();\n $id = $dbh->lastInsertId();\n return array ($result,$id);\n }", "public function submit(Request $request){\n\t\t// dd($request->all());\n\t\t// added some validation for form values. \n\t\t$request->validate([\n\t\t\t'type' => 'required|string',\n\t\t\t'amount' => 'required|numeric',\n\t\t\t'title' => 'required|string'\n\t\t]);\n\t\t\n\t\tDB::beginTransaction(); // starting transaction for runtime db error.\n\t\t// if one query executed and other gives error then both will be roll backed. \n\t\ttry {\n\t\t\t// dd($request->all()); // debugging method die dump.\n $transaction = new Expense;\n $transaction->type = $request->type;\n $transaction->title = $request->title;\n $transaction->amount = $request->amount;\n $transaction->driver_id = auth()->user()->id;\n\t\t\t$transaction->save();\n\n\n\n\t\t} catch (\\Throwable $th) {\n\t\t\tdd($th);\n\t\t\tDB::rollback();\n\t\t\tToastr::error('Server side error');\n\t\t\treturn redirect()->back();\n\t\t}\n\n\t\tDB::commit();\n\t\tToastr::success('transaction created successfully', 'Created!');\n return redirect()->back();\n\t}", "function payNOw(){\n $from = $_SESSION['user']['id'];\n $to = $_POST['to_user'];\n $amount = $_POST['amount'];\n $description= $_POST['description'];\n\n //from user money update(-)\n $fromUserDetail = user($from);\n $leftMoney = $fromUserDetail['money']-$amount;\n if($fromUserDetail['money'] >= $amount || $fromUserDetail['money'] >= 0){\n $sql = \"UPDATE users SET money=$leftMoney WHERE id=$from\";\n mysqli_query(con(),$sql);\n\n //to user money update(+)\n $toUserDetail =user($to);\n $newMoney = $toUserDetail['money']+$amount;\n $sql = \"UPDATE users SET money=$newMoney WHERE id=$to\";\n mysqli_query(con(),$sql);\n\n //add to transitoion table\n $sql =\"INSERT INTO transition (from_user,to_user,amount,description) VALUES ('$from','$to','$amount','$description')\";\n run_query($sql);\n }\n else{\n echo alert(\"Error\");\n }\n}", "public function add_inventory($productName,$quantity){\r\n // math\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $preSql = \"Select quantity from inventory where productName = '$productName'\";\r\n $preResult = $conn->query($preSql);\r\n $preRow = $preResult->fetch_assoc();\r\n $total = $preRow[\"quantity\"] + $quantity;\r\n // query\r\n $sql = \"Update inventory SET quantity = '$total' WHERE productName = '$productName'\";\r\n $conn->query($sql);\r\n }", "function addToAccountBalance($username,$soldValue,$stockTicker)\n{\n \n $mysql_server = '192.168.1.101';\n \n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n $findBalQry = \"SELECT * FROM bank WHERE username='$username'\";\n $findBalResult = $mysqli->query($findBalQry);\n \n $oldBalance = 0;\n \n if($findBalResult->num_rows > 0){\n while ($row = $findBalResult->fetch_assoc()){\n \n $oldBalance = $row['balance'];\n }\n }\n $newBalance = $oldBalance + $soldValue;\n \n $UpdateQry = \"UPDATE bank SET balance='$newBalance' where username='$username'\";\n $result = $mysqli->query($UpdateQry);\n \n //Print Values for Tests\n //var_dump($oldBalance);\n //var_dump($newBalance);\n \n}", "public static function add($entreprise){\n $con=new connexion();\n $resultat=$con->executeactualisation(\"insert into tblentreprise (id_entreprise,admin_id,nom,logo,ville_id,adresse_complete,etat,date_ajout,date_modifier)\n values('\" . $entreprise->ident . \"','\" . $entreprise->adminid . \"','\" . $entreprise->nom . \"','\" . $entreprise->logo . \"','\" . $entreprise->villeid . \"','\" . $entreprise->adressecomp . \"',1,NOW(),NOW())\");\n $con->closeconnexion();\n\n }", "public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }", "public function deposit($amount)\n {\n $this->increase($amount);\n \n return;\n }", "public function testAddAmount() {\n $amount = 1000;\n $date = '3/10/2015';\n $this->assertNull( $this->tranche->addAmount($amount, $date));\n }", "private function addTransactionRequest( $bundle, $amount ) {\n \n $response = wp_remote_get( 'http://localhost:8080/fabricService/fsGateway?action=invoke&bundle=' . $bundle . '&amount=' . $amount );\n try {\n \n // Note that we decode the body's response since it's the actual JSON feed\n $json = json_decode( $response['response'] );\n \n } catch ( Exception $ex ) {\n $json = null;\n } // end try/catch\n \n return $json;\n \n }", "public function testCanMakeInvestment() : void\n {\n $this->tranche->makeInvestment(100);\n\n $this->assertEquals(49900, $this->tranche-> getRemainingInvestment());\n }", "function addfee()\n {\n global $db;\n $requete = $db->prepare('INSERT INTO fees (date,nature,amount,site_id) values(?,?,?,?)');\n $requete->execute(array(\n $this->date,\n $this->nature,\n $this->amount,\n $this->site_id\n ));\n }", "public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }", "public function actionDepositMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Set the new wallet balance with conversion\n $wallet->balance += $result['converted_amount'];\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Set the new wallet balance without conversion\n $wallet->balance += $amount;\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the deposit\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }", "public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "public function cancel_local_activation($sum,$symbol,$id_trader,$login)\n\t{\n $this->db->trans_start();\n\t $this->db->query(\"UPDATE investroom_personal_accounts SET $symbol = $symbol+$sum WHERE id=$id_trader\");\n $this->db->trans_complete();\n\t $data['active'] = '0';\n\t return $this->db->where('login',$login)\n\t ->update('pamm_accounts', $data);\n\t}", "public function addDonation($amount, $card){\r\n $stmt = $this->DB->prepare(\"INSERT INTO transactions VALUES(NULL, 'DONATION', NULL,NULL,NULL,:card,now(),'PROCESSED');\");\r\n $stmt->bindParam(\"card\",$card);\r\n $stmt->execute();\r\n }", "function _set_treated_expedition_extrafield($idexpe, $shipmentEntity) {\n\tglobal $db, $user, $conf;\n\n\t$sql = \"select entity from \".MAIN_DB_PREFIX.\"expedition where rowid =\".$idexpe;\n\t$re = $db->query($sql);\n $obj = $db->fetch_object($re);\n\n // var_dump($obj->entity);\n\n // var_dump($conf->entity,$shipmentEntity);\n\t$backEntity = $conf->entity;\n\n\t$conf->entity = $obj->entity;\n\n\n\t$currentExp = new Expedition($db);\n\t$res = $currentExp->fetch(intval($idexpe));\n\n\n\n // var_dump($conf->entity, $res, $idexpe);exit();\n\n\t$extra = new ExtraFields($db);\n\t$resultExtra = $extra->fetch_name_optionals_label($currentExp->table_element);\n\t//var_dump($resultExtra);exit();\n\tif($resultExtra) {\n\t\t$currentExp->array_options['options_customer_treated_shipment'] = 1;\n\t\t$currentExp->updateExtraField('customer_treated_shipment');\n\t}else {\n\t\tdol_syslog(__METHOD__.' $resultExtra='.var_export($resultExtra,true), LOG_ERR);\n\t}\n\n\t$conf->entity = $backEntity;\n //var_dump($conf->entity);exit();\n}", "function newDeposit($user, $amount, $operation_id){\r\n global $pdo;\r\n $stmt = $pdo->prepare('INSERT INTO deposits (DepositUserID, DepositDate, DepositAmount, DepositVerification, DepositType) VALUES (:DepositUserID, :DepositDate, :DepositAmount, :DepositVerification, :DepositType)');\r\n $stmt->execute(array(':DepositUserID' => $user, ':DepositDate' => time(), ':DepositAmount' => $amount, ':DepositVerification' => $operation_id, ':DepositType' => 'FreeKassa'));\r\n}", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function actionAutoAddInvites(){\n $users = User::model()->findAll(\"status = :status AND invitations < :invite\",array(\":status\"=>1,\":invite\"=>2));\n $userStats = UserStat::model()->findAll();\n $stat = array();\n foreach ($userStats as $userStat){\n $stat[$userStat->user_id] = $userStat;\n }\n \n // check all users\n foreach ($users as $user){\n if (!isset($stat[$user->id])){\n // not yet calculated %\n $c = new Completeness();\n $c->setPercentage($user->id);\n }else{\n //percentage in now add invitations\n if ($stat[$user->id]->completeness >= PROFILE_COMPLETENESS_MIN){\n if ($stat[$user->id]->invites_send == 0) $user->invitations +=4; // initial 4+1 invites after profile completed\n $user->invitations++;\n }\n if ($stat[$user->id]->invites_send > 5) $user->invitations+=2;\n if ($stat[$user->id]->invites_registered > 5) $user->invitations++;\n $user->save(); \n }\n }\n }", "public function actionCreate($amountFrom = null, $exchangeId = null, $amount = null){\n\n if (!Yii::$app->session['amountFrom']) {\n return $this->redirect(['//site/index']);\n }\n\n $model = new Transaction();\n\n if ($model->load(Yii::$app->request->post())){\n $load = Yii::$app->request->post();\n \n $model->clientId = Yii::$app->user->id;\n\n // Exchange Rate Used\n $er = ExchangeRate::find()->where(['id' => $load['Transaction']['exchangeId']])->one();\n $model->currencyIdFrom = $er->currencyIdFrom;\n $model->currencyIdTo = $er->currencyIdTo;\n $model->sellRateValue = $er->sellValue;\n $model->buyRateValue = $er->buyValue;\n \n // Check if I should multiply or divide according to the \"base\" currency (id=1)\n // Multiply\n if ($model->currencyIdFrom == 1){\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n // Divide\n else if ($model->currencyIdTo == 1){\n $model->amountTo = $model->amountFrom/$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountFrom/$model->buyRateValue) - $model->amountTo;\n }\n // For the future...\n else {\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n \n // Look for the account the user tranfered the money to and update the available amount of money\n //$accountAdmin = AccountAdmin::find()->where(['id' => $load['Transaction']['accountAdminId']])->one();\n \n // Look for the available amount of money in every account of the To \n //$accountAdmin = new AccountAdmin();\n //$accounts = $accountAdmin->getAccountsAvailableMoney($model->amountTo);\n \n // Available money in all of the accounts\n $accountAdmin = new AccountAdmin();\n $available = $accountAdmin->getAmountSumByCurrency($er->currencyIdTo);\n \n // If the account \"has\" the money... continue\n if ($available['total'] >= $model->amountTo){\n $model->transactionDate = Yii::$app->formatter->asDate($_POST['Transaction']['transactionDate'], 'yyyy-MM-dd');\n \n // Transaction receipt\n $upload_file = UploadedFile::getInstance($model, 'uploadFile');\n\n if (!empty($upload_file) && $upload_file->size !== 0){\n\n if ($model->validate()){\n if ($model->save()){\n\n $fileName = 't-' . $model->id . '.' . $upload_file->extension;\n $model->uploadFile = $fileName;\n $model->save();\n\n $upload_file->saveAs('uploads/' . $fileName);\n\n /**\n * Unsets the session variables\n */\n\n Yii::$app->session->remove('amountFrom');\n Yii::$app->session->remove('currencyIdFrom');\n Yii::$app->session->remove('currencyIdTo');\n\n // \"Substract\" the amountTo from the account\n //$accountAdmin->maxAmount = $accountAdmin->maxAmount - $model->amountTo;\n //$accountAdmin->save();\n \n return $this->redirect(['index']);\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Debe agregar el comprobante de la transacción.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }\n else {\n Yii::$app->getSession()->setFlash('error','La cantidad solicitada no se encuentra disponible. Por favor pruebe con un monto más bajo.');\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n /*$er1 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdFrom']], ['currencyIdTo' => $load['Transaction']['currencyIdTo']]])->one();\n \n if ($er1 != null){\n $model->sellRateValue = $er1->sellValue;\n $model->buyRateValue = $er1->buyValue;\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $er1->sellValue;\n }\n else {\n $er2 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdTo']], ['currencyIdTo' => $load['Transaction']['currencyIdFrom']]])->one();\n \n if ($er2 != null){\n $model->sellRateValue = $er2->sellValue;\n $model->buyRateValue = $er2->buyValue;\n $model->amountTo = $model->amountFrom/$model->buyRateValue;\n $model->usedValue = $er2->buyValue;\n } \n }*/ \n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function addEntries(Transaction $trans);", "final public function addItemTechnicianInCharge() {\n $this->addUserByField('users_id_tech', true);\n }", "public function taskAddCredit($amount,$user=null,$message=null)\n\t{\n\t\t$user=$user?$user:app()->user->model();\n\t\t$credit = $user->credit;\n\t\tif(!$credit)\n\t\t{\n\t\t\t$credit = new MPaymentCredit;\n\t\t\t$credit->id = $user->id;\n\t\t\t$credit->amount = 0;\n\t\t}\n\t\t\n\t\t$credit->amount+= $amount;\n\t\t$credit->save();\n\t\t\n\t\tif($message)\n\t\t{\n\t\t\t$m = new MTransactionHistory;\n\t\t\t$m->userId = $user->id;\n\t\t\t$m->action = $amount >= 0 ? 'plus' : 'minus';\n\t\t\t$m->amount = $amount;\n\t\t\t$m->comment = $message;\n\t\t\t$m->date = time();\n\t\t\t$m->save();\n\t\t}\n\t}", "public function purchaseAccountLedgerEntry()\n {\n $items = $this->getItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $salesLedgerRecord = $financeLedger->fetchByName('Purchase Account');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId;\n \n $dataToInsert = array(\n 'debit' => $totalPrice,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $salesLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function addCredits($amount)\n {\n $credit = $this->credit;\n $credit->amount = $credit->amount + $amount;\n $credit->save();\n return $credit;\n }", "public function expenses()\n {\n return $this->hasMany('OurHouse\\Models\\Expense');\n }", "public function actionrequestingEscrow(){\n \n \n \n \n $model = new Escrow;\n \n $member_id = Yii::app()->user->id;\n \n if(isset($_POST['quoted_id'])){\n $model->quote_id = $_POST['quote_id'];\n }else{\n $model->quote_id = 0;\n }\n \n $model->product_id = $_POST['product_id'];\n $model->escrow_number = $model->generateTheEscrowNumberForThisTransaction($model->quote_id,$model->product_id);\n if(isset($_POST['is_quotable'])){\n if($_POST['is_quotable'] == true){\n $model->is_quoted =1;\n }else{\n $model->is_quoted =0;\n }\n \n }else{\n $model->is_quoted = 0;\n }\n if(isset($_POST['future_trading'])){\n $model->is_futuristic = $_POST['future_trading'];\n }else{\n $model->is_futuristic = 0;\n \n }\n \n \n $model->minimum_number_of_product_to_buy = $_POST['minimum_number_of_product_to_buy_for_computation'];\n $model->whats_product_per_item = $_POST['whats_represents_an_item'];\n $model->status = strtolower('live');\n $model->escrow_operation_for = $_POST['escrow_request_from'];\n if($_POST['subscription_type'] == strtolower('post')){\n $model->quantity = $_POST['subscription_quantity'];\n }else{\n $model->quantity = $_POST['quantity_of_purchase'];\n }\n \n $model->price_per_item = $_POST['prevailing_retail_selling_price'];\n $model->total_amount_purchased=$_POST['amount_to_be_paid'];\n $model->escrow_initiation_date = new CDbExpression('NOW()');\n $model->escrow_initiated_by = Yii::app()->user->id;\n $model->direction = strtolower('initiation');\n \n $is_escrowed = 1;\n $is_escrow_accepted = 0;\n $start_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['start_price_validity_period'])); \n $end_price_validity_period = date(\"Y-m-d H:i:s\", strtotime($_POST['end_price_validity_period'])); \n $cobuy_member_selling_price = 0;\n $amount_saved_on_purchase = 0;\n if($this->isMemberWithOpenOrder($member_id)){\n $order_id = $this->getTheOpenOrderInitiatedByMember($member_id);\n }else{\n $order_id = $this->createNewOrderForThisMember($member_id);\n }\n \n $escrow_file_error = 0;\n \n if($_FILES['escrow_agreement_file']['name'] != \"\"){\n if($_FILES['escrow_agreement_file']['type'] == 'application/pdf'){\n $escrow_filename = $_FILES['escrow_agreement_file']['name'];\n $escrow_filesize = $_FILES['escrow_agreement_file']['size'];\n }else{\n $escrow_file_error = $escrow_file_error + 1;\n \n }\n \n if($escrow_file_error == 0){\n if($model->validate()) {\n \n //move the escrow agreement file to the escrow directory \n $model->escrow_agreement_file = $model->moveTheEscrowAgreementToItsPathAndReturnItsFileName($escrow_filename);\n if($model->escrow_operation_for ==strtolower('noncart')){\n if($model->save()) {\n // if($this->isProductSubscriptionUpdatedSuccessfully($member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n /** }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section to consummate this transaction\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n } \n * \n */ \n \n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n if($model->hasTheEscrowOfThisSubscriptionAlreadyInitiated($member_id,$model->status,$model->product_id,$model->escrow_operation_for)==false){\n if($model->save()) {\n if($this->isProductSubscriptionUpdatedSuccessfully($model->id,$member_id,$model->product_id)){\n $msg = \"product escrow was initiated successful. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n \n }else{\n if($model->escrow_operation_for == 'pre'){\n $msg = \"This pre-subscribed product had been sent to the escrow administrator. If the escrow is accepted, the product will be added to your cart so as to effect payment. However, you may visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }else{\n $msg = \"product escrow was initiated successful. However, the product subscription information were not updated. Please Visit the Escrow module in 'My Oneroof' section if you ever need to modify or cancel the escrow\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_from\"=>$model->escrow_operation_for)\n );\n }\n \n \n } \n \n \n }else{\n \n $msg = \"There was an issue initiating this escrow. Possibly field validation error\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }else{\n $msg = \"You already have an escrow on this product subscription waiting for acceptance.You may need to wait for the escrow to be accepted before initiating a new one\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n \n }\n \n \n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"Validaion Error: Check the forms fields for correctness\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg\n )\n );\n \n }\n }else{\n //delete all the moved files in the directory when validation error is encountered\n $msg = \"File Format Error: There was an error in the uploaded escrow agreement document. Please check the uploaded file and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg)\n );\n }\n }else{\n \n if($model->escrow_operation_for ==strtolower('noncart')){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n if($this->isProductEscrowable($model->product_id )){\n $msg = \"The Escrow Agreement document was not uploaded. Please upload it and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"escrow_number\"=>$model->escrow_number)\n );\n }else{\n $msg = \"This product is not escrowable. Please choose another product and try again\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }\n \n } \n \n \n }", "public function add($receipt){\n\tDatabase::add('SOLD_ITEMS', array($receipt, $this->id,$this->quantity,$this->total));\n\tSales_Item::update($this->id,'SELL',$this->quantity);\n}", "function add_new_node($remote, $local)\n{\n\t$pin=trim(file_get_contents(\"../.mypauth\"));\n\t$ch = curl_init($remote.\"/myp/index.php?process=beanode&pin=\".$pin.\"&remote=\".$local);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\t$newnode=trim($result);\n\t\n\tif($newnode!=\"\")\n\t{\n\t\t$conf=json_decode(file_get_contents(\"../.mypconfig\"));\t \n\t\tforeach($conf as $c)\n\t\t{\n\t\t\t$nodes[]=$c;\n\t\t}\n\t\t$nodes[]=$newnode;\n\t\t\t\t\n\t\tfile_put_contents(\"../.mypconfig\", json_encode($nodes));\n\t\t\n\t\t//requesting other nodes to add this new node\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\tif(($node!=$local) && ($node!=$newnode)) new_node_add_req($node, $newnode);\n\t\t}\t\t\n\t}\n}", "public function add()\n {\n //$this->log($this->request->data, 'debug');\n\n $humidity = $this->Humidities->newEntity();\n $humidity = $this->Humidities->patchEntity($humidity, [\n 'dt' => $this->request->data['datetime'],\n 'val' => $this->request->data['humidity']\n ]);\n\n $result = ['code' => 'S', 'message' => 'Success: humidity save is success.'];\n if (!$this->Humidities->save($humidity)) {\n $result = ['code' => 'E', 'message' => 'Error: unexpected error is occurred when save humidity data.'];\n }\n\n $this->set([\n 'result' => $result,\n '_serialize' => ['result']\n ]);\n }", "public function declineNewRequest(Request $model)\n {\n $model->reserveByOutcome->amount += $model->sum_pull;\n $model->reserveByOutcome->save(false);\n\n if ($model->income) {\n $model->income->delete();\n }\n\n // update due time\n if ($model->done == RequestStatus::NEW_CREATED) {\n $model->processed_at = new Expression('NOW()');\n }\n\n $prevStatus = $model->done;\n $model->done = RequestStatus::DECLINE;\n $model->save(false);\n\n $model->onChangeStatus($prevStatus);\n }", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}", "protected function addDonationToFundraisersTotalRaise()\n {\n $this->fundraiser_profile->addDonation( $this->data['amount'] );\n $this->fundraiser_profile->update();\n }", "public static function deposit($amount, $purse, $description);", "public function insert_target_transaction( $amount, $target_date, $category, $name )\n\t{\n\t\t//Let's add this to the database..\n\t\t$mysqlConnection = new Mysql;\n\t\t\t\n\t\t$query = \"INSERT INTO user_target (user_id, amount, target_date, category, name) \";\n\t\t\n\t\t$values = array( $this->get_id(), $amount, $target_date, $category, $name );\n\t\t\n\t\t$queryDescription = \"Insert target\";\n\t\t\n\t\tdebug( \"inserting target\" );\n\t\t\n\t\tif( $mysqlConnection->mysql_insert( $query, $values, $queryDescription ) )\n\t\t{\t\n\t\t\tdebug( \"success\" );\n\t\t\n\t\t\t//Now we need to select out that transaction to get the new id.\n\t\t\t$added_id = $mysqlConnection->select_most_recent_id( $this->get_id(), \"user_target\");\n\t\n\t\t\t//Finally, let's add it to the current session.\n\t\t\t$this->add_target( $added_id, $amount, $target_date, $category, $name );\n\t\t\t\n\t\t\t//Now we're going to update the current finance value\n\t\t\t//$this->update_finance_total( $amount );\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t}", "public function add_to_transaction(Request $request) {\n\n Log::info(\"TransactionController->add_to_transaction :- Inside \");\n $organization_id = Session::get('organization_id');\n $organization = Organization::findOrFail($organization_id);\n\n //dd($organization);\n\n $entry = [];\n\n /*$existing_transaction = Transaction::find($request->id);\n\n $transaction_type = AccountVoucher::find($existing_transaction->transaction_type_id);\n\n $reference_voucher = ReferenceVoucher::select('name', 'display_name', 'id')->where('name', $transaction_type->name)->where('status', 1)->get();\n\n $remote_reference_no = $existing_transaction->order_no;\n $remote_order_id = $existing_transaction->id;\n */\n\n $transaction_type = AccountVoucher::where('name', $request->transaction_name)->where('organization_id', $organization_id)->first();\n\n\n $previous_entry = Transaction::where('transaction_type_id', $transaction_type->id)->where('organization_id', $organization)->orderby('id', 'desc')->first();\n \n $existing_transaction = Transaction::where('id', $request->id)\n ->first();\n\n /* Update for status colour */\n\n DB::table('transactions')->where('id',$existing_transaction->id)->update(['notification_status'=> \"2\"]);\n\n /* end */ \n\n $remote_order = Organization::select('organizations.id','organizations.business_id','businesses.business_name','business_communication_addresses.mobile_no','business_communication_addresses.email_address','business_communication_addresses.address')\n ->leftjoin('businesses','businesses.id','=','organizations.business_id')\n ->leftjoin('business_communication_addresses','business_communication_addresses.business_id','=','businesses.id')\n ->where('organizations.id', $existing_transaction->organization_id)\n ->first();\n \n $existing_transaction_items = TransactionItem::where('transaction_id', $existing_transaction->id)->get(); \n \n $transaction = new Transaction;\n $transaction->user_type = $existing_transaction->user_type;\n $transaction->reference_no = $existing_transaction->order_no;\n $transaction->reference_id = $existing_transaction->id;\n $transaction->people_id = $remote_order->business_id;\n $transaction->ledger_id = $existing_transaction->ledger_id;\n $transaction->date = $existing_transaction->date;\n $transaction->due_date = $existing_transaction->due_date;\n $transaction->transaction_type_id = $transaction_type->id;\n $transaction->payment_mode_id = $existing_transaction->payment_mode_id ;\n $transaction->tax_type = $existing_transaction->tax_type;\n $transaction->term_id = $existing_transaction->term_id;\n $transaction->pin = Custom::otp(4);\n\n $transaction->name = $remote_order->business_name;\n $transaction->mobile = $remote_order->mobile_no;\n $transaction->email = $remote_order->email_address;\n $transaction->address = $remote_order->address;\n\n $transaction->billing_name = $existing_transaction->billing_name;\n $transaction->billing_mobile = $existing_transaction->billing_mobile;\n $transaction->billing_email = $existing_transaction->billing_email;\n $transaction->billing_address = $existing_transaction->billing_address;\n\n $transaction->shipping_name = $existing_transaction->shipping_name;\n $transaction->shipping_mobile = $existing_transaction->shipping_mobile;\n $transaction->shipping_email = $existing_transaction->shipping_email;\n $transaction->shipping_address = $existing_transaction->shipping_address;\n\n $transaction->shipment_mode_id = $existing_transaction->shipment_mode_id;\n $transaction->shipping_date = $existing_transaction->shipping_date;\n $transaction->discount_is_percent = $existing_transaction->discount_is_percent;\n $transaction->discount = $existing_transaction->discount;\n $transaction->organization_id = $organization_id;\n $transaction->sub_total = $existing_transaction->sub_total;\n $transaction->total = $existing_transaction->total;\n $transaction->notification_status = 2;\n $transaction->approval_status = 1;\n /*if($transaction_type->name == \"purchases\" || $transaction_type->name == \"goods_receipt_note\") {\n $transaction->notification_status = 1;\n }*/\n $transaction->save();\n\n Custom::userby($transaction, true);\n\n $account_ledgers = AccountLedger::select('account_ledgers.id');\n\n if($transaction->user_type == 0) {\n $account_ledgers->where('person_id', $transaction->people_id);\n $person_id = $transaction->people_id;\n $business_id = null;\n } else if($transaction->user_type == 1) {\n $account_ledgers->where('business_id', $transaction->people_id);\n $person_id = null;\n $business_id = $transaction->people_id;\n }\n\n $account_ledger = $account_ledgers->first();\n\n if($account_ledger != null) {\n $customer_ledger = $account_ledger->id;\n }\n else \n {\n $impersonal_ledger = AccountLedgerType::where('name', 'impersonal')->first();\n\n $people = People::find($transaction->people_id);\n\n if($transaction_type->name == \"purchases\") {\n\n $ledgergroup = AccountGroup::where('name', 'sundry_creditor')->where('organization_id', $organization_id)->first();\n\n $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'credit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false);\n } \n else if($transaction_type->name == \"sales\") {\n\n $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first();\n\n $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false);\n }\n else if($transaction_type->name == \"job_invoice\") {\n\n $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first();\n\n $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false);\n }\n }\n\n \n if($transaction->id != null) {\n\n foreach ($existing_transaction_items as $transaction_item)\n {\n $item = new TransactionItem;\n $item->transaction_id = $transaction->id;\n $item->item_id = $transaction_item->item_id;\n $item->quantity = $transaction_item->quantity;\n $item->rate = $transaction_item->rate;\n $item->amount = $transaction_item->amount;\n $item->tax = $transaction_item->tax;\n $item->tax_id = $transaction_item->tax_id;\n $item->is_tax_percent = $transaction_item->is_tax_percent;\n $item->discount = $transaction_item->discount;\n $item->discount_id = $transaction_item->discount_id;\n $item->is_discount_percent = $transaction_item->is_discount_percent;\n $item->save();\n\n $item_account = InventoryItem::where('id', $item->item_id)->where('organization_id', $organization_id)->first();\n\n //dd($item_account);\n\n if($item->tax_id != null) {\n\n $tax_amount = json_decode($item->tax, true);\n\n foreach ($tax_amount as $tax) {\n\n $tax_value = Tax::find($tax[\"id\"]);\n\n if($transaction_type->name == \"purchases\" || $transaction_type->name == \"credit_note\") {\n //Sales Tax is expense, All expenses are debit\n //Vendor (Payables) gives the item, Credit the giver\n $entry[] = ['debit_ledger_id' => $tax_value->purchase_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $tax[\"amount\"]];\n } else if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"debit_note\" || $transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\") {\n //Sales Tax is liability, Liabilities are credit\n //Customer (Receivables) pays the tax, Debit the receiver\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $tax_value->sales_ledger_id, 'amount' => $tax[\"amount\"]];\n }\n }\n }\n\n\n if($transaction_type->name == \"purchases\") {\n\n //Item is expense, All expenses are debit\n //Vendor gives the item, Credit the giver\n\n if($item_account != null)\n {\n $entry[] = ['debit_ledger_id' => $item_account->expense_account , 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n }else{\n\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n\n }\n \n\n if($item->discount_id != null) {\n\n $discount_amount = json_decode($item->discount);\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->purchase_ledger_id;\n //Discount is income, All incomes are credit\n //Vendor loses amount on discount, All expenses are debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $discount_amount[\"amount\"]];\n }\n\n } \n else if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\") \n {\n\n //Item sale is income, All incomes are credit\n //Customer gets the item, Debit the receiver\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $item_account->income_account, 'amount' => $item->amount];\n\n if($item->discount_id != null) {\n\n $discount_amount = json_decode($item->discount);\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id;\n\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $discount_amount[\"amount\"]];\n }\n }\n\n else if($transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\") {\n\n //Item sale is income, All incomes are credit\n //Customer gets the item, Debit the receiver\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n\n if($item->discount_id != null) {\n\n $discount_amount = json_decode($item->discount);\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id;\n\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $discount_amount[\"amount\"]];\n }\n }\n\n else if($transaction_type->name == \"credit_note\") {\n\n $sale_return = AccountLedger::where('name', 'sale_return')->where('organization_id', $organization_id)->first()->id;\n //Sales Return Account Debit\n //Debtor or Customer Account Credit\n $entry[] = ['debit_ledger_id' => $sale_return, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n\n\n if($item_discount_amount != 0) {\n\n $discount_ledger = Discount::find($item->discount_id);\n\n if($discount_ledger == null) {\n $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id;\n } else {\n $discount_ledger_id = $discount_ledger->purchase_ledger_id;\n }\n //Accounts Receivable credit\n //Discount Allowed debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount];\n }\n } \n else if($transaction_type->name == \"debit_note\") \n {\n $purchase_return = AccountLedger::where('name', 'purchase_return')->where('organization_id', $organization_id)->first()->id;\n\n //Purchase Return Account Credit\n //Creditor Account Debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $purchase_return, 'amount' => $item->amount];\n\n if($item_discount_amount != 0) {\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id;\n\n if($discount_ledger_id == null) {\n $discount_ledger_id = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first()->id;\n }\n\n //Accounts Payable debit\n //Discount credit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount];\n }\n }\n }\n\n if($transaction_type->name == \"purchases\" || $transaction_type->name == \"credit_note\") {\n\n if($transaction->discount != null && $transaction->discount != 0) {\n $discount_ledger = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first();\n //Discount is income, All incomes are credit\n //Vendor loses amount on discount, All expenses are debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger->id, 'amount' => $transaction->discount];\n \n }\n\n\n } \n else if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"debit_note\") \n {\n\n if($transaction->discount != null && $transaction->discount != 0) {\n\n $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first();\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount];\n\n }\n\n }\n\n else if($transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\" || $transaction_type->name == \"debit_note\") {\n\n if($transaction->discount != null && $transaction->discount != 0) {\n\n $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first();\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount];\n\n }\n\n }\n\n\n usort($entry, function ($item1, $item2) {\n return $item1['debit_ledger_id'] - $item2['debit_ledger_id'];\n });\n\n $transaction->entry_id = Custom::add_entry($transaction->date, $entry, null, $transaction_type->name, $organization_id, 0, false);\n $transaction->save();\n \n\n if($transaction->entry_id != null) {\n\n $account_entry = AccountEntry::find($transaction->entry_id);\n\n $transaction->order_no = $account_entry->voucher_no;\n $transaction->gen_no = $account_entry->gen_no;\n $transaction->save();\n\n } else {\n\n // $gen_no = ($previous_entry != null) ? ($previous_entry->gen_no + 1) : $transaction_type->starting_value;\n $getGen_no=Custom::getLastGenNumber( $transaction_type->id, $organization_id );\n\n //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value;\n $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first();\n //dd($vou_restart_value);\n \n \n if($vou_restart_value->restart == 0)\n {\n $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value;\n Log::info(\"TransactionController->create :- after if Custom::gen_no - \".$gen_no);\n }\n else\n {\n $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no;\n Log::info(\"TransactionController->create :- after Custom::gen_no - \".$gen_no);\n }\n\n \n $transaction->order_no = Custom::generate_accounts_number($transaction_type->name, $gen_no, false);\n $transaction->gen_no = $gen_no;\n $transaction->save();\n }\n\n }\n \n\n Log::info(\"TransactionController->add_to_transaction :- Return \");\n\n\n return response()->json(['status' => 1, 'message' => $transaction_type->display_name.config('constants.flash.added'), 'data' => []]);\n\n }", "public function debitOrder(Varien_Event_Observer $observer)\n{ \n\n try {\n $arr = array(); \n$id = Mage::getModel(\"sales/order\")->getCollection()->getLastItem()->getIncrementId();\n\n$order = Mage::getModel('sales/order')->loadByIncrementId($id);\n$_grand = $order->getGrandTotal();\n$custname = $order->getCustomerName();\n//echo \"<br> cumstomer id :\".$order->getCustomerId();\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n$amt =Mage::getSingleton('checkout/session')->getDiscount();\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n$balance = Mage::getSingleton('core/session')->getBalance();\n$arr['c_id'] = $order->getCustomerId();\n$arr['action_credits'] = - $amt;\n$arr['total_credits'] = $balance;\n$arr['store_view'] = Mage::app()->getStore()->getName();\n$arr['state'] = 1;\n$arr['order_id'] = $id;\n$arr['action'] = \"Used\";\n$arr['custom_msg'] = \"By User:Using For Order \" . $arr['order_id'];\n$arr['customer_notification_status'] = 'Notified';\n$arr['action_date'] = $nowdate;\n$arr['website1'] = \"Main Website\";\n \n if($amt > 0) {\n $credits = Mage::getModel('kartparadigm_storecredit/creditinfo');\n\n $model = Mage::getModel('kartparadigm_storecredit/creditinfo')->setData($arr);\n\ntry{\n\n $model->save();\n}\ncatch(Exception $e)\n {\n\n echo $e->getMessage();\n }\n\n $successMessage = Mage::helper('kartparadigm_storecredit')->__('Credits Inserted Successfully');\n Mage::getSingleton('core/session')->addSuccess($successMessage);\n\n \n \n }else{\n //throw new Exception(\"Insufficient Data provided\");\n }\n\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirectUrl($this->_getRefererUrl());\n } \n\nMage::getSingleton('checkout/session')->unsCredits();\n Mage::getSingleton('core/session')->unsBalance();\n Mage::getSingleton('core/session')->unsCredits();\nMage::getSingleton('adminhtml/session')->unsValue();\nMage::getSingleton('checkout/session')->unsDiscount();\n \n}", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}" ]
[ "0.65115297", "0.62807757", "0.6252742", "0.6131685", "0.5787094", "0.57236725", "0.5666291", "0.5505695", "0.5498044", "0.5403388", "0.5386596", "0.537778", "0.53471005", "0.52809423", "0.52230287", "0.5206679", "0.5172531", "0.5142211", "0.5118607", "0.50916827", "0.5071117", "0.50455356", "0.5033545", "0.4995435", "0.49569616", "0.4939834", "0.49362797", "0.49101135", "0.48863155", "0.48842186", "0.48708484", "0.486914", "0.486914", "0.48329175", "0.48256359", "0.48132354", "0.4786517", "0.4785537", "0.4783116", "0.47814912", "0.47777832", "0.47743902", "0.47728172", "0.47676712", "0.4734685", "0.47330567", "0.47285733", "0.4724005", "0.47109017", "0.47072402", "0.47014385", "0.46994928", "0.46945226", "0.46818542", "0.46802625", "0.4676966", "0.46695998", "0.46628815", "0.46626937", "0.46624702", "0.46482235", "0.46463183", "0.46439764", "0.46430653", "0.464078", "0.4639224", "0.46369532", "0.46366316", "0.46303672", "0.4615821", "0.4612405", "0.4611139", "0.4610431", "0.4606699", "0.4606476", "0.46037847", "0.4596026", "0.45932972", "0.4591773", "0.45909396", "0.45875403", "0.45872638", "0.45833305", "0.4576667", "0.45723116", "0.45695218", "0.4566545", "0.456459", "0.45530152", "0.45516452", "0.45477524", "0.4536281", "0.45350286", "0.45349333", "0.45343536", "0.45343387", "0.45241335", "0.45228207", "0.45224345", "0.45162886" ]
0.45891237
80
Change approval status and if it is GRN or DN or Credit Note or Debit Note, it would affect inventory
public function transaction_status(Request $request) { Log::info("TransactionController->transaction_status :- Inside "); $organization_id = Session::get('organization_id'); $transaction = Transaction::select('transactions.*','transactions.transaction_type_id', 'transactions.mobile', 'transactions.id', 'transactions.date', 'transactions.total', DB::raw('COALESCE(transactions.reference_no, "") AS reference_no'), 'transactions.order_no', 'people.display_name', DB::raw('IF(persons.crm_code IS NULL, businesses.bcrm_code, persons.crm_code) AS code')) ->leftjoin('people', function($query){ $query->on('transactions.people_id','=','people.person_id'); $query->orWhere('transactions.people_id','=','people.business_id'); }) ->leftjoin('persons', 'people.person_id', '=', 'persons.id') ->leftjoin('businesses', 'people.person_id', '=', 'businesses.id') ->where('transactions.id', $request->id) ->first(); $business = Organization::select('businesses.alias AS business') ->leftjoin('businesses', 'businesses.id', '=', 'organizations.business_id') ->where('organizations.id', $organization_id)->first()->business; $transaction_type = AccountVoucher::find($transaction->transaction_type_id); if($transaction_type->name == "goods_receipt_note" || $transaction_type->name == "credit_note") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value')) ->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id') ->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id') ->where('tax_groups.organization_id', $organization_id) ->where('tax_groups.id', $inventory_item->purchase_tax_id) ->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); if($stock != null) { if($request->status == "1") { $inventory_stock = $stock->in_stock + $item->quantity; $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); /*$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock];*/ $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); } else if($request->status == "0") { //$inventory_stock = $stock->in_stock - $item->quantity; if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; } $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); /*$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock];*/ $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); } $stock->save(); } } } else if($transaction_type->name == "delivery_note" || $transaction_type->name == "debit_note" || $transaction_type->name == "job_invoice_cash") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->id); $inventory_item = InventoryItem::find($item->item_id); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); if($stock != null) { if($request->status == "1") { //$inventory_stock = $stock->in_stock - $item->quantity; if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; } $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); /*$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock];*/ $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); } else if($request->status == "0") { $inventory_stock = $stock->in_stock + $item->quantity; $stock->in_stock = $inventory_stock ; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock]; $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $inventory_item->purchase_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); } $stock->save(); } } } $transaction->approval_status = $request->status; $transaction->save(); $business_name = Session::get('business'); if($transaction->approval_status == 1) { if($transaction_type->name == "receipt" || $transaction_type->name == "purchase_order" || $transaction_type->name == "sale_order" || $transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "delivery_note" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { switch ($transaction_type->name) { case 'receipt': $message = "Dear ".$transaction->display_name.",". "\n\n" ."Payment of Rs. ".$transaction->total." on 11-May-18 for the Invoice ".$transaction->order_no." has been received.". "\n\n" ."Thanks for choosing ".$business_name. "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'purchase_order': $message = "You have a new order from My Company for Rs. ".$transaction->total. "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'sale_order': $message = "Dear ".$transaction->display_name.",". "\n\n" ."your purchase order has been confirmed. Order ref:".$transaction->order_no." Amount: Rs.".$transaction->total. "\n\n" ."Thanks for choosing ".$business_name. "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'sales': $message = "Dear ".$transaction->display_name.",". "\n\n" ."Thanks for choosing PropelSoft. Invoice with Ref:1236 for Rs. ".$transaction->total." has been created on 11-May-18.". "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'sales_cash': $message = "Dear ".$transaction->display_name.",". "\n\n" ."Your Payment of Rs. ".$transaction->total." has been received for the Invoice ".$transaction->order_no."". "\n\n" ."Thanks for choosing ".$business_name. "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'job_invoice': $message = "Dear ".$transaction->display_name.",". "\n\n" ."Thanks for choosing PropelSoft. Invoice for Rs. ".$transaction->total." has been created on Today.". "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'job_invoice_cash': $message = "Dear ".$transaction->display_name.",". "\n\n" ."Your Payment of Rs. ".$transaction->total." has been received for the Invoice ".$transaction->order_no."". "\n\n" ."Thanks for choosing ".$business_name. "\n\n" ."Your Propel ID: ".$transaction->code; break; case 'delivery_note': $message = "Dear ".$transaction->display_name.",". "\n\n" ."Your order for ".$transaction->reference_no. " of Rs. ".$transaction->total." has been delivered. Ref: ".$transaction->order_no. "\n\n" ."Thanks for choosing ".$business_name. "\n\n" ."Your Propel ID: ".$transaction->code; break; } if($transaction->mobile != "") { //$this->dispatch(new SendSms(config('constants.sms.user'), config('constants.sms.pass'), config('constants.sms.sender'), $transaction->mobile, $message)); //$this->dispatch(new SendTransactionEmail()); //Custom::send_transms(config('constants.sms.user'), config('constants.sms.pass'), config('constants.sms.sender'), $transaction->mobile, $message); } } } if($transaction->entry_id != null) { $entry = AccountEntry::find($transaction->entry_id); $entry->status = $request->status; $entry->save(); } Log::info("TransactionController->transaction_status :- Return "); return response()->json(array('result' => 'Success')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function approve() {\n\n }", "protected function _setApprovedFlag()\n {\n $user = $this->getUser();\n\n if (!empty($user['id'])) {\n $settings = $this->getSettings();\n if ($settings['enable_listings_approval']) {\n return 0;\n }\n else if ($user['listing_approval']) {\n return 0;\n }\n }\n\n return 1;\n }", "public function change_seller_request(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$mode = $this->uri->segment(4,0);\r\n\t\t\t$user_id = $this->uri->segment(5,0);\r\n\t\t\t$status = ($mode == '0')?'Rejected':'Approved';\r\n\t\t\t$newdata = array('status' => $status);\r\n\t\t\t\r\n\t\t\t$condition = array('id' => $user_id);\r\n\t\t\t$this->seller_model->update_details(STORE_CLAIMS,$newdata,$condition);\r\n\t\t\t$this->setErrorMessage('success','Claim Request '.$status.' Successfully');\r\n\t\t\tredirect('admin/seller/display_seller_requests');\r\n\t\t}\r\n\t}", "function changeApprovalStatus($opm_productid,$action,$userid = 0) {\n \n \t$this->load->model('approvalstatus_model');\n \t\n \t$this->opm->setLastModified($opm_productid);\n\t\n\t\t// first check that user has approval/rejection rights on this product.\n\t\t\n\t\t$product = $this->products_model->fetchProductInfo($opm_productid);\n\t\t\n\t\t$canApprove = false;\n\t\t\n\t\tforeach ($product->approvalInfo as $ai) {\n\t\t\n\t\t\tif ($ai->userid == $this->userinfo->userid)\n\t\t\t\t$canApprove = true;\n\t\t\n\t\t}\n\t\t\n\t\tif ($canApprove || checkPerms('can_verbally_approve') || checkPerms('can_verbally_reject')) {\n\t\t\n\t\t\tif ($action == 'approve') {\n\t\t\t\n\t\t\t\tif($this->approvalstatus_model->changeApprovalStatus($this->userinfo->userid,$opm_productid,$this->config->item('appStatusApproved'))) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Product successfully Approved!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ($action == 'reject') {\n\t\t\t\n\t\t\t\tif ($this->approvalstatus_model->changeApprovalStatus($this->userinfo->userid,$opm_productid,$this->config->item('appStatusRejected'))) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Rejection Successful!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t} else if ($action == 'verballyApprove') {\n\t\t\t\n\t\t\t\tif ($this->approvalstatus_model->changeApprovalStatus($userid,$opm_productid,$this->config->item('appStatusApproved'),true)) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Verbal Approval Successful!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ($action == 'verballyReject') {\n\t\t\t\n\t\t\t\tif ($this->approvalstatus_model->changeApprovalStatus($userid,$opm_productid,$this->config->item('appStatusRejected'),true)) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Verbal Rejection Successful!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t} else if ($action == 'undo') {\n\t\t\t\n\t\t\t\tif ($this->approvalstatus_model->changeApprovalStatus($userid,$opm_productid,0)) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Reversal Success!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ($action == 'approvewrevisions') {\n\t\t\t\t\n\t\t\t\t$this->load->model('forum_model');\n\t\t\t\t\n\t\t\t\t$postdata['revisions'] = $this->input->post('revisions');\n\t\t\t\t\n\t\t\t\tif ($postdata['revisions'] && ($postdata['revisions'] != 'Enter Revisions Here...') && ($postdata['revisions'] != 'If you have any revisions, please enter them here...')) { // set status to approve w/ revisions.\n\t\t\t\t\n\t\t\t\t\t$this->forum_model->addForumEntry($opm_productid,$this->userinfo->userid,\"REVISIONS\",$postdata['revisions']);\n\t\t\t\t\t\n\t\t\t\t\tif ($this->approvalstatus_model->changeApprovalStatus($this->userinfo->userid,$opm_productid,2,false,$postdata['revisions'])) {\n\t\t\t\t\t\n\t\t\t\t\t\t$this->opm->displayAlert(\"Approval Success!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t} else { // no revisions were sent, simply approve.\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tif($this->approvalstatus_model->changeApprovalStatus($this->userinfo->userid,$opm_productid,1)) {\n\t\t\t\t\t\n\t\t\t\t\t\t$this->opm->displayAlert(\"Product successfully Approved!\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ($action == 'resubmitwrevisions') {\n\t\t\t\t\n\t\t\t\t$this->products_model->setActiveResubmit($opm_productid,1);\n\t\t\t\t$this->approvalstatus_model->updateApprovalStatus($opm_productid);\n\t\t\t\t\n\t\t\t\t$this->load->model('forum_model');\n\t\t\t\t\n\t\t\t\t$this->opm->addHistoryItem($opm_productid, $this->userinfo->username . \" resubmitted this product with revisions\");\n\t\t\t\t\n\t\t\t\t$postdata['revisions'] = $this->input->post('revisions');\n\t\t\t\t\n\t\t\t\t$this->forum_model->addForumEntry($opm_productid,$this->userinfo->userid,\"REVISIONS\",$postdata['revisions']);\n\t\t\t\t\n\t\t\t\t// send email!\n\t\t\t\t\n\t\t\t\t$arrData['username'] = $this->userinfo->username;\n\t\t\t\t$arrData['productInfo'] = $this->products_model->fetchProductInfo($opm_productid);\n\t\t\t\t$arrData['revisions'] = $postdata['revisions'];\n\t\t\t\t$arrData['approvalstatus'] = \"Resubmitted With Revisions\";\n\t\t\t\t\n\t\t\t\t$this->opm->sendProductEmail($opm_productid,\"approval_status_changed\",$arrData);\n\t\t\t\t\n\t\t\t\t// alert user\n\t\t\t\t\t\t\t\t\n\t\t\t\t$this->opm->displayAlert(\"Revisions have been submitted!\",\"/products/view/\" . $opm_productid);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t} else if ($action == 'revisionscomplete') {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->products_model->setActiveResubmit($opm_productid,0);\n\t\t\t\t$this->approvalstatus_model->updateApprovalStatus($opm_productid);\n\n\t\t\t\t$this->opm->addHistoryItem($opm_productid,\"Revisions Completed by \" . $this->userinfo->username);\t\t\t\t\n\t\t\t\t\n\t\t\t\t$arrData['username'] = $this->userinfo->username;\n\t\t\t\t$arrData['productInfo'] = $this->products_model->fetchProductInfo($opm_productid);\n\t\t\t\t//$arrData['revisions'] = $postdata['revisions'];\n\t\t\t\t$arrData['approvalstatus'] = \"set status to Revisions Complete\";\n\t\t\t\t\n\t\t\t\t$this->opm->sendProductEmail($opm_productid,\"approval_status_changed\",$arrData);\n\n\n\t\t\t\t$this->opm->displayAlert(\"Revisions have been completed!\",\"/products/view/\" . $opm_productid);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t\n\t\t\n\t\t}\n\t\t\n\t\t\t\t\t\n\t}", "public function approveMultiple(){\n\t\t\tif(isset($_SESSION['admin_email'])){\n\t\t\t$this->model(\"AdminApproveModel\");\n\t\t\tif(isset($_POST['admin_approve_all'])){\n\t\t\t$approve_all = $this->sanitizeString($_POST['admin_approve_all']);\n\t\t\t$id = $this->sanitizeString($_POST['id']);\n\t\t\t$check_all = $this->sanitizeString($_POST['admin_check_all']);\n\t\t\tif(!empty($check_all)){\n\t\t\t\tAdminApproveModel::where('id', $id)->update(['priority'=>'Activated']);\n\t\t\t}\n\t\t}\n\t}\n\t}", "function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}", "public function approveItem()\n {\n if ($this->getItem()->getType() == \\Apprecie\\Library\\Items\\ItemTypes::EVENT) {\n if ($this->getStatus() == \\Apprecie\\Library\\Items\\ApprovalState::APPROVED) {\n return true;\n }\n\n $org = Organisation::getActiveUsersOrganisation();\n $event = Event::findFirstBy('itemId', $this->getItemId());\n\n $event->setState(\\Apprecie\\Library\\Items\\ItemState::APPROVED);\n $event->update();\n\n if (!$org->addEventToVault($event)) {\n $this->appendMessageEx($org);\n $this->logActivity('Failed xx addEventToVault() inside approve method', 'messages ' . _ms($org));\n return false;\n } //@todo gh use transaction\n\n $this->setStatus(\\Apprecie\\Library\\Items\\ApprovalState::APPROVED);\n $this->setVerifiedByUserId($this->getDI()->getDefault()->get('auth')->getAuthenticatedUser()->getUserId());\n $this->update();\n } else {\n throw new \\Phalcon\\Exception('approveItem work flow not implemented for non events');\n }\n }", "public function updateStatusProposal()\n { \n $now = Mage::getSingleton('core/date')->gmtDate(\"Y-m-d\"); \n $collection = Mage::getModel('qquoteadv/qqadvcustomer')->getCollection();\n $collection->addFieldToFilter('status', Ophirah_Qquoteadv_Model_Status::STATUS_PROPOSAL);\n $collection->getSelect()->where('expiry < \\''.$now.'\\' AND no_expiry = \\'0\\'');\n $collection->load(); \n\n foreach ($collection as $item) { \n $item->setStatus(Ophirah_Qquoteadv_Model_Status::STATUS_PROPOSAL_EXPIRED);\n $item->save(); \n }\n }", "public function approve(Req $request, $id)\n\t{\n\n\t\t$bookReq = BookRequest::findOrFail($id);\n\t\t$property = Property::findOrFail($bookReq->property_id);\n\t\tif($property->property_type == 'apartment'){\n\t\t\t\n\t\t}\n\t\t$bookReq->status = 1;\n\t\t$bookReq->save();\n\t\tMail::send('emails.requestAccepted',['email'=>$data['email'],\n\t\t\t\t\t\t\t\t\t 'name'=>$data['name'],\n\t\t\t\t\t\t\t\t\t 'body'=>$data['body']], \n\t\tfunction($message) use($data)\n\t\t{\n\t\t $message->to('[email protected]', $data['name'])->subject($data['name'].' question');\n\t\t});\t\n\n\n\t}", "public function approveByUser() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n $this->admin_id = NULL;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n \n return $this->save(false);\n }", "public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function approve()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->approve($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }", "public function approve()\n {\n // Make sure that all necessary payment plugins are loaded at this point.\n $this->getDi()->plugins_payment->loadEnabled();\n if ($this->isConfirmed())\n return true;\n $old_status = $this->is_confirmed;\n $this->is_confirmed = self::IS_CONFIRMED_CONFIRMED;\n\n $this->updateSelectedFields('is_confirmed');\n $saved = array();\n foreach ($this->data()->getAll() as $k => $v) {\n if (strpos($k, self::SAVED_TRANSACTION_KEY) !== false) {\n list(, $time, $payment_id) = explode('-', $k);\n $saved[$time] = array($payment_id, $v);\n }\n }\n ksort($saved);\n foreach ($saved as $time => $v) {\n $this->addAccessPeriod($v[1], $v[0] ? $v[0] : null);\n $this->data()->set(self::SAVED_TRANSACTION_KEY . '-' . $time . '-' . $v[0], null)->update();\n }\n if ($old_status == self::IS_CONFIRMED_NOT_CONFIRMED)\n {\n $this->sendApprovedEmail();\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_APPROVE, array('invoice' => $this));\n }\n return true;\n }", "public function actionApprove($id){\n $model = $this->findModel($id);\n \n if ($model->status_listing == 1){\n $model->status_listing = 5;\n \n if ($model->save()){\n return 'success';\n }\n \n }else{\n return 'Not Valid for Approve';\n }\n }", "public function approval_status($status){\n\t\tif($status == 'W' || $status == 'R'){\n\t\t\t$st = 'Pending';\n\t\t}elseif($status == 'A'){\t\n\t \t\t$st = 'Approved';\n\t\t}\n\t\treturn $st;\n\t}", "public function approveUnapprove(Request $request){\n $status = DB::table($request->table)->where('id', $request->id)->first();\n\n $field = ($request->field) ? $request->field : 'status';\n //check number(1) or string(active)\n $value_type = is_numeric($status->$field) ? 1 : 'active';\n\n if(is_numeric($status->$field)){\n $value = ($status->$field == 1) ? 0 : 1;\n }else{\n $value = ($status->$field == 'active') ? 'unapprove' : 'active';\n }\n if($status){\n if($status->$field == $value_type){\n DB::table($request->table)->where('id', $request->id)->update([$field => $value]);\n }else{\n DB::table($request->table)->where('id', $request->id)->update([$field => $value]);\n }\n $output = array( 'status' => true, 'message' => ' Approve successful.');\n }else{\n $output = array( 'status' => false, 'message' => 'Sorry can\\'t approve.!');\n }\n return response()->json($output);\n }", "public function approveItem(Request $request)\n {\n $user = auth()->user();\n $returnResult = [];\n $success = false;\n $quoteItem = \\App\\QuoteItem::find($request->id);\n $quoteUser = \\App\\Quote::find($quoteItem->quote_id)->users;\n if ($user->organization_id == $quoteUser->organization_id) {\n if ($request->invoice === \"true\") {\n $quoteItem->invoice = 1;\n } else {\n $quoteItem->invoice = 0;\n }\n if ($quoteItem->save()) {\n $success = true;\n $returnResult['message'] = 'Success';\n } else {\n $returnResult['message'] = 'An internal server erros has ocurred, please contact your administrator';\n }\n } else {\n $returnResult['message'] = 'You have no permissions on this record';\n }\n return response()->json(array('success' => $success, 'data'=>$returnResult));\n }", "public function approve($gdpr_info) {\n $this->load->model('localisation/language');\n\n $language_info = $this->model_localisation_language->getLanguage($gdpr_info['language_id']);\n\n if ($language_info) {\n $language_code = $language_info['code'];\n } else {\n $language_code = $this->config->get('config_language');\n }\n\n $language = new Language($language_code);\n $language->load($language_code);\n $language->load('mail/gdpr_approve');\n\n if ($this->config->get('config_logo')) {\n $data['logo'] = html_entity_decode($this->config->get('config_logo'), ENT_QUOTES, 'UTF-8');\n } else {\n $data['logo'] = '';\n }\n\n $data['text_request'] = $language->get('text_request');\n\n $this->load->model('customer/customer');\n\n $customer_info = $this->model_customer_customer->getCustomerByEmail($gdpr_info['email']);\n\n if ($customer_info) {\n $data['text_hello'] = sprintf($language->get('text_hello'), html_entity_decode($customer_info['firstname'], ENT_QUOTES, 'UTF-8'));\n } else {\n $data['text_hello'] = sprintf($language->get('text_hello'), $language->get('text_user'));\n }\n\n $data['text_gdpr'] = sprintf($language->get('text_gdpr'), $this->config->get('config_gdpr_limit'));\n $data['text_q'] = $language->get('text_q');\n $data['text_a'] = sprintf($language->get('text_a'), $this->config->get('config_gdpr_limit'));\n $data['text_delete'] = $language->get('text_delete');\n $data['text_thanks'] = $language->get('text_thanks');\n\n $this->load->model('setting/store');\n\n $store_info = $this->model_setting_store->getStore($gdpr_info['store_id']);\n\n if ($store_info) {\n $data['store_name'] = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8');\n $data['store_url'] = $store_info['url'];\n } else {\n $data['store_name'] = html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8');\n $data['store_url'] = HTTPS_CATALOG;\n }\n\n $mail = new Mail($this->config->get('config_mail_engine'));\n $mail->parameter = $this->config->get('config_mail_parameter');\n $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');\n $mail->smtp_username = $this->config->get('config_mail_smtp_username');\n $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');\n $mail->smtp_port = $this->config->get('config_mail_smtp_port');\n $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');\n\n $mail->setTo($gdpr_info['email']);\n $mail->setFrom($this->config->get('config_email'));\n $mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));\n $mail->setSubject(html_entity_decode(sprintf($language->get('text_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8'));\n $mail->setHtml($this->load->view('mail/gdpr_approve', $data));\n $mail->send();\n }", "public function approval()\n\t\t{\n\t\t\t$post \t\t\t\t\t\t\t\t\t= $this->input->post();\n\t\t\t$this->id_annual_leave\t\t\t\t\t= $post['id_annual_leave'];\n\t\t\t$this->annual_leave_code\t\t\t\t= $post['annual_leave_code'];\n\t\t\t$this->employee_code \t\t\t\t\t= $post['employee_code'];\n\t\t\t$this->date_of_application \t\t\t\t= $post['date_of_application'];\n\t\t\t$this->nik \t\t\t\t\t\t\t\t= $post['nik'];\n\t\t\t$this->rdo \t\t\t\t\t\t\t= $post['rdo'];\n\t\t\t$this->leave_taken \t\t\t\t\t\t= $post['leave_taken'];\n\t\t\t$this->leave_period \t\t\t\t\t= $post['leave_period'];\n\t\t\t$this->leave_start_date \t\t\t\t= $post['leave_start_date'];\n\t\t\t$this->leave_end_date \t\t\t\t\t= $post['leave_end_date'];\n\t\t\t$this->assignment_delegation\t\t\t= $post['assignment_delegation'];\n\t\t\t$this->delegation_position \t\t\t\t= $post['delegation_position'];\n\t\t\t$this->explanation \t\t\t\t\t\t= $post['explanation'];\n\t\t\t$this->checker1 \t\t\t\t\t\t= $post['checker1'];\n\t\t\t$this->status_checker1 \t\t\t\t\t= $post['status_checker1'];\n\t\t\t$this->checker1_comment\t\t\t\t\t= $post['checker1_comment'];\n\t\t\t$this->checker2 \t\t\t\t\t\t= $post['checker2'];\n\t\t\t$this->status_checker2 \t\t\t\t\t= $post['status_checker2'];\n\t\t\t$this->checker2_comment\t\t\t\t\t= $post['checker2_comment'];\n\t\t\t\n\n\t\t\t$this->db->update('ms_annual_leave', $this, array('annual_leave_code'=>$post['annual_leave_code']));\n\t\t}", "public function updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "function update_promoter_guest_list_set_auto_approve(){\n\t\t\n\t\tif(!$pgla_id = $this->CI->input->post('pgla_id')){\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'pgla_id not set');\n\t\t}\n\t\t\n\t\tif(!$auto_approve = $this->CI->input->post('auto_approve')){\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'auto_approve not set');\n\t\t}\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->update_promoter_guest_list_set_auto_approve($pgla_id, $auto_approve, $this->promoter->up_id);\n\t}", "public function change_seller_status(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$mode = $this->uri->segment(4,0);\r\n\t\t\t$user_id = $this->uri->segment(5,0);\r\n\t\t\t$store_id = $this->uri->segment(6,0);\r\n\t\t\t$status = ($mode == '0')?'Rejected':'Approved';\r\n\t\t\t$newdata = array('status' => $status);\r\n\t\t\t$condition = array('id' => $user_id);\r\n\t\t\t\r\n\t\t\t$rej_status=array('status' => 'rejected');\r\n\t\t\t$condition3=array('store_id'=>$store_id);\r\n\t\t\t\r\n\t\t\t$this->seller_model->update_details(STORE_CLAIMS,$rej_status,$condition3);\r\n\t\t\t\r\n\t\t\t$this->seller_model->update_details(STORE_CLAIMS,$newdata,$condition);\r\n\t\t\t\r\n\t\t\t$condition1 = array('store_id' => $store_id);\r\n\t\t\t$condition2 = array('id' => $store_id);\r\n\t\t\t\r\n\t\t\t//$this->data['approvedDetails'] = $this->seller_model->get_all_details(STORE_CLAIMS,$condition1);\r\n\t\t\t\r\n\t\t\t//print_r($condition);\r\n\t\t\t\r\n\t\t\t$this->data['approvedDetails'] = $this->seller_model->get_all_details(STORE_CLAIMS,$condition);\r\n\t\t\t\r\n\t\t\t$newdata1 = array(\r\n\t 'store_name' => $this->data['approvedDetails']->row()->store_name,\r\n\t\t\t\t 'user_id' => $this->data['approvedDetails']->row()->user_id,\r\n\t\t\t\t 'description' => $this->data['approvedDetails']->row()->description\r\n\t\t\t\t );\t\t \r\n\t\t\t//print_r($newdata1); exit;\r\n\t\t\t$this->seller_model->update_details(SHOPS,$newdata1,$condition2);\r\n\t\t\t$this->setErrorMessage('success','Claim Status Changed Successfully');\r\n\t\t\t//redirect('admin/seller/display_seller_list');\r\n\t\t\tredirect('admin/seller/display_seller_requests');\r\n\t\t}\r\n\t}", "public function approve_xtra_req($comment, $status, $days, $req_id, $user_id1){\r\n\t\r\n\t$date = date('Y/m/d');\r\n\t$usr_id = ($user_id1 != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($user_id1).\"'\":'NULL';\r\n\t$comm = ($comment != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($comment).\"'\":'NULL';\r\n\t$stat = ($status != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($status).\"'\":'NULL';\r\n\t$days_num = ($days != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($days).\"'\":'NULL';\r\n\t$id = ($req_id != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($req_id).\"'\":'NULL';\r\n\t$dates = ($date != NULL)?\"'\".$this->hrm_mysql_connect->real_escape_string($date).\"'\":'NULL';\r\n\tif($status==3){\r\n\t$sql = $this->hrm_mysql_connect->query(\"UPDATE xtra_days_requests SET comment=$comm, status=$stat, date_reviewed=$dates WHERE id=$id\");\r\n\t$sql2 = $this->hrm_mysql_connect->query(\"UPDATE leave_instance_2018 SET compensatory_leave=compensatory_leave+$days_num WHERE user_id=$usr_id\");\r\n\t}else{\r\n\t\t$sql = $this->hrm_mysql_connect->query(\"UPDATE xtra_days_requests SET comment=$comm, status=$stat, date_reviewed=$dates WHERE id=$id\");\r\n\t\t}\r\n\tif($sql){\r\n\t\t\t\t$data = '<div class=\"alert alert-success\"><a class=\"close\" data-dismiss=\"alert\">×</a>'.'Request succesfully Accepted'.'</div>';\r\n\t\t\t\t} else{\r\n\t\t\t\t\t$data = mysql_error().'<div class=\"alert alert-danger\"><a class=\"close\" data-dismiss=\"alert\">×</a>'.'Request not processed, contact I.T for support'.'</div>';\r\n\t\t\t\t\t}\r\n\t\t\treturn $data;\r\n\t}", "function __approve_purchase($id) {\n\t\treturn $this -> db -> query('update purchase_order_tab set pstatus=3 where pid=' . $id);\n\t}", "public function updateStatus() {\n $ref = ORM::forTable('referrals')\n ->findOne($this->data['id']);\n if ($this->data['status'] == 'Assigned' && $this->data['route_id']) {\n $route = ORM::forTable('estimate_routes')\n ->findOne($this->data['route_id']);\n $assignedReferralsCount = ORM::forTable('referrals')\n ->select('id')\n ->where('route_id', $route->id)\n ->count();\n $ref->route_id = $this->data['route_id'];\n $ref->status = 'Assigned';\n $ref->route_order = $assignedReferralsCount;\n\n } elseif ($this->data['status'] == 'Pending') {\n $ref->status = 'Pending';\n $ref->route_order = 0;\n $ref->route_id = NULL;\n } else {\n $ref->status = $this->data['status'];\n }\n if ($ref->save()) {\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request status updated successfully'\n ]);\n } else {\n $this->renderJson([\n 'success' => false,\n 'message' => 'An error has occurred while saving job request'\n ]);\n }\n }", "function approve()\r\n\t{\r\n\t\tJRequest::checkToken() or jexit('Invalid Token');\r\n\t\t\r\n\t\t// Get the selected items\r\n\t\t$cid = JRequest::getVar('cid', array(0), 'post', 'array');\r\n\t\t\r\n\t\t$total = count($cid);\r\n\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_APPROVED', $total);\r\n\t\t\r\n\t\t// Force array elements to be integers\r\n\t\tJArrayHelper::toInteger($cid, array(0));\r\n\t\t\r\n\t\t$msg = '';\r\n\t\t\r\n\t\t// No items are selected\r\n\t\tif (!is_array($cid) || count($cid) < 1)\r\n\t\t\tJError::raiseWarning(500, JText::_('SELECT ITEM'));\r\n\t\telse\r\n\t\t{\r\n\t\t\t$user =& JFactory::getUser();\r\n\t\t\t$user_id = $user->get('username');\r\n\t\t\tforeach ($cid as $id)\r\n\t\t\t{\r\n\t\t\t\tRSMembership::saveTransactionLog('Manually approved by '.$user_id, $id);\r\n\t\t\t\tRSMembership::approve($id);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$total = count($cid);\r\n\t\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_APPROVED', $total);\r\n\t\t\t\r\n\t\t\t// Clean the cache, if any\r\n\t\t\t$cache =& JFactory::getCache('com_rsmembership');\r\n\t\t\t$cache->clean();\r\n\t\t}\r\n\t\t\r\n\t\t$this->setRedirect('index.php?option=com_rsmembership&view=transactions', $msg);\r\n\t}", "public function setProductApproval($productApproval, $product, $productData, $productId) {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n $product = $objectManager->create ( 'Magento\\Catalog\\Model\\Product' )->load ( $productId );\n if ($productApproval == 1) {\n $product->setStatus ( 1 );\n $product->setProductApproval(1);\n \n } else {\n $product->setProductApproval ( 0 );\n $product->setStatus(2);\n }\n \n $product->save();\n }", "function approvedAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n if (!$arrangementProgramManager->isAllowToApprove($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n\n if ($arrangementProgramManager->isYouCanApprove($resource) === true) {\n $resource->setStatus(ArrangementProgram::STATUS_APPROVED);\n\n $user = $this->getUser();\n $details = $resource->getDetails();\n $details\n ->setApprovedBy($user)\n ->setApprovalDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_approved', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'approved');\n\n// $this->domainManager->dispatchEvent('post_approved', new ResourceEvent($resource));\n } else {\n $this->flashHelper->setFlash('error', 'planned_not_complete');\n }\n\n return $this->redirectHandler->redirectTo($resource);\n }", "public function approve_request($id) {\r\n\t\treturn $this->db->update('orders', [\r\n\t\t\t'_assigned_staff'=>$this->input->post('staff'), \r\n\t\t\t'price'=>$this->input->post('amount'), \r\n\t\t\t'_status' => STATUS_PENDING_PAYMENT], ['_id' => $id]);\r\n\t}", "public function approve_swap($data){\n $query = $this->db->query('UPDATE swap_reqs SET swap_status=\"Completed\", `end_time`=CURRENT_TIMESTAMP WHERE swap_UID= \"'.$data['swap_UID'].'\" ');\n //this will make book 1 unavailable\n $query = $this->db->query('UPDATE user_books SET `availability`=0 WHERE `UID`=\"'.$data['b1_UID'].'\" ');\n //this will make book 2 unavailable\n $query = $this->db->query('UPDATE user_books SET `availability`=0 WHERE `UID`=\"'.$data['b2_UID'].'\" ');\n }", "function update_organiser_status(){\r\n\t\t$this->organiser_model->update_organiser_status($_POST['status'],$_POST['organiser_id']);\r\n\t\t$this->send_status_email($_POST['status'],$_POST['organiser_id']);\r\n\t\techo \"1\";exit;\r\n\t}", "public function change_review_status(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}else {\n\t\t\t$mode = $this->uri->segment(4,0);\n\t\t\t$user_id = $this->uri->segment(5,0);\n\t\t\t$status = ($mode == '0')?'Inactive':'Active';\n\t\t\t$newdata = array('status' => $status);\n\t\t\t$condition = array('id' => $user_id);\n\t\t\t//echo $status;die;\n\t\t\tif($status=='Active'){\n\t\t\t\t$GetReviewDetails=$this->review_model->get_all_details(REVIEW,$condition);\n\t\t\t\t\n\t\t\t\tif($GetReviewDetails->row()->user_id > 0 && $GetReviewDetails->row()->user_id != ''){\n\t\t\t\t\t$GetUserDetails=$this->review_model->get_all_details(USERS,array('id' => $GetReviewDetails->row()->user_id));\n\t\t\t\t\t$GetRentalDetails=$this->review_model->get_all_details(PRODUCT,array('id' => $GetReviewDetails->row()->product_id));\n\t\t\t\t\tif($GetUserDetails->row()->email != ''){\n\t\t\t\t\t\t$newsid='15';\n\t\t\t\t\t\t$template_values=$this->review_model->get_newsletter_template_details($newsid);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$subject = 'From: '.$this->config->item('email_title').' - '.$template_values['news_subject'];\n\t\t\t\t\t\t$adminnewstemplateArr=array('email_title'=> $this->config->item('email_title'),'logo'=> $this->data['logo'],'title'=>$GetReviewDetails->row()->title,'review'=>$GetReviewDetails->row()->review,'rateVal'=>$GetReviewDetails->row()->rateVal,'email_id'=>$GetReviewDetails->row()->email,'nickname'=>$GetReviewDetails->row()->nickname,'full_name'=>$GetReviewDetails->row()->full_name,'date_arrival'=>$GetReviewDetails->row()->date_arrival,'location'=>$GetReviewDetails->row()->location,'user_type'=>$GetReviewDetails->row()->user_type,'rental_id'=>$GetReviewDetails->row()->product_id,'rental_name'=>$GetRentalDetails->row()->product_name,'user_id'=>$GetReviewDetails->row()->user_id,'reviewer_id'=>$GetReviewDetails->row()->reviewer_id,'owner_name'=>ucfirst($GetUserDetails->row()->first_name));\n\t\t\t\t\t\textract($adminnewstemplateArr);\n\t\t\t\t\t\t//$ddd =htmlentities($template_values['news_descrip'],null,'UTF-8');\n\t\t\t\t\t\t$header .=\"Content-Type: text/plain; charset=ISO-8859-1\\r\\n\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$message .= '<!DOCTYPE HTML>\n\t\t\t\t\t\t\t<html>\n\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width\"/><body>';\n\t\t\t\t\t\tinclude('./newsletter/registeration'.$newsid.'.php');\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$message .= '</body>\n\t\t\t\t\t\t\t</html>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($template_values['sender_name']=='' && $template_values['sender_email']==''){\n\t\t\t\t\t\t\t$sender_email=$this->data['siteContactMail'];\n\t\t\t\t\t\t\t$sender_name=$this->data['siteTitle'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t\t\t\t\t$sender_email=$template_values['sender_email'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//add inbox from mail \n\t\t\t\t\t\t$this->review_model->simple_insert(INBOX,array('sender_id'=>$sender_email,'user_id'=>$GetUserDetails->row()->email,'mailsubject'=>$subject,'description'=>stripslashes($message)));\n\t\t\t\t\n\t\t\t\t\t\t$email_values = array('mail_type'=>'html',\n\t\t\t\t\t\t\t\t\t\t\t'from_mail_id'=>$sender_email,\n\t\t\t\t\t\t\t\t\t\t\t'mail_name'=>$sender_name,\n\t\t\t\t\t\t\t\t\t\t\t'to_mail_id'=>$GetUserDetails->row()->email,\n\t\t\t\t\t\t\t\t\t\t\t'subject_message'=>$template_values['news_subject'],\n\t\t\t\t\t\t\t\t\t\t\t'body_messages'=>$message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$email_send_to_common = $this->review_model->common_email_send($email_values);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->review_model->update_details(REVIEW,$newdata,$condition);\n\t\t\t$this->setErrorMessage('success','Review Status Changed Successfully');\n\t\t\tredirect('admin/review/display_review_list');\n\t\t}\n\t}", "public function actionApprove(){\n \t// Set no waiting limit\n \tset_time_limit(0);\n \t// REST client is flash app\n \t$this->restFlashClient = true;\n \t\n \tif (!isset($_POST['userJobId']) || !isset($_POST['approved'])){\n \t\t$this->_sendResponse(\"Approval workflow has failed. Missing userJobId or approval status\", 400);\n \t\treturn;\n \t}\n \t\t\n \t$userJobId = $_POST['userJobId'];\n \t$approved = $_POST['approved'] == 'false' ? false : true;\n \t\n \t// Get UserJob object\n \t$userJob = PUserJob::model()->findByPk($userJobId);\n \t\n \t/* \n \t * Send bad request in case the provided $userJobId does not exist.\n \t */\n \tif(!$userJob instanceof PUserJob){\n \t\t$this->_sendResponse(\"The job with id '{$userJobId}' does not exist in database.\", 400);\n \t}\n \t\n \tif($this->taskWorkflowAPI()->setProjectJobId($userJob->projectJob->id)->validate()) {\n \t\t// Start delivery\n \t\t$this->taskWorkflowAPI()->deliver();\n \t\t\n \t\t// Add breakdown report about task delivery\n \t\t$mainAPI = $this->mainAPI();\n \t\t$mainAPI->projectBreakdownByUserJob($mainAPI::PBR_TASK_DELIVERED, $userJob->id);\n \t\t$mainAPI->sferaAPIByProject($userJob->projectJob->project_id);\n \t\t\n \t\t// mark parent job as disapproved\n \t\tif ($approved == false){\n \t\t\t$mainProjectJob = PProjectJob::model()->findByPk($userJob->projectJob->id)->getMainJob();\n \t\t\tYii::app()->projectAPI->markAsDisapproved($mainProjectJob->id);\n \t\t\t\n \t\t\t//TODO send mail\n \t\t}\t\n \t\t\n \t\t// Send successful response\n \t\t$this->_sendResponse('Approval has been done successfully.');\n \t}\n \telse{\n \t\t// Send failure response\n \t\t$this->_sendResponse(\"Approval workflow has failed.\", 400);\n \t}\n }", "public function markAsPaid() {\n $this->status = parent::STATUS_PAID;\n $this->admin_id = Yii::app()->user->getId();\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function approve()\n {\n // Initialize variables\n $cid = JRequest::getVar('cid', array(), 'post', 'array');\n $task = JRequest::getCmd('task');\n $publish = ($task == 'approve');\n\n if(empty($cid))\n {\n $this->setRedirect($this->_ambit->getRedirectUrl(), JText::_('COM_JOOMGALLERY_COMMAN_MSG_NO_COMMENTS_SELECTED'));\n $this->redirect();\n }\n\n $model = $this->getModel('comments');\n if($count = $model->publish($cid, $publish, 'approve'))\n {\n if($count != 1){\n $msg = JText::sprintf($publish ? 'COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_APPROVED' : 'COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_REJECTED', $count);\n } else {\n $msg = JText::_($publish ? 'COM_JOOMGALLERY_COMMAN_MSG_COMMENT_APPROVED' : 'COM_JOOMGALLERY_COMMAN_MSG_COMMENT_REJECTED');\n }\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg);\n }\n else\n {\n $msg = JText::_('COM_JOOMGALLERY_COMMON_MSG_ERROR_APPROVING_REJECTING');\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg, 'error');\n }\n }", "function approve( $booking_ids ){\n\t\t$this->set_status(1, $booking_ids);\n\t\treturn false;\n\t}", "public function do_approve(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n /* for supervisours */\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 1;\n $leave->current_position = 1;\n $leave->leave_status = 1;\n $leave->leave_message = \"Approved by Supervisor, Pending HR approval\";\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'approved',\n 'comments' => 'Pending HR approval',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find($leave->supervisor_id)->display_name.\".\";\n\n $message_suppervisor = \" You have successfully approved \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application, pushed to HR for approval.\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find($leave->supervisor_id)->display_name.\".\";\n\n $message_hr = \" \".User::find($leave->user_id)->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application as supervisor (\".User::find($leave->supervisor_id)->display_name.\") has successfully approved this leave application.\";\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n //$toHr1->notify(new LeaveNotification($leave,$message_hr));\n //$toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n\n /*auth()->user()->notify(new LeaveNotification($post,$message_requester) );\n User::find($request->supervisor)->notify(new LeaveNotification($post,$message_suppervisor) );\n User::find($request->reliever)->notify(new LeaveNotification($post, $message_reliever) );*/\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have successfully approved \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n /*FOR HR APPROVAL*/\n\n\n $leave->hr_action = 1;\n $leave->current_position = 3;\n $leave->leave_status = 3;\n $leave->leave_message = \"Approved by Supervisor and HR\";\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'approved',\n 'comments' => 'Approved by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find(auth::id())->display_name.\". (HR)\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find(auth::id())->display_name.\" (HR)\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find(auth::id())->display_name.\" (HR)\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" successfully approved \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application.\";\n\n //send notification to users\n // auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have successfully approved \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application.\"]);\n\n\n\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }", "public function status_change_action(){\n\t $table = $this->input->post('table');\n\t $state = $this->input->post('state');\n\t $primary_field = $this->input->post('primary_field');\n\t $primary_key = $this->input->post('primary_key');\n\t if($state=='true'){\n\t $status = \"Y\";\n\t $status_text = \"Approved\";\n\t }else{\n\t $status = \"N\";\n\t $status_text = \"Rejected\";\n\t }\n\t $statusReturn = $this->common_model->update_row(array('fr_status'=>$status), array($primary_field=>$primary_key), $table);\n\t if($statusReturn){\n\t echo \"1\";\n\t }else{\n\t echo \"0\";\n\t }\n\t}", "public function changeStatusAjaxAction()\n\t{\n\t\t$data = $this->getRequest()->getPost();\n\t\tif($data){\n\t\t\tif($data['lb_item_status']!=\"\"){\n\t\t\t\t$order = Mage::getModel('sales/order')->load($data['order_id']);\n\t\t\t\t$orderStatus = $order->getStatus();\n\t\t\t\t$lbOrderItemInstance = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);\n\t\t\t\ttry{\n\t\t\t\t\tif($lbOrderItemInstance->count() > 0){\t\t\t\n\t\t\t\t\t\tforeach($lbOrderItemInstance as $item){\n\t\t\t\t\t\t\t$itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);\n\t\t\t\t\t\t\t$item->setLbItemStatus($data['lb_item_status']);\n\t\t\t\t\t\t\t$item->setItemStatusHistory($itemStatusHistory);\n\t\t\t\t\t\t\t$item->setUpdatedBy('User');\n\t\t\t\t\t\t\t$item->setUpdatedAt(Mage::getModel('core/date')->gmtDate());\n\t\t\t\t\t\t\t$item->save();\t\n\t\t\t\t\t\t\tif($data['lb_item_status']==$item->getLbItemStatus()){\n\t\t\t\t\t\t\t\t$data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];\n\t\t\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($data['msg']));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];\n\t\t\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__($data['msg']));\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\tif($data['lb_item_status'] == 'Transmitting'){\n\t\t\t\t\t\tMage::getModel('dropship360/logicbroker')->setupNotification();\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$result = Mage::helper('core')->jsonEncode($data);\n\t\t\t\t\tMage::app()->getResponse()->setBody($result);\n\t\t\t\t}catch(Exception $e){\t\t\t\n\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$data['msg'] = 'Unable to perform the required operation';\n\t\t}\t\n\t}", "public function approve(\\App\\Models\\Request $request)\n {\n $id = $request->id;\n $request = DB::table('requests')->where('id', $id);\n $request->update(['status' => 'approved']);\n\n return redirect('/profile/' . auth()->user()->id);\n }", "public function setDefaultStatus() {\n if (!$this->hasField('field_room')) {\n return;\n }\n if (!$this->get('field_room')->isEmpty()) {\n $room = $this->get('field_room')->entity;\n $approval_required = $room->field_approval_required->getString();\n\n $current_user = \\Drupal::currentUser();\n if ($current_user->hasPermission('bypass room reservation agreement')) {\n $approval_required = FALSE;\n }\n\n $current_status = $this->get('field_status')->getString();\n\n if (!$approval_required && $current_status == 'requested') {\n $this->approve();\n }\n }\n }", "public function markApproved()\n {\n $this->IsSpam = false;\n $this->Moderated = true;\n $this->write();\n $this->extend('afterMarkApproved');\n }", "public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }", "public function approve($id)\n {\n $borrow = Borrows::find($id);\n\n $borrow->status = \"approved\";\n\n $borrow->save();\n\n //push status of details of borrows to borrows_inventory\n $details = Borrows_InventoryTools::where('borrow_id', $borrow->id)->get();\n\n foreach ($details as $index => $tool) {\n $detail = Borrows_InventoryTools::find($tool->id);\n $detail->status = \"approved\";\n $detail->save();\n }\n\n \n\n return back();\n }", "public function approve( $approver )\r\n {\r\n $this->markApproved( );\r\n $this->_systemFields->setApproved( $approver );\r\n }", "public function approve($PO)\n {\n header('Content-Type: application/json');\n $this->load->model('ec_po_pl_approval_m');\n $data2=0;\n if ($this->ec_po_pl_approval_m->approve($PO)) {\n $this->load->library('sap_handler');\n $data = $this->ec_po_pl_approval_m->detailCart($PO);\n $data2 = $this->sap_handler->PO_CHANGE($PO, $data, false);\n //var_dump($data);\n if($data2==1){\n $this->ec_po_pl_approval_m->insertToShipment($data, $PO);\n }\n redirect('EC_PO_PL_Approval/index/'.$data2.'/'.$PO);\n }\n redirect('EC_PO_PL_Approval/index/'.$data2);\n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "function _erpal_crm_activity_queue_view_approve_submit (&$form, &$form_state) {\n\n if (erpal_crm_activity_queue\\ActivityQueueModel::approve($form_state['values']['result'])) {\n drupal_set_message (t('Activity elements has been successfuly approved.'));\n }else{\n drupal_set_message (t('An error occured while trying to approve some activity elements.'));\n }\n \n return;\n}", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public function approveSubmission(Request $request)\n {\n $submission = Usersubmissionstatus::find($request->id);\n\n // Getting employee id for current submission\n $employeeID = $submission->user_id;\n $submission->status_id = config('constant.status.HR_APPROVAL_PENDING');\n $status = $submission->save();\n $reviewComment = ['submission_status_id' => $request->id, 'reviewer_id' => Auth::user()->id, 'status_id' => config('constant.status.HR_APPROVAL_PENDING'), 'comment' => $request->review_comment, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()];\n if ($status == 1) {\n Submissionreviewcomment::insert($reviewComment);\n\n // Let's notify user and hr about submission approval\n $status = $this->sendMail(config('constant.email_status.L1_APPROVED'), $employeeID);\n return response()->json(['status' => 1, 'message' => 'Sucessfully Approved', 'email_status' => $status], 200);\n }\n else {\n return response()->json(['status' => 0, 'message' => 'There was an error processing your request, please try again'], 200); \n }\n }", "public function showExperienceReview()\n {\n $review_id = Input::get('review_id');\n\n $check_review = DB::select(\"select status from product_reviews where id = '$review_id'\");\n $status = $check_review[0]->status;\n if($status == \"Pending\")\n {\n $statusUpdate = \"Approved\";\n }\n else if($status == \"Approved\")\n {\n $statusUpdate = \"Pending\";\n }\n\n $update = DB::update(\"update product_reviews set status ='$statusUpdate' where id = $review_id\");\n\n echo '1';\n\n }", "public function approveTicket(Request $request)\n\t\t{\n\t\t\tif(isset($_POST['ticket_id']))\n\t\t\t{\t\n\t\t\t\t$ticket_id = $_POST['ticket_id'];\n\t\t\t\t$ins_data['status'] = 'approve';\n\t\t\t\ttickets::where('id',$ticket_id)->update($ins_data);\n\t\t\t}\n\t\t}", "private function mtii_biz_premises_approval($invoice_number_from_doc_title, $doc_id)\n {\n $result = array();\n global $mtii_biz_prem_db_main;\n $doc_info = $mtii_biz_prem_db_main->get_by('invoice_number_filled_against', $invoice_number_from_doc_title);\n $doc_info_from_cp = get_page_by_title($invoice_number_from_doc_title, OBJECT, 'mtii_biz_prem_reg');\n $doc_id_from_db = $doc_info->application_form_id;\n if ($doc_info_from_cp->ID == $doc_id) {\n $already_approved = $doc_info->is_admin_approved;\n if ($already_approved==\"Approved\") {\n $result['status'] = \"Already Approved\";\n } else {\n delete_post_meta($doc_info_from_cp->ID, 'is_admin_approved');\n update_post_meta($doc_info_from_cp->ID, 'is_admin_approved', 'Approved');\n $doc_info_array = ( array ) $doc_info;\n $doc_info_array[\"is_admin_approved\"] = \"Approved\";\n $updated_biz_premise = $mtii_biz_prem_db_main->update($doc_id_from_db, $doc_info_array);\n if ($updated_biz_premise == false) {\n $result['status'] = \"error\";\n } else {\n $tasks_performer = new TasksPerformer;\n $doc_author = $doc_info->user_id;\n $auth = get_user_by('id', $doc_author);\n $auth_id = $auth->data->ID;\n $auth_email = $auth->data->user_email;\n $f_name = get_the_author_meta('first_name', $auth_id);\n $l_name = get_the_author_meta('last_name', $auth_id);\n $full_name = $f_name.\" \".$l_name;\n $created_image_info = $this->create_biz_prem_dummy_cert_and_save_as_file($invoice_number_from_doc_title);\n if ($created_image_info && $created_image_info!=null && is_array($created_image_info)) {\n if ($created_image_info[\"success\"]) {\n $author_message = 'Congratulations '.$full_name.',<br /><br />'.\n 'Your Business Premise registration with the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been approved by the site Administrator.<br /><br />'.\n 'Attached to this email is your dummy Certificate. You should download and bring your dummy certificate '.\n 'to MTII, Nasarawa office to get your original certificate.<br /><br />'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Your Registration has been Approved!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'Business Premise Registration Approval', $mail_content, $headers, $created_image_info[\"dpath\"]);\n $result['status'] = \"success and certificate sent\";\n $result['approved'] = true;\n } else {\n $author_message = 'Congratulations '.$full_name.',<br /><br />'.\n 'Your Business Premise registration with the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been approved by the site Administrator.<br /><br />'.\n 'You are supposed to have your dummy certificate in this email but we had a problem creating and sending '.\n 'your dummy certificate. Please login to <a href=\"'.site_url().'\">Our Website</a> to print you dummy '.\n 'certificate and then bring it to MTII, Nasarawa office to get the original certificate.<br /><br />'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Your Registration has been Approved!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'Business Premise Approved without Dummy Certificate', $mail_content, $headers);\n $result['status'] = \"success but certificate not done\";\n $result['approved'] = true;\n }\n unlink($created_image_info[\"dpath\"]);\n\n } else {\n $author_message = 'Congratulations '.$full_name.',<br /><br />'.\n 'Your Business Premise registration with the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been approved by the site Administrator.<br /><br />'.\n 'You are supposed to have your dummy certificate in this email but we had a problem creating and sending '.\n 'your dummy certificate. Please login to <a href=\"'.site_url().'\">Our Website</a> to print you dummy '.\n 'certificate and then bring it to MTII, Nasarawa office to get the original certificate.<br /><br />'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Your Registration has been Approved!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'Business Premise Approved without Dummy Certificate', $mail_content, $headers);\n $result['status'] = \"success but certificate not done\";\n $result['approved'] = true;\n }\n }\n }\n } else {\n $result['status'] = \"Request Problem\";\n }\n return $result;\n }", "public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }", "public function approveCommentMethod()\n { \n $choice = $this->getGet()[\"approve\"];\n $data = [\"approved\" => (int) $choice]; \n $comment_id = (string) $this->getId();\n\n if ($choice === \"1\") {\n $message = \"Le commentaire a bien été approuvé et publié.\";\n } elseif ($choice === \"0\") {\n $message = \"Le commentaire a été refusé et ne sera pas publié.\";\n };\n\n ModelFactory::getModel(\"Comment\")->updateData($comment_id, $data);\n $this->setMessage($message);\n $this->redirect(\"user!admin\");\n }", "public function approve_pros()\n {\n $data = [ 'aktif' => 'approve_pros',\n 'data_pros' => $this->M_prospektus->get_data_pros_con()->result_array(),\n\n ];\n\n $this->template->load('template', 'kontributor/V_approve_pros', $data);\n }", "function setstatus($pr_id, $cloud_status) {\n\t\tswitch ($cloud_status) {\n\t\t\tcase 'new':\n\t\t\t\t$cr_status=1;\n\t\t\t\tbreak;\n\t\t\tcase 'approve':\n\t\t\t\t$cr_status=2;\n\t\t\t\tbreak;\n\t\t\tcase 'active':\n\t\t\t\t$cr_status=3;\n\t\t\t\tbreak;\n\t\t\tcase 'deny':\n\t\t\t\t$cr_status=4;\n\t\t\t\tbreak;\n\t\t\tcase 'deprovision':\n\t\t\t\t$cr_status=5;\n\t\t\t\tbreak;\n\t\t\tcase 'done':\n\t\t\t\t$cr_status=6;\n\t\t\t\tbreak;\n\t\t\tcase 'no-res':\n\t\t\t\t$cr_status=7;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\texit(1);\n\t\t\t\tbreak;\n\t\t}\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"update \".$this->_db_table.\" set pr_status=$cr_status where pr_id=$pr_id\");\n\n\t}", "function ihc_do_user_approve($uid=0){\n\tif ($uid){\n\t\t$data = get_userdata($uid);\n\t\tif ($data && isset($data->roles) && isset($data->roles[0]) && $data->roles[0]=='pending_user'){\n\t\t\t$default_role = get_option('default_role');\n\t\t\t$user_id = wp_update_user(array( 'ID' => $uid, 'role' => $default_role));\n\t\t\tif ($user_id==$uid){\n\t\t\t\tihc_send_user_notifications($user_id, 'approve_account');\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\treturn FALSE;\n}", "function editStatus(){\n $request = new RepairServiceModel();\n $request->RequestID = $_POST['RequestID'];\n $request->Request_Status = $_POST['Request_Status'];\n \n $request->Reason = $_POST['Reason'];\n $request->StaffID = $_POST['StaffID'];\n if($request->updateStatus()){\n $message = \"Successfully Approved This Request\" ;\n echo \"<script type='text/javascript'>alert('$message');\n window.location = '../../ApplicationLayer/RepairServiceModule/RequestList.php';</script>\";\n }\n }", "private function confirm()\n {\n // if 1, direct approve\n\n $load = $this->load;\n\n $fleetCount = $load->fleet_count;\n\n if($fleetCount > 1) {\n $loadTrips = $load->confirmed_trips()\n ->count()\n ;\n } else {\n $loadTrips = 1;\n }\n\n if($loadTrips == $fleetCount) {\n\n //@todo: send confirm notifications\n\n $load->status = Load::STATUS_CONFIRMED;\n $load->save();\n }\n\n }", "public function send_approvals() {\n if (isset($_POST['approval'])) {\n $PDO = Record::getConnection();\n\t\t\t $common = new APCommon();\n \t\t\t foreach($_POST['approval'] as $id){\n\t\t\t\t\n\t\t\t\t//Find the record in the temp table and send the confirmation email\n\t\t\t\t$sql = \"SELECT * FROM \". TABLE_PREFIX . \"approved_users_temp WHERE id=:id\";\n $stmt = $PDO->prepare($sql);\n $stmt->execute(array(\"id\" => $id));\n\t\t\t\t$row = $stmt->fetch();\n\t\t\t\t$email = $row[2];\n\t\t\t\t$name = $row[1];\n\t\t\t\t$common->confirmation_email($email, $name);\n\t\t\t\t\n\t\t\t\t//Update the temp table to mark row as processed\n $sql = \"UPDATE \" . TABLE_PREFIX . \"approved_users_temp SET processed=1 WHERE id=:id\";\n $stmt = $PDO->prepare($sql);\n $stmt->execute(array(\"id\" => $id));\n\t\t\t }\n \n \t\t\tFlash::set('success', __('Approvals processed'));\n \t\t} else {\n Flash::set('error', __('Unable to process approvals'));\n }\n\n redirect(get_url('plugin/approved_users/approvals'));\n }", "public function change_promocodes_status(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\t$mode = $this->uri->segment(4,0);\n\t\t\t$promocode_id = $this->uri->segment(5,0);\n\t\t\t$status = ($mode == '0')?'Inactive':'Active';\n\t\t\t$newdata = array('status' => $status);\n\t\t\t$condition = array('id' => $promocode_id);\n\t\t\t$this->promocodes_model->update_details(PROMOCODES,$newdata,$condition);\n\t\t\t$this->setErrorMessage('success','Promocode Status Changed Successfully');\n\t\t\tredirect(ADMIN_PATH.'/promocodes/display_promocodes');\n\t\t}\n\t}", "private function calculateRequiredApprovals() {\r\n\r\n if($this->commitments->requiresApproval() == true) {\r\n require_once('classes/tracking/approvals/Commitments.php');\r\n $this->addApproval(new \\tracking\\approval\\Commitments($this->trackingFormId));\r\n }\r\n\r\n // If the form doesn't have commitments, then we still want the Dean to review it\r\n // so we add this approval.\r\n if(!$this->commitments->requiresApproval()) {\r\n require_once('classes/tracking/approvals/DeanReview.php');\r\n $this->addApproval(new \\tracking\\approval\\DeanReview($this->trackingFormId));\r\n }\r\n\r\n if($this->COIRequiresApproval() == true) {\r\n require_once('classes/tracking/approvals/COI.php');\r\n $this->addApproval(new \\tracking\\approval\\COI($this->trackingFormId));\r\n } else {\r\n // there are no COI, but ORS still needs to review so apply ORSReview\r\n require_once('classes/tracking/approvals/ORSReview.php');\r\n $this->addApproval(new \\tracking\\approval\\ORSReview($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresBehavioural() == true) {\r\n require_once('classes/tracking/approvals/EthicsBehavioural.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsBehavioural($this->trackingFormId));\r\n }\r\n\r\n\r\n/* if($this->compliance->requiresHealth() == true) {\r\n require_once('classes/tracking/approvals/EthicsHealth.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsHealth($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresAnimal() == true) {\r\n require_once('classes/tracking/approvals/EthicsAnimal.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsAnimal($this->trackingFormId));\r\n }\r\n\r\n require_once('classes/tracking/approvals/EthicsBiohazard.php');\r\n if($this->compliance->requiresBiohazard() == true) {\r\n $this->addApproval(new \\tracking\\approval\\EthicsBiohazard($this->trackingFormId));\r\n }*/\r\n }", "public function process_adv($adv_id, $st_id, $status,$user_id){ \n\t\t$data = array('modified_date' => $this->Functions->get_current_date(), 'modified_by' => $this->Session->read('USER.Login.id'), 'remarks' => $this->request->query['remark'], 'status' => $status);\n\t\t$this->FinAdvApprove->FinAdvStatus->id = $st_id;\n\t\t$st_msg = $status == 'A' ? 'approved' : 'rejected';\n\t\t// make sure not duplicate status exists\n\t\t$this->check_duplicate_status($adv_id, $this->Session->read('USER.Login.id'), 1);\n\t\t// save the finance adv. status\n\t\tif($this->FinAdvApprove->FinAdvStatus->save($data, true, $fieldList = array('modified_by','modified_date','remarks','status'))){\n\t\t\t// get user data\n\t\t\t$user_data = $this->FinAdvApprove->Home->find('first', array('conditions' => array('Home.id' => $user_id),'fields' => array('email_address','first_name', 'last_name')));\n\t\t\t// get advance details\n\t\t\t$req_data = $this->FinAdvApprove->findById($adv_id, array('fields' => 'amount','purpose', 'req_date', 'description','TskCustomer.company_name'));\n\t\t\t$vars = array('name' => $user_data['Home']['first_name'].' '.$user_data['Home']['last_name'], 'purpose' => $req_data['FinAdvApprove']['purpose'], 'desc' => $req_data['FinAdvApprove']['description'], 'amt' => $req_data['FinAdvApprove']['amount'], 'remarks' => $this->request->query['remark'], 'status' => $st_msg, 'req_date' => $req_data['FinAdvApprove']['req_date'],'employee' => $user_data['Home']['first_name'].' '.$user_data['Home']['last_name'],'client' => $req_data['TskCustomer']['company_name']);\n\t\t\t// notify employee\t\t\t\t\t\t\n\t\t\tif(!$this->send_email('My PDCA - Your advance request is '.$st_msg.' by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name')), 'notify_advance', '[email protected]', $user_data['Home']['email_address'],$vars)){\t\t\n\t\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in sending the mail to user...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t\t}else{\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t// get the superiors\n\t\t\t$this->loadModel('Approval');\n\t\t\t// if record approved\n\t\t\tif($status == 'A'){\t\t\t\t\t\n\t\t\t\t$approval_data = $this->Approval->find('first', array('fields' => array('level2','auth_amount_l2'), 'conditions'=> array('Approval.app_users_id' => $user_id, 'type' => 'A')));\n\t\t\t\t// make sure level 2 is not empty\n\t\t\t\tif(!empty($approval_data['Approval']['level2'])){\n\t\t\t\t\t// check level 2 is not empty and its not the same user\n\t\t\t\t\tif($approval_data['Approval']['level2'] != $this->Session->read('USER.Login.id')){ \t\n\t\t\t\t\t\t// get superior level 2 details\t\t\t\t\n\t\t\t\t\t\t$superior_data = $this->FinAdvApprove->Home->find('first', array('conditions' => array('Home.id' => $approval_data['Approval']['level2']),'fields' => array('email_address','first_name', 'last_name')));\n\t\t\t\t\t\t$data = array('fin_advance_id' => $adv_id, 'created_date' => $this->Functions->get_current_date(), 'app_users_id' => $approval_data['Approval']['level2']);\n\t\t\t\t\t\t// save leve 2 if found\n\t\t\t\t\t\t$this->FinAdvApprove->FinAdvStatus->id = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// make sure not duplicate status exists\n\t\t\t\t\t\t$this->check_duplicate_status($adv_id, $approval_data['Approval']['level2'], 0);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($this->FinAdvApprove->FinAdvStatus->save($data, true, $fieldList = array('fin_advance_id','created_date','app_users_id'))){\t\n\t\t\t\t\t\t\t$this->check_duplicate_user($adv_id, $approval_data['Approval']['level2']);\n\t\t\t\t\t\t\t// save adv. users\n\t\t\t\t\t\t\t$adv_user_data = array('fin_advance_id' => $adv_id, 'app_users_id' => $approval_data['Approval']['level2']);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->FinAdvApprove->FinAdvUser->id = '';\n\t\t\t\t\t\t\t$this->FinAdvApprove->FinAdvUser->save($adv_user_data, true, $fieldList = array('fin_advance_id','app_users_id'));\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in saving superior status...', 'default', array('class' => 'alert alert-error'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// update advance status when l2 approves\n\t\t\t\t\t\t$this->FinAdvApprove->id = $adv_id;\n\t\t\t\t\t\t$this->FinAdvApprove->saveField('is_approve', 'Y');\n\t\t\t\t\t\t// send mail to finance manager\n\t\t\t\t\t\t$this->notify_finance($user_data, $req_data);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t// update advance status\n\t\t\t\t\t$this->FinAdvApprove->id = $adv_id;\n\t\t\t\t\t$this->FinAdvApprove->saveField('is_approve', 'Y');\n\t\t\t\t\t// send mail to finance manager\n\t\t\t\t\t$this->notify_finance($user_data, $req_data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t\t// update advance status\n\t\t\t\t$this->FinAdvApprove->id = $adv_id;\n\t\t\t\t$this->FinAdvApprove->saveField('is_approve', 'R');\n\t\t\t\t\t\n\t\t\t\t$approval_data = $this->Approval->find('first', array('fields' => array('level1','level2'), 'conditions'=> array('Approval.app_users_id' => $user_id, 'type' => 'A')));\n\t\t\t\tif($approval_data['Approval']['level1'] == $this->Session->read('USER.Login.id')){\n\t\t\t\t\t$mail_user = $approval_data['Approval']['level2'];\n\t\t\t\t}else{\n\t\t\t\t\t$mail_user = $approval_data['Approval']['level1'];\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// get superior data\n\t\t\t\t$superior_data = $this->FinAdvApprove->Home->find('first', array('conditions' => array('Home.id' => $mail_user),'fields' => array('email_address','first_name', 'last_name')));\n\t\t\t\t// make sure superior available\n\t\t\t\tif(!empty($superior_data)){\t\t\t\t\n\t\t\t\t\t$vars = array('name' => $superior_data['Home']['first_name'].' '.$superior_data['Home']['last_name'], 'purpose' => $req_data['FinAdvApprove']['purpose'], 'desc' => $req_data['FinAdvApprove']['description'], 'amt' => $req_data['FinAdvApprove']['amount'], 'remarks' => $this->request->query['remark'], 'status' => $st_msg, 'req_date' => $req_data['FinAdvApprove']['req_date'],'employee' => $user_data['Home']['first_name'].' '.$user_data['Home']['last_name'],'client' => $req_data['TskCustomer']['company_name']);\n\t\t\t\t\t// notify employee\t\t\t\t\t\t\n\t\t\t\t\tif(!$this->send_email('My PDCA - Advance request is rejected by '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name')), 'notify_advance', '[email protected]', $superior_data['Home']['email_address'],$vars)){\t\t\n\t\t\t\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Problem in sending the mail to user...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t\t\t\t}else{\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// forward to finance team\t\t\t\t\n\t\t\t\t$this->notify_finance($user_data, $req_data, 1);\t\t\t\t\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Advance request is '.$st_msg.' successfully', 'default', array('class' => 'alert alert-success'));\n\t\t}else{\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Problem in updating the status', 'default', array('class' => 'alert alert-error'));\t\t\n\t\t}\n\t\t$this->redirect('/finadvapprove/');\t\n\t}", "public function approveEvent(){\n \t\n \t$data=$this->request->all();\n \t\n \t // print_r($data['value']);die();\n \t$status=$data['value'];\n \t$state['status']=$status;\n \t$event=Event::where('_id',$data['id'])->update($state);\n\n \tif($event){\n \t\treturn \"Success\";\n \t}\n \t// print_r($event);die();\n \t // return view('');\n }", "function status(){\n return ($this -> is_approved())?\"Approved\":\"Unapproved\";\n }", "public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }", "public function onChangeStatus(){\n \n if (($groupId = post('groupId')) != ''){\n \n $group = UserGroup::findOrFail($groupId);\n \n if (($status = post('status')) != ''){\n $user = $this->getuser();\n \n switch ($status){\n case UserGroup::MEMBERSHIP_ACCEPTED:\n $group->acceptMembership($user);\n break;\n \n case UserGroup::MEMBERSHIP_REJECTED:\n \t$group->rejectMembership($user);\n \tbreak;\n \t\n \tcase UserGroup::MEMBERSHIP_CANCELLED:\n \t\t$group->cancelMembership($user);\n \t\tbreak; \t \n \n } \n }\n }\n \n \n // Updated list of request and other vars\n $this->prepareVars();\n }", "function setUsageStatus($opm_productid,$statusid) {\n\n\t\t$this->load->model('approvalstatus_model');\n\t\n\t\tif (checkPerms('can_edit_usage_rights',true)) {\n\t\t\n\t\t\t// fetch status name\n\t\t\t\n\t\t\tif ($statusName = $this->approvalstatus_model->fetchUsageStatus($statusid)) {\n\t\t\t\t\n\t\t\t\t$message = \"Usage rights was changed to \". $statusName .\" by \" . $this->userinfo->username;\n\t\t\t\t\n\t\t\t\tif ($this->products_model->setUsageStatus($opm_productid,$statusid)) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->addHistoryItem($opm_productid,$message);\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Usage rights has been changed.\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->opm->displayError(\"Error saving status\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\t\t\n\t\t\n\t\t}\n\n }", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "public function update(Request $request, $id)\n {\n //Approve user\n $user = Pending::find($id);\n\n if($user->user_role == 102) {\n $user->user_role = 2;\n } \n if($user->user_role == 103) {\n $user->user_role = 3;\n } \n \n $user->save();\n\n return redirect('/pending')->with('success', 'User Approved');\n }", "public function approve()\n\t{\n\t\tPhpfox::getUserParam('quiz.can_approve_quizzes', true);\n\n\t\t$iQuiz = (int)$this->get('iQuiz');\n\t\t$bApproved = Phpfox::getService('quiz.process')->approveQuiz($iQuiz);\n\n\t\tif ($bApproved == true)\n\t\t{\n\t\t\tif ($this->get('inline'))\n\t\t\t{\n\t\t\t\t$this->alert(Phpfox::getPhrase('quiz.quiz_has_been_approved'), Phpfox::getPhrase('quiz.quiz_approved'), 300, 100, true);\n\t\t\t\t$this->hide('#js_item_bar_approve_image');\n\t\t\t\t$this->hide('.js_moderation_off'); \n\t\t\t\t$this->show('.js_moderation_on');\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$this->removeClass('#js_quiz_' . $iQuiz, 'row_moderate');\n\t\t\t\t$this->removeClass('#js_quiz_created_' . $iQuiz, 'row_moderate');\n\t\t\t\t$this->remove('#js_awaiting_moderation_' . $iQuiz);\n\t\t\t\t$this->call('$(\"#js_message_' . $iQuiz . '\").message(\"' . Phpfox::getPhrase('quiz.quiz_approved') . '\", \"valid\").show(\"slow\").fadeOut(5000);');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->alert(Phpfox::getPhrase('quiz.an_error_kept_the_system_from_approving_the_quiz_please_try_again'));\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function testApprove()\n {\n $json = <<<JSON\n{\n \"order_id\": \"45aa52f387871e3a210645d4\",\n \"fraud_status\": \"REJECTED\"\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $data = $order->approve([\n 'data' => 'sent in'\n ]);\n\n $this->assertEquals('45aa52f387871e3a210645d4', $data['order_id']);\n $this->assertEquals('REJECTED', $data['fraud_status']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::POST, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456/orders',\n $request->getUri()->getPath()\n );\n $this->assertEquals('{\"data\":\"sent in\"}', strval($request->getBody()));\n\n $this->assertAuthorization($request);\n }", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "public function approveMajor(Request $request){\n //get the education by the education id\n $education_details = Education::findOrFail($request->input('education_id'));\n if($request->has('status') && $request->input('status') == \"approved\"):\n //udpate the record in the storage\n $education_details->is_approved = \"1\";\n $education_details->user_id = Auth::user()->id; //to do if we need to list the career advisor added education details then we need to change the database structure thus we can alter those changes there\n if($education_details->save()):\n //success message to the client\n return response()->json(array('status'=>'success','msg'=>'Education has been approved!!'),200);\n else:\n return response()->json(array('status'=>'failed','msg'=>'Cannot update record in the storage, please try again'),200);\n endif;\n \n else:\n //failed reponse back to the client\n return response()->json(array('status'=>'failed','msg'=>'Status not defined'),200);\n endif;\n }", "public function change_order_status_post()\n {\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n $id = $data['order_id'];\n $status = $data['status'];\n $user_id = $data['user_id'];\n // $this->response($user_id);\n $data = array(\n 'status' => $status\n );\n \n $where = array(\n 'id' => $id\n );\n $this->model->update('orders', $data, $where);\n $message = \"Your Order is $status\";\n \n $resp = array('rccode' => 200,'message' => $message);\n $this->response($resp);\n //}\n \n \n }", "public function approve(Request $request, $id)\n {\n //\n $postulation = Postulation::find($id);\n $postulation->state = 2;\n $postulation->save();\n\n $user = User::find($postulation->user->id);\n if($postulation->type===1){\n $role = Level::find(4);\n $user->level()->associate($role);\n }elseif ($postulation->type===2) {\n $role = Level::find(5);\n $user->level()->associate($role);\n $enterprise = $user->postulation->where('id', $id)->get()->first()->enterprise;\n $enterprise->state = 1;\n $enterprise->save();\n }\n $user->state = 1;\n $user->save();\n\n $type = Type::find(9);\n $notification = New Notification();\n $notification->user()->associate($user);\n $notification->from_id = 0;\n $notification->type()->associate($type);\n $notification->url = $postulation->uid;\n $notification->from_name = '(RCEE)';\n $notification->save();\n\n return redirect()->route('admin.postulations.index');\n }", "public function isApproved()\n {\n\n return false;\n }", "function mark_as_paid() {\n if (!$this->active_invoice->isLoaded()) {\n $this->response->notFound();\n } // if\n\n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n try{\n if($this->request->isAsyncCall()) {\n $this->active_invoice->setStatus(INVOICE_STATUS_PAID);\n $this->active_invoice->save();\n $this->response->respondWithData($this->active_invoice, array(\n 'as' => 'invoice',\n 'detailed' => true,\n ));\n } else {\n $this->response->badRequest();\n } //if\n } catch (Exception $e) {\n $this->response->exception($e);\n } //try\n }", "function approve_comment($approve_comment_id){\n\t\tif( isset($_POST[$approve_comment_id]) ){\n\t\t\t$comment_id = $_POST[$approve_comment_id];\n\t\t\tarticles_marks::approve_comment_status($comment_id);\n\t\t}\t\n\t}", "public static function rac_change_cart_list_mailstatus() {\n check_ajax_referer('mailstatus-cartlist', 'rac_security');\n\n if (isset($_POST['row_id']) && isset($_POST['status'])) {\n $status = $_POST['status'];\n update_post_meta($_POST['row_id'], 'rac_cart_sending_status', $status);\n echo '1';\n }\n exit();\n }", "public function approve_submission(Request $request)\n {\n }", "public function markAsPending() {\n $this->status = parent::STATUS_PENDING;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "function setExploitStatus($opm_productid,$statusid) {\n\n\t\t$this->load->model('approvalstatus_model');\n\t\n\t\tif (checkPerms('can_edit_exploit_status',true)) {\n\t\t\n\t\t\t// fetch status name\n\t\t\t\n\t\t\tif ($statusName = $this->approvalstatus_model->fetchExploitStatus($statusid)) {\n\t\t\t\t\n\t\t\t\t$message = \"Exploitation status was changed to \". $statusName .\" by \" . $this->userinfo->username;\n\t\t\t\t\n\t\t\t\tif ($this->products_model->setExploitStatus($opm_productid,$statusid)) {\n\t\t\t\t\n\t\t\t\t\t$this->opm->addHistoryItem($opm_productid,$message);\n\t\t\t\t\n\t\t\t\t\t$this->opm->displayAlert(\"Exploitation status has been changed.\",\"/products/view/\" . $opm_productid);\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->opm->displayError(\"Error saving status\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\t\t\n\t\t\n\t\t}\n\n }", "protected function _fcpoSetOrderStatus() {\n $blIsAmazonPending = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoAmazonPayOrderIsPending');\n $blOrderOk = $this->_fcpoValidateOrderAgainstProblems();\n\n if ($blIsAmazonPending) {\n $this->_setOrderStatus('PENDING');\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $this->save();\n } elseif ($blOrderOk === true) {\n // updating order trans status (success status)\n $this->_setOrderStatus('OK');\n } else {\n $this->_setOrderStatus('ERROR');\n }\n }", "public function change_product_status(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$mode = $this->uri->segment(4,0);\r\n\t\t\t$product_id = $this->uri->segment(5,0);\r\n\t\t\t$status = ($mode == '0')?'UnPublish':'Publish';\r\n\t\t\t$newdata = array('status' => $status);\r\n\t\t\t$condition = array('id' => $product_id);\r\n\t\t\t$this->product_model->update_details(PRODUCT,$newdata,$condition);\r\n\t\t\t$this->setErrorMessage('success','Product Status Changed Successfully');\r\n\t\t\tredirect('admin/product/display_product_list');\r\n\t\t}\r\n\t}", "public function emailApprovalByUser($user) {\n\t\t$user->getPrimaryElectronicAddress()->setApproved(TRUE);\n\t\t$this->personRepository->update($user);\n\t\t$this->persistenceManager->persistAll();\n\t}", "function approve_leave($id){\n global $conn;\n\n mysqli_query($conn, \"UPDATE cuti SET status = 'approved', pesan='Approved' WHERE id_cuti = $id\");\n return mysqli_affected_rows($conn);\n }", "public function iN_UpdateApprovePostStatus($userID, $postDescription, $postNewPoint, $postApproveStat, $postID, $postOwnerID, $approveNot) {\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1 && $this->iN_CheckUserExist($postOwnerID) == 1 && $this->iN_CheckPostIDExist($postID) == 1) {\n\t\t\t$time = time();\n\t\t\t$stat = '1';\n\t\t\t$notType = 'accepted_post';\n\t\t\tif ($postApproveStat != '1') {\n\t\t\t\t$stat = '2';\n\t\t\t}\n\t\t\tif ($postApproveStat == '2') {\n\t\t\t\t$notType = 'rejected_post';\n\t\t\t}\n\t\t\tif ($postApproveStat == '3') {\n\t\t\t\t$notType = 'declined_post';\n\t\t\t}\n\t\t\tmysqli_query($this->db, \"SET character_set_client=utf8mb4\") or die(mysqli_error($this->db));\n\t\t\tmysqli_query($this->db, \"SET character_set_connection=utf8mb4\") or die(mysqli_error($this->db));\n\t\t\tmysqli_query($this->db, \"UPDATE i_posts SET post_text = '$postDescription', post_wanted_credit = '$postNewPoint', post_status = '$stat' WHERE post_id = '$postID'\") or die(mysqli_error($this->db));\n\t\t\tmysqli_query($this->db, \"INSERT INTO i_approve_post_notification(approved_post_id,approved_post_owner_id,approve_status,approve_not,appprove_time)VALUES('$postID','$postOwnerID','$postApproveStat','$approveNot','$time')\") or die(mysqli_error($this->db));\n\t\t\tmysqli_query($this->db, \"INSERT INTO i_user_notifications(not_post_id, not_not_type,not_time, not_own_iuid, not_iuid)VALUES('$postID','$notType','$time','$postOwnerID','$userID')\") or die(mysqli_error($this->db));\n\t\t\tmysqli_query($this->db, \"UPDATE i_users SET notification_read_status = '1' WHERE iuid = '$postOwnerID'\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function changeApprovalStatus(Driver $driver, bool $status)\n {\n $update = $this->driverRepository->changeApprovalStatus($driver, $status);\n if($update) {\n return redirect()->back()->with('success', 'Driver Approval Status Changed Successfully');\n } else {\n return redirect()->back()->with('error', 'Something went wrong. Try again later.');\n }\n }", "public function update(Request $request, Task $task)\n {\n $task_id = $task->id;\n\n if (auth()->user()->isManager(auth()->user()->id)) {\n if ($request->finish_editing == 'Yes') {\n $put = Task::find($task_id);\n $put->override_status = 'Yes';\n $put->save();\n return redirect()->back()->with('message', 'semd to approver successfully')->with('status', 1);\n } else {\n /**\n * if manager edited any data during requisition after approver data\n * action delete this approver approved status from tasksstatus table\n */\n if($task->manager_override_chunck == null){\n TaskHelper::ManagerOverrideData($task_id);\n }\n }\n }\n\n //End\n\n $getResource = TaskSite::select('resource_id')->where('task_id', $task->id)->get();\n if (isset($getResource)) {\n $checkResource = TaskHelper::arrayExist($getResource, 'resource_id', $request->site_head);\n if ($checkResource == true) {\n return redirect()->back()->with('message', 'This person already assign as resource.please at first remove from resource')->with('status', 0);\n }\n }\n\n if($request->anonymousproof_details){\n if (auth()->user()->isManager(auth()->user()->id)) {\n /*\n && $request->anonymous_proof_details\n Task::where('id', $task->id)\n ->update(['anonymous_proof_details' => $request->anonymous_proof_details]);\n */\n\n\n $atts = Task::find($task->id);\n $atts->anonymous_proof_details = $request->anonymous_proof_details;\n $atts->save();\n\n }\n return redirect()->back()->with('message', 'Saved successfully')->with('status', 1);\n }\n\n if (auth()->user()->isManager(auth()->user()->id) && $request->task_assigned_to_head == 'Yes') {\n\n $atts = Task::find($task->id);\n $atts->task_assigned_to_head = $request->task_assigned_to_head;\n $atts->save();\n\n TaskHelper::statusUpdate([\n 'code' => TaskHelper::getStatusKey('task_assigned_to_head'),\n 'task_id' => $request->task_id,\n 'action_performed_by' => auth()->user()->id,\n 'performed_for' => null,\n 'requisition_id' => null,\n 'message' => TaskHelper::getStatusMessage('task_assigned_to_head')\n ]);\n return redirect()->back()->with('message', 'Saved successfully')->with('status', 1);\n }\n\n if (auth()->user()->isApprover(auth()->user()->id)) {\n TaskHelper::statusUpdateOrInsert([\n 'code' => TaskHelper::getStatusKey('task_approver_edited'),\n 'task_id' => $request->task->id,\n 'action_performed_by' => auth()->user()->id,\n 'performed_for' => null,\n 'requisition_id' => null,\n 'message' => TaskHelper::getStatusMessage('task_approver_edited')\n ]);\n }\n\n\n // store\n $attributes = [\n 'task_type' => $request->task_type,\n 'project_id' => $request->project_id,\n 'task_code' => $request->task_code ?? null,\n 'task_name' => $request->task_name,\n 'site_head' => $request->site_head,\n 'task_details' => $request->task_details,\n 'task_assigned_to_head' => $request->task_assigned_to_head,\n ];\n //return redirect()->back()->with('message', 'Edited Successfully')->with('status', 1);\n //dd($attributes);\n try {\n $task = $this->task->update($task->id, $attributes);\n\n return back()\n ->with('message', 'Successfully saved')\n ->with('status', 1)\n ->with('task', $task);\n } catch (\\Exception $e) {\n return view('task::edit', $task->id)->with(['status' => 0, 'message' => 'Error']);\n }\n }", "protected function markApproved( )\r\n {\r\n $this->_sessie->registerApproved( $this );\r\n }", "public function showAlacarteReview()\n {\n $review_id = Input::get('review_id');\n\n $check_review = DB::select(\"select status from vendor_location_reviews where id = '$review_id'\");\n $status = $check_review[0]->status;\n if($status == \"Pending\")\n {\n $statusUpdate = \"Approved\";\n }\n else if($status == \"Approved\")\n {\n $statusUpdate = \"Pending\";\n }\n\n $update = DB::update(\"update vendor_location_reviews set status ='$statusUpdate' where id = $review_id\");\n\n echo '1';\n\n }", "public function approve(Request $request)\n {\n return $this->investmentRequestService->approve($request);\n }", "public function approve($id)\n {\n $kondisi = $this->input->post('id_kondisi');\n $sql = $this->db->query(\"SELECT tanggal FROM ticket WHERE id_ticket = '$id'\")->row();\n $sql2 = $this->db->query(\"SELECT nama_kondisi FROM kondisi WHERE id_kondisi = '$kondisi'\")->row();\n //Data\n $prio = $sql2->nama_kondisi;\n $date = $sql->tanggal;\n $date2 = $this->input->post('waktu_respon');\n //Mengambil session admin\n $id_user = $this->session->userdata('id_user');\n\n //Melakukan update data ticket dengan mengubah status ticket menjadi 2, data ditampung ke dalam array '$data' yang nanti akan diupdate dengan query\n $data = array(\n 'id_kondisi' => $kondisi,\n 'deadline' => date('Y-m-d H:i:s', strtotime($date. ' + '.$date2.' days')),\n 'status' => 3,\n 'last_update'=> date(\"Y-m-d H:i:s\"),\n 'teknisi' => $this->input->post('id_teknisi')\n );\n\n //Melakukan insert data tracking ticket bahwa ticket di-approve oleh admin, data tracking ke dalam array '$datatracking' yang nanti akan di-insert dengan query\n $datatracking = array(\n 'id_ticket' => $id,\n 'tanggal' => date(\"Y-m-d H:i:s\"),\n 'status' => \"Ticket Received\",\n 'deskripsi' => \"Priority of the ticket is set to \".$prio.\" and assigned to technician.\",\n 'id_user' => $id_user\n );\n\n //Query untuk melakukan update data ticket sesuai dengan array '$data' ke tabel ticket\n $this->db->where('id_ticket', $id);\n $this->db->update('ticket', $data);\n\n //Query untuk melakukan insert data tracking ticket sesuai dengan array '$datatracking' ke tabel tracking\n $this->db->insert('tracking', $datatracking);\n }", "public function changepackagerenewStatus()\n\t{\n\t\t\n\t\t$this->Checklogin();\n\t\t$status=$this->input->post('id');\n\t\t$package_id=$this->input->post('package_id');\n \n \n\t\t$idlist=implode(\",\",$package_id);\n\t\t\n\t\tif ($status == 0 || $status == 1)\n\t\t{\n\t\t\t$a=$this->package_model->changepackagerenewStatus($status,$package_id);\n\t\t\t\n\t\t\tif ($status == 0)\n\t\t\t{\n\t\t\t\tsetSAActivityLogs('Transaction_activity','SAPackagerenew_status',\"Updates Status Deactivated :- \".$idlist);\n if(count($package_id)>1)\n { \n\t\t\t\t $this->session->set_flashdata('success','Packages has been deactivated successfully');\n\t\t\t }\n else\n {\n $this->session->set_flashdata('success','Package has been deactivated successfully'); \n }\n } else\n\t\t\t{\n\t\t\t\tsetSAActivityLogs('Transaction_activity','SAPackagerenew_status',\"Updates Status Activated :- \".$idlist);\n if(count($package_id)>1)\n { \n\t\t\t\t $this->session->set_flashdata('success','Packages has been activated successfully');\n\t\t\t }\n else\n {\n $this->session->set_flashdata('success','Package has been activated successfully'); \n } \n }\n\t\t\techo true;\n\t\t} else\n\t\t{\n\t\t\t\n\t\t\t$this->session->set_flashdata('error','Something went wrong');\n\t\t\techo true;\n\t\t}\n\t\n\t}", "function jx_mark_delivered_status_for_courier_traspost()\r\n\t{\r\n\t\t$user=$this->erpm->auth();\r\n\t\t\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t\r\n\t\t$send_log_id=$this->input->post('send_log_id');\r\n\t\t$invoices_list=$this->input->post('delivered');\r\n\t\t$received_by=$this->input->post('received_by');\r\n\t\t$received_on=$this->input->post('received_on');\r\n\t\t$contact_no=$this->input->post('contact_no');\r\n\t\t\r\n\t\tif($invoices_list)\r\n\t\t{\r\n\t\t\tforeach($invoices_list as $i=>$incoice)\r\n\t\t\t{\r\n\t\t\t\t$param=array();\r\n\t\t\t\t$param['sent_log_id']=$send_log_id;\r\n\t\t\t\t$param['invoice_no']=$incoice;\r\n\t\t\t\t$param['status']=3;\r\n\t\t\t\t$param['received_by']=$received_by[$i];\r\n\t\t\t\t$param['received_on']=$received_on[$i];\r\n\t\t\t\t$param['contact_no']=$contact_no[$i];\r\n\t\t\t\t$param['logged_on']=cur_datetime();\r\n\t\t\t\t$param['logged_by']=$user['userid'];\r\n\t\t\t\t\r\n\t\t\t\t$already=$this->db->query(\"select count(*) as ttl from pnh_invoice_transit_log where invoice_no=? and status=3\",array($incoice))->row()->ttl;\r\n\t\t\t\tif(!$already)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->db->insert('pnh_invoice_transit_log',$param);\r\n\t\t\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Selected invoices status to be updated\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Selected invoices status already updated\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tredirect($_SERVER['HTTP_REFERER']);\r\n\t}", "public function changestatus_post()\r\n {\r\n $userid=$this->uri->segment(3);\r\n\r\n $user=$this->user_m->get($userid);\r\n if($user->status==\"1\"){\r\n $data=array(\r\n \"status\"=> \"0\"\r\n );\r\n }\r\n else{\r\n $data=array(\r\n \"status\"=> \"1\"\r\n ); \r\n }\r\n if ($succes_status = $this->user_m->update_data($userid,$data)){\r\n if($user->status==\"1\"){\r\n $this->response(\r\n array(\r\n 'Status_code' => \"201\",\r\n 'Message' => \"User Deactivated\"\r\n )\r\n );\r\n }\r\n else{\r\n $this->response(\r\n array(\r\n 'Status_code' => \"201\",\r\n 'Message' => \"User Activated\"\r\n )\r\n ); \r\n }\r\n }\r\n else\r\n {\r\n $this->response(\r\n array(\r\n 'Status_code' => \"401\",\r\n 'Message' => \"ops something went wrong\"\r\n )\r\n ); \r\n }\r\n }", "public function updateStatusPartiallyAssigned() : bool\n {\n $this->status = self::STATUS_PARTIALLY_ASSIGNED;\n return $this->save();\n }", "private function changeStatusCareOrg() {\n if ($this->get_request_method() != \"POST\") {\n $error = array('status_code' => \"0\", 'message' => \"wrong method\", 'response_code' => \"406\");\n $this->response($this->json($error), 406);\n }\n\n $arr = array();\n if(@$_POST['reqparams']) {\n $post = $_POST['reqparams'];\n $UserID = $post['UserID'];\n $StatusID = $post['StatusID'];\n } else {\n $UserID = $_POST['UserID'];\n $StatusID = $_POST['StatusID'];\n }\n\n mysql_query(\"UPDATE `SCP_UserLogin` SET `StatusID`='$StatusID' WHERE `UserID` = '$UserID'\", $this->db);\n mysql_query(\"UPDATE `SCP_CareOrg` SET `StatusID`='$StatusID' WHERE `UserID` = '$UserID'\", $this->db);\n mysql_query(\"UPDATE `SCP_UserAccess` SET `StatusID`='$StatusID' WHERE `UserID` = '$UserID'\", $this->db);\n\n $success = true;\n\n if ($success) {\n $error = array('status_code' => \"1\", 'status' => \"success\", 'message' => \"Changed Organization Status Successfully\", 'response_code' => \"200\", 'response_data' => $arr);\n $this->response($this->json($error), 200);\n } else {\n $error = array('status_code' => \"0\", 'status' => \"error\", 'message' => \"validation error\", 'response_code' => \"200\", 'response_data' => $arr);\n $this->response($this->json($error), 200);\n }\n }", "function approve_return($item_id) {\n $this->db->where('item_id', $item_id);\n $this->db->update('items', array('status' => 0)); // set the item status to returned\n //delete the item \n return $this->db->delete('items_collection', array('item_id' => $item_id));\n }" ]
[ "0.7126831", "0.6334186", "0.63321835", "0.6319313", "0.6295477", "0.6291758", "0.6258976", "0.62018144", "0.61808586", "0.6178008", "0.6162444", "0.6159546", "0.6090091", "0.6064974", "0.6050638", "0.60457367", "0.60391855", "0.6035661", "0.60335404", "0.60255253", "0.6012471", "0.60054976", "0.5992697", "0.59896815", "0.5985729", "0.5982148", "0.5967323", "0.59657276", "0.59508014", "0.5943537", "0.5937275", "0.59365773", "0.59166044", "0.5907651", "0.58989656", "0.5894772", "0.58902925", "0.5878487", "0.5856715", "0.58527064", "0.5821388", "0.5819955", "0.58165026", "0.5816053", "0.58154863", "0.5769289", "0.57687265", "0.57660186", "0.575893", "0.574762", "0.57330686", "0.57280505", "0.57279265", "0.57222867", "0.5719407", "0.5718589", "0.57092935", "0.56998515", "0.56906277", "0.568985", "0.5681868", "0.5681436", "0.565456", "0.5646906", "0.56434155", "0.56350636", "0.5630006", "0.5628308", "0.5626501", "0.56213164", "0.5619086", "0.5617252", "0.5607862", "0.56054926", "0.56051046", "0.56029", "0.5596734", "0.5596397", "0.55884093", "0.5580146", "0.55763686", "0.55698025", "0.55644166", "0.5562504", "0.55610234", "0.554665", "0.5545071", "0.551319", "0.5510298", "0.5509771", "0.5508979", "0.55026793", "0.5497193", "0.5495426", "0.54904675", "0.5487572", "0.5485758", "0.5482897", "0.54787725", "0.54778963", "0.5470505" ]
0.0
-1
Reference for Credit and Debit Note Reference Reference
public function store_transaction(Request $request, $method) { Log::info("TransactionController->store_transaction :- Inside "); //dd($request->all()); $raw_post = file_get_contents('php://input'); Log::info("TransactionController->store_transaction :-request post ".json_encode($_POST)); Log::info("TransactionController->store_transaction :-request raw post ".json_encode($raw_post)); try{ $result = DB::transaction(function () use ($request, $method) { $modulename = Session::get('module_name'); $organization_id = Session::get('organization_id'); $transaction_type = AccountVoucher::where('name', $request->input('type'))->where('organization_id', $organization_id)->first(); $vou_restart_values = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); /* Validation for module wise */ if($modulename == "trade_wms"){ $validator = Validator::make($request->all(), [ 'registration_no' => 'required', 'people_id' => 'required' ]); } if($modulename == "trade" ){ $validator = Validator::make($request->all(), [ 'people_id' => 'required' ]); } if($modulename == "inventory" ){ $validator = Validator::make($request->all(), [ 'people_id' => 'required' ]); } if($validator->fails()) { return response()->json(['status' => 0, 'message' => $validator->messages()->first()]); } if($transaction_type->name == 'job_card' || $transaction_type->name =='job_request') { if($request->input('item_id') == null || $request->input('item_id') == '') { if($method == "remote") { return response()->json(array('status' => 0, 'message' => 'Atleast one item should be selected.')); } } } elseif ($transaction_type->name == 'job_invoice' || $transaction_type->name =='job_invoice_cash') { if($request->input('item_id') == null || $request->input('item_id') == '') { return response()->json(array('status' => 0, 'message' => 'Atleast one item should be selected.')); } } else{ if(count(array_filter($request->input('item_id'))) == 0 ) { return response()->json(array('status' => 0, 'message' => 'Atleast one item should be selected.')); } } /*End*/ $organization = Organization::findOrFail($organization_id); $uuid= $request->input('attachment_uid'); $complaint = $request->input('complaints'); /*Item - data */ $item_id = $request->input('item_id'); $batch_id = $request->input('batch_id'); $parent_item_id = $request->input('parent_item_id'); $description = $request->input('description'); $quantity = $request->input('quantity'); $rate = $request->input('rate'); $discount = $request->input('discount'); $tax_id = $request->input('tax_id'); $new_selling_price = $request->input('new_selling_price'); $discount_id = $request->input('discount_id'); $discount_value = $request->input('discount_value'); $advance_amount = $request->input('advance_amount'); $assigned_employee_id = $request->input('assigned_employee_id'); $start_time = $request->input('start_time'); $end_time = $request->input('end_time'); $job_item_status = $request->input('job_item_status'); $duration = $request->input('duration'); $stock_update = $request->input('stock_update'); $invoice_approval = $request->input('invoice_approval'); $selling_price = $request->input('selling_price'); $over_all_discount = $request->input('over_all_discount'); /* End */ if($method == "update") { $transaction = Transaction::findOrFail($request->input('id')); if($transaction->approval_status == 1) { return response()->json(array('status' => 0, 'message' => 'Approved transactions cannot be updated.', 'data' => [])); } } $entry = []; $cash_payment = ''; $previous_entry = Transaction::where('transaction_type_id', $transaction_type->id)->where('organization_id', $organization_id)->orderby('id', 'desc')->first(); if($method == "store" || $method == "update" || $method == "lowstock") { $person = People::select('id as people_org_id','user_type', 'display_name'); if($request->input('people_type') == 0) { $person->where('person_id', $request->input('people_id')); } else if($request->input('people_type') == 1) { $person->where('business_id', $request->input('people_id')); } $person->where('organization_id', $organization_id); $persons = $person->first(); $account_ledgers = AccountLedger::select('account_ledgers.id'); if($persons->user_type == 0) { $account_ledgers->where('person_id', $request->input('people_id')); $person_id = $request->input('people_id'); $business_id = null; } else if($persons->user_type == 1) { $account_ledgers->where('business_id', $request->input('people_id')); $business_id = $request->input('people_id'); $person_id = null; } if($request->input('person_type') != null) { $person_type_id = AccountPersonType::where('name', $request->input('person_type'))->first()->id; $person_type = DB::table('people_person_types')->where('people_id', $persons->people_org_id)->where('person_type_id', $person_type_id)->first(); if($person_type == null) { DB::table('people_person_types')->insert(['people_id' => $persons->people_org_id, 'person_type_id' => $person_type_id]); } } } else if($method == "remote") { $existing_person = People::select('*'); if($request->input('user_type') == 0) { $existing_person->where('person_id', $request->input('people_id')); } else if($request->input('user_type') == 1) { $existing_person->where('business_id', $request->input('people_id')); } $existing_person->where('organization_id', $organization_id); $existing_persons = $existing_person->first(); if($existing_persons == null) { $selected_people = People::select('people.id', 'people.company', 'people.first_name', 'people.middle_name', 'people.last_name', 'people.display_name', 'people.mobile_no', 'people.email_address', 'people.phone', 'people.gst_no')->where('people.id')->first(); $persons = new People(); if($request->input('people_id') != null) { if($request->input('user_type') == 0) { $persons->person_id = $request->input('people_id'); } else if($request->input('reference_user_type') == 1) { $persons->business_id = $request->input('people_id'); } } $persons->user_type = $request->input('reference_user_type'); $persons->first_name = $request->input('name'); $persons->display_name = $request->input('reference_customer_name'); $persons->mobile_no = $request->input('mobile'); $persons->email_address = $request->input('email'); $persons->organization_id = Session::get('organization_id'); $persons->save(); if($persons->id) { $people_address = new PeopleAddress(); $people_address->people_id = $persons->id; $people_address->address_type = 0; $people_address->address = $request->input('address'); /*$people_address->city_id = $request->input('city_id'); $people_address->pin = $request->input('pin');*/ $people_address->save(); } } else { $persons = $existing_persons; } $account_ledgers = AccountLedger::select('account_ledgers.id'); $account_ledgers->where('person_id', $request->input('people_id')); $person_id = $persons->person_id; $business_id = $persons->business_id; } $account_ledgers->where('organization_id', $organization_id); $account_ledger = $account_ledgers->first(); $impersonal_ledger = AccountLedgerType::where('name', 'impersonal')->first(); if($account_ledger != null){ $customer_ledger = $account_ledger->id; } else { if($transaction_type->name == "purchases") { $ledgergroup = AccountGroup::where('name', 'sundry_creditor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($persons->display_name, $organization, $persons->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'credit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash") { $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($persons->display_name, $organization, $persons->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } else if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first(); $customer_ledger = Custom::create_ledger($persons->display_name, $organization, $persons->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false); } } /*$field_name = $request->input('field_name'); $field_type = $request->input('field_type'); $field_format = $request->input('field_format'); $type = $request->input('check_type'); $field_value = $request->input('field_value'); */ $reference_transaction_type = null; $discount_percent = null; if($discount_value != null) { if($request->input('discount_is_percent') != null) { $discount_percent = 1; } else { $discount_percent = 0; } } $tax_type = $request->tax_type; if($method == "store" || $method == "remote" || $method == "lowstock") { $transaction = new Transaction; } else if($method == "update") { $transaction = Transaction::findOrFail($request->input('id')); } $transaction->user_type = $request->input('people_type'); if($method == "remote") { $transaction->reference_no = $request->remote_reference_no; }elseif($method == "store" || $method == "lowstock") { $transaction->reference_no = $request->order_id; } if($method == "store" || $method == "update" || $method == "lowstock" || $method == "remote") { if($request->input('reference_id') != null) { //GET Transaction TYPE AND ADD IT IN WHERE CONDITION $transaction->reference_id =$request->input('reference_id'); $reference_transaction_type = Transaction::select('account_vouchers.name') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.id',$request->input('reference_id')) ->first(); } } if($method == "remote") { $transaction->remote_reference_no = $request->input('remote_reference_no'); $transaction->notification_status = 3; $transaction->reference_id = $request->input('order_id'); } $transaction->people_id = $request->input('people_id'); $transaction->ledger_id = $request->input('ledger_id'); if($transaction_type->name == 'job_card' || $transaction_type->name =='job_request' || $transaction_type->name =='job_invoice' || $transaction_type->name =='job_invoice_cash') { $transaction->date = ($request->input('job_date')!=null) ? Carbon::parse($request->input('job_date'))->format('Y-m-d') : null; }else{ $transaction->date = ($request->input('invoice_date') != null) ? Carbon::parse($request->input('invoice_date'))->format('Y-m-d') : null; } $transaction->due_date = ($request->input('due_date') != null) ? Carbon::parse($request->input('due_date'))->format('Y-m-d') : null; $transaction->transaction_type_id = $transaction_type->id; $transaction->payment_mode_id = $request->input('payment_method_id'); $transaction->term_id = $request->input('term_id'); $transaction->employee_id = $request->input('employee_id'); $transaction->name = $request->input('name'); $transaction->mobile = $request->input('mobile'); $transaction->email = $request->input('email'); $transaction->gst = $request->input('gst'); $transaction->notification_status = 1; $transaction->address = $request->input('address'); $address_type = BusinessAddressType::where('name','business')->first()->id; $business = Business::find($organization->business_id); $business_communication_address = BusinessCommunicationAddress::where('business_id', $organization->business_id)->where('address_type', $address_type)->first(); $city = City::select('cities.name','states.name AS state')->leftjoin('states', 'states.id', '=', 'cities.state_id')->where('cities.id', $business_communication_address->city_id)->first(); $transaction->billing_name = $request->input('billing_name'); $transaction->billing_mobile = $request->input('billing_mobile'); $transaction->billing_email = $request->input('billing_email'); $transaction->billing_gst = $request->input('billing_gst'); $transaction->billing_address = $request->input('billing_address'); $transaction->shipping_name = $request->input('shipping_name'); $transaction->shipping_mobile = $request->input('shipping_mobile'); $transaction->shipping_email = $request->input('shipping_email'); $transaction->shipping_address = $request->input('shipping_address'); $transaction->shipment_mode_id = $request->input('shipment_mode_id'); $transaction->shipping_date = ($request->input('shipping_date') != null) ? Carbon::parse($request->input('shipping_date'))->format('Y-m-d') : null; $transaction->discount_is_percent = $discount_percent; //$transaction->discount = $request->input('discount'); $transaction->organization_id = $organization_id; $transaction->pin = Custom::otp(4); $transaction->tax_type = $tax_type; if($transaction_type->name == "job_invoice_cash") { $transaction->approval_status = 1; } if($method == "remote") { $transaction->notification_status = 3; } if($request->input('send_po') == 1) { $transaction->notification_status = 0; } $transaction->save(); /* Using Packgage metering on over all addon transacion*/ Custom::add_addon('transaction'); /* end */ /* Update for status colour */ if($method == "remote") { DB::table('transactions')->where('id',$transaction->reference_id)->update(['notification_status'=> "3"]); } /* Update or Store */ /*if($method == "store" || $method == "update") { if($request->input('people_type') == 0) { DB::table('people')->where('person_id', $transaction->people_id)->update(['mobile_no'=> $transaction->mobile,'email_address' => $transaction->email ]); } else if($request->input('people_type') == 1) { DB::table('people')->where('business_id', $transaction->people_id)->update(['mobile_no'=> $transaction->mobile,'email_address' => $transaction->email ]); } }*/ /* end */ /* ========== Trade-WMS Store Function Begins ========== */ if($method == "store" || $method == "remote" || $method == "lowstock") { $wms_transaction = new WmsTransaction; } else if($method == "update") { $wms_transaction = WmsTransaction::where('transaction_id',$request->input('id'))->first(); } if($transaction_type->name == 'job_card' || $transaction_type->name =='job_request' || $transaction_type->name =='job_invoice' || $transaction_type->name =='job_invoice_cash') { $wms_transaction->transaction_id = $transaction->id; $wms_transaction->registration_id = $request->input('registration_no'); $wms_transaction->engine_no = $request->input('engine_no'); $wms_transaction->chasis_no = $request->input('chasis_no'); //$wms_transaction->vehicle_usage_id = $request->input('vehicle_usage_id'); $wms_transaction->jobcard_status_id = $request->input('jobcard_status_id'); $wms_transaction->service_type = $request->input('service_type'); $wms_transaction->assigned_to = $request->input('employee_id'); $wms_transaction->payment_terms = $request->input('payment_terms'); $wms_transaction->payment_details = $request->input('payment_details'); $wms_transaction->delivery_by = $request->input('delivery_by'); $wms_transaction->delivery_details = $request->input('delivery_details'); $wms_transaction->vehicle_last_visit = $request->input('vehicle_last_visit'); $wms_transaction->vehicle_last_job = $request->input('vehicle_last_job'); $wms_transaction->vehicle_mileage = $request->input('vehicle_mileage'); $wms_transaction->advance_amount = $request->input('advance_amount'); $wms_transaction->next_visit_mileage = $request->input('next_visit_mileage'); $wms_transaction->job_date = ($request->input('job_date')!=null) ? Carbon::parse($request->input('job_date'))->format('Y-m-d') : null; $wms_transaction->job_due_date = ($request->input('job_due_date')!=null) ? Carbon::parse($request->input('job_due_date'))->format('Y-m-d') : null; $wms_transaction->job_completed_date = ($request->input('job_completed_date')!=null) ? Carbon::parse($request->input('job_completed_date'))->format('Y-m-d') : null; $wms_transaction->vehicle_next_visit = ($request->input('vehicle_next_visit')!=null) ? Carbon::parse($request->input('vehicle_next_visit'))->format('Y-m-d') : null; $wms_transaction->vehicle_next_visit_reason = $request->input('vehicle_next_visit_reason'); $wms_transaction->vehicle_note = $request->input('vehicle_note'); $wms_transaction->vehicle_complaints = $complaint; $wms_transaction->driver = $request->input('driver'); $wms_transaction->driver_contact = $request->input('driver_contact'); $wms_transaction->organization_id = $organization_id; $wms_transaction->shift_id = $request->input('shift_id'); $wms_transaction->pump_id = $request->input('pump_id'); $wms_transaction->save(); Custom::userby($wms_transaction, true); if($wms_transaction) { if($transaction_type->name == 'job_invoice_cash' || $transaction_type->name == 'job_invoice') { $va = DB::table('wms_transactions')->where('jobcard_status_id','!=',null)->where('transaction_id',$request->input('order_id'))->update(['jobcard_status_id'=> "8"]); } } if($transaction_type->name == 'job_card') { /*if( $request->input('attachment_uid')!=""){ $If_Existed=WmsAttachment::where('uuid',$request->input('attachment_uid')); if($If_Existed) { //$If_Existed->transaction_id=$transaction->id; $If_Existed->update(array( 'transaction_id'=>$transaction->id)); $files=$If_Existed->get(); $path_array_temp = explode('/', 'wms_attachments/org_'.Session::get('organization_id')."/temp"); $temp_path = ''; foreach ($path_array_temp as $p) { $temp_path .= $p."/"; if (!file_exists(public_path($temp_path))) { mkdir(public_path($temp_path), 0777, true); } } $path_array_origional = explode('/', 'wms_attachments/org_'.Session::get('organization_id').'/jobcard_'.$transaction->id); $origional_path = ''; $thumbnail_image_path = ''; foreach ($path_array_origional as $p) { $origional_path .= $p."/"; if (!file_exists(public_path($origional_path))) { mkdir(public_path($origional_path), 0777, true); } } //$thumbnail_image_path = $p."/thumbnails/"; $thumbnail_image_path_array = explode('/', 'wms_attachments/org_'.Session::get('organization_id')."/jobcard_".$transaction->id.'/thumbnails'); $thumbnail_image_path=''; foreach ($thumbnail_image_path_array as $p) { $thumbnail_image_path .= $p."/"; //$thumbnail_image_path = $p."/thumbnails/"; if (!file_exists(public_path($thumbnail_image_path))) { mkdir(public_path($thumbnail_image_path), 0777, true); } } foreach ($files as $value) { $thumbnail_file=$value->thumbnail_file; $origional_file=$value->origional_file; // Storage::move(asset("public/".$temp_path)."/".$origional_file,asset("public/".$origional_path)."/".$origional_file); //Storage::move(asset("public/".$temp_path)."/".$thumbnail_file,asset("public/".$thumbnail_image_path)."/".$thumbnail_file); copy (public_path($temp_path) . '/' . $origional_file, public_path($origional_path) . '/' . $origional_file); copy (public_path($temp_path) . '/' . $thumbnail_file, public_path($thumbnail_image_path) . '/' . $thumbnail_file); } # code... } }*/ if($wms_transaction != "") { $transaction_id = $transaction->id; //$getReadingIdCount=count(array_filter($reading_id)); if($request->has('wms_reading_factor_id')) { $reading_id = $request->input('wms_reading_id'); $reading_factor_id = $request->input('wms_reading_factor_id'); $reading_values = $request->input('reading_values'); /* $trasaction_reading_id=$request->input('');*/ $reading_notes = $request->input('reading_notes'); for($i=0; $i<count($reading_factor_id); $i++){ /*if($reading_values[$i]!=null) {*/ $ExistValues=WmsTransactionReading::where(["transaction_id" => $transaction->id,"reading_factor_id" => (int)$reading_factor_id[$i]])->exists(); if($ExistValues) { $Data=["reading_values" => $reading_values[$i],"reading_notes" => $reading_notes[$i]]; WmsTransactionReading::updateOrCreate(["transaction_id" => $transaction->id,"reading_factor_id" => (int)$reading_factor_id[$i]],$Data); }elseif($reading_values[$i]!="") { $Data=["transaction_id" => $transaction->id,"reading_factor_id" => (int)$reading_factor_id[$i],"reading_values" => $reading_values[$i],"reading_notes" => $reading_notes[$i]]; // dd($Data); WmsTransactionReading::updateOrCreate(["id"=>$reading_id[$i]],$Data); }elseif ($reading_id[$i]) { $IsExisted=WmsTransactionReading::findOrFail($reading_id[$i]); if($IsExisted) { WmsTransactionReading::destroy('id',$reading_id[$i]); } }else{ } /* }*/ } } /* *** WFM Checklist ** */ if($request->has('checklist_status')) { $wms_checklist_id = $request->input('wms_checklist_id'); $checklist_id = $request->input('checklist_id'); //dd($checklist_id); $wms_checklist_status = $request->input('checklist_status'); /* $trasaction_reading_id=$request->input('');*/ $wms_checklist_notes = $request->input('checklist_notes'); for($i=0; $i<count($wms_checklist_status); $i++){ if($wms_checklist_status[$i]==0 && $wms_checklist_id[$i]!="") { $IsExisted=WmsChecklist::findOrFail($wms_checklist_id[$i]); if($IsExisted) { WmsChecklist::destroy('id',$wms_checklist_id[$i]); } } if($wms_checklist_status[$i]==1) { $ExistValues=WmsChecklist::where(["transaction_id" => $transaction->id,"checklist_id" => $checklist_id[$i]])->exists(); if($ExistValues) { $Data=["checklist_status" => $wms_checklist_status[$i],"checklist_notes" => $wms_checklist_notes[$i]]; WmsChecklist::updateOrCreate(["transaction_id" => $transaction->id,"checklist_id" => $checklist_id[$i]],$Data); }else{ $Data=["transaction_id" => $transaction->id,"checklist_id" => $checklist_id[$i],"checklist_status" => $wms_checklist_status[$i],"checklist_notes" => $wms_checklist_notes[$i]]; $WmsChecklist =WmsChecklist::updateOrCreate(["id"=>$wms_checklist_id[$i],"checklist_status"=>$wms_checklist_status[$i]],$Data); // Custom::userby($WmsChecklist, true); } } } } // Custom::userby($WmsChecklist, true); /*}*/ /*else{ for($i=0; $i<count($wms_checklist_status); $i++){ // dd($wms_checklist_status); $WmsChecklist = new WmsChecklist; $WmsChecklist->transaction_id = $transaction->id;; $WmsChecklist->checklist_id = $checklist_id[$i]; $WmsChecklist->checklist_status = $wms_checklist_status[$i]; $WmsChecklist->checklist_notes = $wms_checklist_notes[$i]; $WmsChecklist->save(); Custom::userby($WmsChecklist, true); } }*/ } else{ } } } /* ========= Trade-WMS Store Function Ends ======== */ if($method == "store" || $method == "remote" || $method == "lowstock") { Custom::userby($transaction, true); } else if($method == "update") { Custom::userby($transaction, false); } if($transaction->id != null ) { $total_tax = 0; $discount_total_amount = 0.0; $tax_amount = 0; $discount_amount = 0; if($method == "update") { $existing_items = DB::table('transaction_items')->where('transaction_items.transaction_id', $request->input('id'))->delete(); } for($i=0; $i<count($item_id); $i++) { $item_discount_amount = 0.0; if($method == "remote") { if(strpos($item_id[$i], 'g_') !== false) { $global_item_model_id = str_replace('g_', '', $item_id[$i] ); $global_item = GlobalItemModel::where('id', $global_item_model_id )->first(); $global_item_category = GlobalItemCategory::select('global_item_categories.id','global_item_categories.name','global_item_categories.display_name','global_item_category_types.id AS category_type_id') ->leftjoin('global_item_main_categories','global_item_main_categories.id','=','global_item_categories.main_category_id') ->leftjoin('global_item_category_types','global_item_category_types.id','=','global_item_main_categories.category_type_id') ->where('global_item_categories.id',$global_item->category_id) ->first(); $item_category_exist = InventoryCategory::where('name', $global_item_category->name)->where('organization_id', $organization_id)->first(); if($item_category_exist != null) { $category_id = $item_category_exist->id; } else { $category = new InventoryCategory; $category->name = $global_item_category->name; $category->display_name = $global_item_category->display_name; $category->category_type_id = $global_item_category->category_type_id; $category->status = 1; $category->organization_id = $organization_id; $category->save(); $category_id = $category->id; } $inventory_item = new InventoryItem; $inventory_item->name = $global_item->display_name; $inventory_item->global_item_model_id = $global_item_model_id; $inventory_item->category_id = $category_id; $inventory_item->sku = $request->input('sku'); $inventory_item->hsn = $global_item->hsn; $inventory_item->mpn = $global_item->mpn; $inventory_item->income_account = AccountLedger::where('name', 'sales')->where('organization_id',$organization_id)->first()->id; $inventory_item->expense_account = AccountLedger::where('name', 'purchases')->where('organization_id',$organization_id)->first()->id; $inventory_item->inventory_account = AccountLedger::where('name', 'inventory_asset')->where('organization_id',$organization_id)->first()->id; //$inventory_item->unit_id = ($request->input('unit_id') != null) ? $request->input('unit_id') : null; //$inventory_item->minimum_order_quantity = ($request->input('minimum_order_quantity') != null) ? $request->input('minimum_order_quantity') : null; $inventory_item->tax_id = $tax_id[$i]; $rate_price = $rate[$i]; $inventory_item->purchase_price = Custom::two_decimal($rate_price); $list_price = Custom::two_decimal($rate_price); $inventory_item->sale_price_data = json_encode([["list_price" => $list_price, "discount" => "0", "discount_amount" => "0", "sale_price" => $list_price, "on_date" => $transaction->date]]); $inventory_item->purchase_tax_id = $tax_id[$i]; $inventory_item->organization_id = $organization_id; $inventory_item->save(); Custom::userby($inventory_item, true); Custom::add_addon('records'); $itemId = $inventory_item->id; } else { $itemId = $item_id[$i]; } } $item = new TransactionItem; if($method == "remote") { $item->item_id = $itemId; } else if($method == "store" || $method == "update" || $method == "lowstock") { if($item_id[$i] != null){ $item->item_id = $item_id[$i]; } } if($item_id[$i] != null){ //$item->item_id = $item_id[$i]; //$item->parent_item_id = ($parent_item_id[$i]) ? $parent_item_id[$i] : null; $item->batch_id = ($batch_id[$i]) ? $batch_id[$i] : null; $item->stock_update = ($stock_update) ? $stock_update : 0; $item->description = ($description[$i]) ? $description[$i] : null; $item->duration = ($duration[$i]) ? $duration[$i] : null; $item->quantity = ($quantity[$i]) ? $quantity[$i] : 0.00; $item->rate = ($rate[$i]) ? $rate[$i] : 0.00; $item->amount = ($quantity[$i] && $rate[$i]) ? $quantity[$i]*$rate[$i] : 0.00; if($transaction_type->name == "purchase_order"){ $item->new_selling_price = ($selling_price[$i]) ? $selling_price[$i] : 0.00; }else{ $item->new_selling_price = ($new_selling_price[$i]) ? $new_selling_price[$i] : 0.00; } $item->start_time = ($start_time[$i]) ? $start_time[$i] : null; $item->end_time=($end_time[$i]) ? $end_time[$i] : null; $item->job_item_status = ($job_item_status[$i]) ? $job_item_status[$i] : null; $item->assigned_employee_id = ($assigned_employee_id[$i]) ? $assigned_employee_id[$i] : null; $item->tax_id = ($tax_id[$i]) ? $tax_id[$i] : null; $item->transaction_id = $transaction->id; $item->percentage = ($over_all_discount) ? $over_all_discount : null; $item->save(); $tax_array_text = []; $tax_group = TaxGroup::where('id', $tax_id[$i])->first(); if($discount_id[$i] != null) { $discount_id_value = Discount::where('id', $discount_id[$i])->first(); } if($tax_group != null) { $taxgroups = DB::table('group_tax')->where('group_id', $tax_group->id)->get(); $original_rate = 0; // Include Tax if($tax_type == 1) { $total_tax_value = 0; foreach ($taxgroups as $t) { $taxvalue = Tax::where('id', $t->tax_id)->first(); $total_tax_value += $taxvalue->value; } //Inclusive Tax = Rate * Tax / Tax + 100; //Original Amount = Rate - Inclusive Tax ; $original_rate = $rate[$i] - ($rate[$i] * $total_tax_value / ($total_tax_value + 100) ); } // Exclude Tax else if($tax_type == 2) { //$original_rate = $rate[$i]; $discount_amount=0; if($discount_value[$i]!=null) { $discount_amount = ($discount_value[$i]/100)*($quantity[$i]*$rate[$i]); } elseif($discount_id[$i] != null) { $discount_id_value = Discount::where('id', $discount_id[$i])->first(); $discount_amount = ($discount_id_value[$i]/100)*($quantity[$i]*$rate[$i]); } $original_rate = ($rate[$i] - $discount_amount ); } foreach ($taxgroups as $taxgroup) { $tax_value =Tax::where('id', $taxgroup->tax_id)->first(); if($tax_value->is_percent == 1) { $tax_amount = ($tax_value->value/100)*($quantity[$i]*$original_rate); } else if($tax_value->is_percent == 0) { $tax_amount = $tax_value->value; } //https://www.accountingtools.com/articles/2017/5/15/accounting-for-sales-taxes //https://cleartax.in/s/accounting-entries-under-gst if($tax_amount != 0) { if($transaction_type->name == "purchases" || $transaction_type->name == "credit_note") { //Sales Tax is expense, All expenses are debit //Vendor (Payables) gives the item, Credit the giver $entry[] = ['debit_ledger_id' => $tax_value->purchase_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $tax_amount]; } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "debit_note" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash" ) { //Sales Tax is liability, Liabilities are credit //Customer (Receivables) gets the item, Debit the receiver $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $tax_value->sales_ledger_id, 'amount' => $tax_amount]; } } $total_tax += $tax_amount; $tax_array_text[] = ["id" => $tax_value->id, "name" => $tax_value->display_name, "value" => $tax_value->value, "is_percent" => $tax_value->is_percent, "amount" => $tax_amount]; } //dd($total_tax); $item->is_tax_percent = ($tax_value != null) ? $tax_value->is_percent : null; if(count($tax_array_text) > 0) { $item->tax = json_encode($tax_array_text); } $item->save(); } $discount_json = null; if($discount_id[$i] != null){ if($discount_id_value != null) { if($discount_id_value->is_percent == 1) { $discount_amount = ($discount_value[$i]/100)*($quantity[$i]*$rate[$i]); } else if($discount_id_value->is_percent == 0 && $discount_id_value != null) { $discount_amount = $discount_value[$i]; } $discount_total_amount += $discount_amount; $discount_json = json_encode(["id" => $discount_id_value->id, "name" => $discount_id_value->display_name, "value" => $discount_value[$i], "is_percent" => $discount_id_value->is_percent, "amount" => $discount_amount]); $item_discount_amount = $discount_amount; } } else { $discount_amount = ($discount_value[$i]/100)*($quantity[$i]*$rate[$i]); $discount_total_amount += $discount_amount; $discount_json = json_encode(["id" => null, "name" => "", "value" => $discount_value[$i], "is_percent" => null, "amount" => $discount_amount]); $item_discount_amount = $discount_amount; } $item->discount_id = ($discount_id[$i] != null) ? $discount_id[$i] : null; $item->discount_value = ($discount_value[$i] != null) ? $discount_value[$i] : null; if($discount_id[$i] != null) { $item->is_discount_percent = ($discount_id_value != null) ? $discount_id_value->is_percent : null; } $item->discount = $discount_json; $item->save(); } /* Need Account transaction table - each item amount (with tax )*/ $item_txn_amount = Custom::two_decimal($item->amount + (($tax_type == 1) ? 0 :($total_tax) - ($item_discount_amount))); /*end*/ if($method == "remote") { if($item_id[$i] != null){ $current_item = InventoryItem::find($itemId); } } else if($method == "store" || $method == "update" || $method == "lowstock") { if($item_id[$i] != null){ $current_item = InventoryItem::find($item_id[$i]); } } if($transaction_type->name == "purchases") { $expense_ledger = AccountLedger::where('name', 'purchases')->where('organization_id', $organization_id)->first()->id; $expense_account = ($current_item->expense_account != null) ? $current_item->expense_account : $expense_ledger; //Item is expense, All expenses are debit //Vendor gives the item, Credit the giver if($item->amount != null) { $entry[] = ['debit_ledger_id' => $expense_account, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount]; } if($item_discount_amount != 0) { $discount_ledger = Discount::find($item->discount_id); if($discount_ledger == null) { $discount_ledger_id = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first()->id; } else { $discount_ledger_id = $discount_ledger->purchase_ledger_id; } //Discount is income, All incomes are credit //Vendor loses amount on discount, All expenses are debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount]; } } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash") { $sale_ledger = AccountLedger::where('name', 'sales')->where('organization_id', $organization_id)->first()->id; $income_account = ($current_item->income_account != null) ? $current_item->income_account : $sale_ledger; //dd($item->amount); //Item sale is income, All incomes are credit //Customer gets the item, Debit the receiver if($item->amount != null) { $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $income_account, 'amount' => $item->amount]; } if($item_discount_amount != 0) { if($item->discount_id != null){ $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id; if($discount_ledger_id == null) { $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id; } } if($item->discount_value != null) { $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id; } //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $item_discount_amount]; } } else if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { if($item->id != null){ $sale_ledger = AccountLedger::where('name', 'sales')->where('organization_id', $organization_id)->first()->id; /* Account Transaction table amount now stored without tax , if need with using $item_txn_amount */ $income_account = ($current_item->income_account != null) ? $current_item->income_account : $sale_ledger; //Item sale is income, All incomes are credit //Customer gets the item, Debit the receiver /* Account Transaction table amount now stored without tax , if need with tax amount using $item_txn_amount */ if($item->amount != null) { $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $income_account, 'amount' => $item->amount]; } if($item_discount_amount != 0) { if($item->discount_id != null){ $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id; if($discount_ledger_id == null) { $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id; } } if($item->discount_value != null) { $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id; } //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $item_discount_amount]; } } } else if($transaction_type->name == "credit_note") { $sale_return = AccountLedger::where('name', 'sale_return')->where('organization_id', $organization_id)->first()->id; //Sales Return Account Debit //Debtor or Customer Account Credit if($item->amount != null) { $entry[] = ['debit_ledger_id' => $sale_return, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount]; } if($item_discount_amount != 0) { if($item->discount_id != null){ $discount_ledger = Discount::find($item->discount_id); if($discount_ledger == null) { $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id; } else { $discount_ledger_id = $discount_ledger->purchase_ledger_id; } //Accounts Receivable credit //Discount Allowed debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount]; } } } else if($transaction_type->name == "debit_note") { $purchase_return = AccountLedger::where('name', 'purchase_return')->where('organization_id', $organization_id)->first()->id; //Purchase Return Account Credit //Creditor Account Debit if($item->amount != null) { $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $purchase_return, 'amount' => $item->amount]; } if($item_discount_amount != 0) { if($item->discount_id != null) { $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id; if($discount_ledger_id == null) { $discount_ledger_id = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first()->id; } //Accounts Payable debit //Discount credit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount]; } } } } } /*$transaction->sub_total = $sub_total->sub_total; if($transaction->discount_is_percent == 1) { $discount_transaction = ($transaction->discount/100)*($sub_total->sub_total); } else if($transaction->discount_is_percent == 0) { $discount_transaction = $transaction->discount; } $transaction->discount = $discount_transaction; $transaction->total = ($sub_total->sub_total - ($discount_transaction + $discount_total_amount)) + (($tax_type == 1) ? 0 :($total_tax) - ($advance_amount));*/ $sub_total = DB::table('transaction_items')->select(DB::raw('COALESCE(SUM(amount), 0)+COALESCE(SUM(tax), 0)+COALESCE(SUM(discount), 0) AS sub_total'))->where('transaction_id', $transaction->id)->first(); $sub_total = $sub_total->sub_total; $transaction->sub_total = $sub_total; if($request->input('item_id') != null){ $discount_transaction = ($item->discount_value/100)*($sub_total); } else{ $discount_transaction = 0.00; } $final_amount = $sub_total - $discount_total_amount; if($transaction->discount_is_percent == 1) { $discount_transaction = ($transaction->discount/100)*($sub_total->sub_total); } else if($transaction->discount_is_percent == 0) { //$discount_transaction = $transaction->discount; $transaction->discount = $discount_transaction; } $transaction->discount = $discount_transaction; $transaction->total = Custom::two_decimal($final_amount + (($tax_type == 1) ? 0 :($total_tax) - ($advance_amount))); //$transaction->total = Custom::two_decimal(($final_amount + $total_tax) - $advance_amount); if($transaction_type->name == "sales_cash" || $transaction_type->name == "job_invoice_cash" ) { $transaction->approval_status = 1; } else{ $transaction->approval_status = $request->input('approve'); } $transaction->save(); /* Add on Revenue total */ if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash" ) { if($transaction->approval_status == 1) { Custom::add_revenue('total_revenue', $transaction->total); } } /*End*/ if($transaction_type->name == "purchases" || $transaction_type->name == "credit_note") { if($transaction->discount != null && $transaction->discount != 0) { $discount_ledger = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first(); //Discount is income, All incomes are credit //Vendor loses amount on discount, All expenses are debit $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger->id, 'amount' => $transaction->discount]; } } else if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "debit_note") { /*if($transaction->discount != null && $transaction->discount != 0) { $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first(); //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount]; }*/ } else if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash" || $transaction_type->name == "debit_note") { /*if($transaction->discount != null && $transaction->discount != 0) { $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first(); //Discount is expense, All expenses are debit //Customer gets discount, All incomes are credit $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount]; }*/ } if($transaction_type->name == 'purchases') { if($transaction->approval_status == 1) { if($transaction->term_id != null) { $term = Term::select('name')->where('id',$transaction->term_id)->where('organization_id',Session::get('organization_id'))->first(); $term_name = $term->name; } else { $term_name = 'null'; } if($term_name == 'on_receipt') { $voucher_type = "payment"; $reference_voucher_id = $transaction->id; $payment_mode_id = $transaction->payment_mode_id; $credit_ledger = AccountLedger::select('id')->where('name','=','Cash')->where('organization_id',$organization_id)->first(); $cash_payment = ['voucher_type'=>$voucher_type,'reference_voucher_id'=>$reference_voucher_id,'payment_mode'=>$payment_mode_id,'debit_ledger_id'=>$customer_ledger,'credit_ledger_id'=>$credit_ledger->id,'amount'=>$transaction->total]; } } } usort($entry, function ($item1, $item2) { return $item1['debit_ledger_id'] - $item2['debit_ledger_id']; }); if($transaction_type->name == "purchases" || $transaction_type->name == "credit_note" || $transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "debit_note" || $transaction_type->name == "job_invoice_cash" || $transaction_type->name == "job_invoice") { $getGen_no = Custom::getLastGenNumber( $transaction_type->id, $organization_id,$transaction->id ); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } if($method == "store" || $method == "remote" || $method == "lowstock") { if($transaction_type->name == "purchases") { $transaction->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, null, $transaction_type->name, $organization_id, 1, false, null,$gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id,null,null,$cash_payment); }else { $transaction->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, null, $transaction_type->name, $organization_id, 1, false, null,$gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id,null,null,null); } } else if($method == "update") { if($transaction_type->name == "purchases"){ $transaction->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $transaction->entry_id, $transaction_type->name, $organization_id, 1, false, null, $gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id,null,null,$cash_payment); }else{ $transaction->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $entry, $transaction->entry_id, $transaction_type->name, $organization_id, 1, false, null, $gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id,null,null,null); } } } if($request->input('approve') == 1) { $transaction->approval_status = 1; } $transaction->save(); if($transaction->entry_id != null && $transaction->order_no != null) { $account_entry = AccountEntry::find($transaction->entry_id); $transaction->order_no = $account_entry->voucher_no; $transaction->gen_no = $account_entry->gen_no; $transaction->save(); } else if($transaction->order_no == null) { $getGen_no = Custom::getLastGenNumber( $transaction_type->id, $organization_id,$transaction->id ); //$gen_no = ($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } $transaction->order_no = Custom::generate_accounts_number($transaction_type->name, $gen_no, false); $transaction->gen_no = $gen_no; $transaction->save(); } /* update inventory stock - Save and Approved */ $stock_item_update = TransactionItem::where('transaction_id', $transaction->id)->first(); if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } if($stock_item_update->stock_update == 1 && $transaction->approval_status == 1){ if($method == "store" || $method == "remote" || $method == "lowstock" || $method == "update") { $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::find($item->batch_id); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); $getGen_no = Custom::getLastGenNumber( $transaction_type->id, $organization_id,$transaction->id ); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } if($stock != null) { $inventory_stock = $stock->in_stock - $item->quantity; /*if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; }*/ $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => ($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d H:i:s') : date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $data_entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $data_entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Inventory Stock ledger*/ $model = new InventoryItemStockLedger(); $model->inventory_item_stock_id = $stock->id; $model->inventory_item_batch_id = (isset($inventory_item_batch->id)) ? $inventory_item_batch->id : null; $model->transaction_id = (isset($transaction->id)) ? $transaction->id : null; $model->account_entry_id = (isset($transaction->entry_id)) ? $transaction->entry_id : null; $model->voucher_type = $transaction_type_name->voucher_type; $model->order_no = (isset($transaction->order_no)) ? $transaction->order_no : null; $model->quantity = (isset($t_items->quantity)) ? $t_items->quantity : 0.00; $model->date = (isset($stock->date)) ? $stock->date : date('Y-m-d H:i:s'); $model->in_stock = (isset($stock->in_stock)) ? $stock->in_stock : 0.00; $model->purchase_price = (isset($purchase_tax_price)) ? $purchase_tax_price : 0.00; $model->sale_price = (isset($inventory_item->base_price)) ? $inventory_item->base_price : 0.00; $model->status = 1 ; $model->created_at = (Carbon::now()); $model->save(); /*End*/ /* Item batch */ if($inventory_item_batch != null) { /*if($inventory_item_batch->quantity <= $item->quantity) { $inventory_item_batch->quantity = 0.00; } else{ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; }*/ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; $inventory_item_batch->save(); } /* End */ } } } } } if($transaction_type->name == "delivery_note") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } if($stock_update == 0 && $invoice_approval == 1 && $transaction->approval_status == 1){ if($method == "store" || $method == "remote" || $method == "lowstock" || $method == "update") { $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::find($item->batch_id); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); $getGen_no = Custom::getLastGenNumber( $transaction_type->id, $organization_id,$transaction->id ); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } if($stock != null) { $inventory_stock =$stock->in_stock - $item->quantity; /*if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; }*/ $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => ($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d H:i:s') : date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $data_entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $data_entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Inventory Stock ledger*/ $model = new InventoryItemStockLedger(); $model->inventory_item_stock_id = $stock->id; $model->inventory_item_batch_id = (isset($inventory_item_batch->id)) ? $inventory_item_batch->id : null; $model->transaction_id = (isset($transaction->id)) ? $transaction->id : null; $model->account_entry_id = (isset($transaction->entry_id)) ? $transaction->entry_id : null; $model->voucher_type = $transaction_type_name->voucher_type; $model->order_no = (isset($transaction->order_no)) ? $transaction->order_no : null; $model->quantity = (isset($t_items->quantity)) ? $t_items->quantity : 0.00; $model->date = (isset($stock->date)) ? $stock->date : date('Y-m-d H:i:s'); $model->in_stock = (isset($stock->in_stock)) ? $stock->in_stock : 0.00; $model->purchase_price = (isset($purchase_tax_price)) ? $purchase_tax_price : 0.00; $model->sale_price = (isset($inventory_item->base_price)) ? $inventory_item->base_price : 0.00; $model->status = 1 ; $model->created_at = (Carbon::now()); $model->save(); /*End*/ /* Item batch */ if($inventory_item_batch != null) { /*if($inventory_item_batch->quantity <= $item->quantity) { $inventory_item_batch->quantity = 0.00; } else{ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; }*/ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; $inventory_item_batch->save(); } /* End */ } } } } } if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash" || $transaction_type->name == "debit_note" ) { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } if($transaction->approval_status == 1){ if($method == "store" || $method == "remote" || $method == "lowstock" || $method == "update") { $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::find($item->batch_id); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); /*if($request->gen_no){ $gen_no = $request->gen_no; } else{ $gen_no = null; }*/ $getGen_no = Custom::getLastGenNumber( $transaction_type->id, $organization_id,$transaction->id ); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } if($stock != null) { $inventory_stock = $stock->in_stock - $item->quantity; /*if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock - $item->quantity; }*/ $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); /*$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock];*/ $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => ($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d H:i:s') : date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $data_entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $data_entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Inventory Stock ledger*/ $model = new InventoryItemStockLedger(); $model->inventory_item_stock_id = $stock->id; $model->inventory_item_batch_id =(isset($inventory_item_batch->id)) ? $inventory_item_batch->id : null ; $model->transaction_id = (isset($transaction->id)) ? $transaction->id : null; $model->account_entry_id = (isset($transaction->entry_id)) ? $transaction->entry_id : null; $model->voucher_type = $transaction_type_name->voucher_type; $model->order_no = (isset($transaction->order_no)) ? $transaction->order_no : null; $model->quantity = (isset($t_items->quantity)) ? $t_items->quantity : 0.00; $model->date = (isset($stock->date)) ? $stock->date : date('Y-m-d H:i:s'); $model->in_stock = (isset($stock->in_stock)) ? $stock->in_stock : 0.00; $model->purchase_price = (isset($purchase_tax_price)) ? $purchase_tax_price : 0.00; $model->sale_price = (isset($inventory_item->base_price)) ? $inventory_item->base_price : 0.00; $model->status = 1 ; $model->created_at = (Carbon::now()); $model->save(); /*End*/ /* Item batch */ if($inventory_item_batch != null) { /*if($inventory_item_batch->quantity <= $item->quantity) { $inventory_item_batch->quantity= 0.00; } else{ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; }*/ $inventory_item_batch->quantity = $inventory_item_batch->quantity - $item->quantity; $inventory_item_batch->save(); } /* End */ } } } } } if($transaction_type->name == "purchases") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } if($stock_item_update->stock_update == 1 && $transaction->approval_status == 1){ if($method == "store" || $method == "remote" || $method == "lowstock" || $method == "update") { $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { //if($item->tax_id != null){ //Log::info("TransactionController->CashPurchase :-Iterate".json_encode($item)); $selected_item = InventoryItem::find($item->item_id); $sales_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value')) ->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id') ->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id') ->where('tax_groups.organization_id', $organization_id) ->where('tax_groups.id', $item->tax_id) ->groupby('tax_groups.id') ->first(); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value')) ->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id') ->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id') ->where('tax_groups.organization_id', $organization_id) ->where('tax_groups.id', $item->tax_id) ->groupby('tax_groups.id')->first(); $sale_price_array = json_decode($selected_item->sale_price_data, true); $sale_price = Custom::two_decimal($item->rate); $new_selling_price = $item->new_selling_price; if($new_selling_price != $sale_price){ $new_selling_price = $item->new_selling_price; }else{ $new_selling_price = $sale_price; } if($sales_tax_value != null){ //$update_price = Custom::two_decimal( $new_selling_price / (($sales_tax_value->value/100) + 1)); $tax_amount = Custom::two_decimal(($sales_tax_value->value/100) * ($new_selling_price)); $update_price = Custom::two_decimal($new_selling_price + $tax_amount); }else{ $update_price = Custom::two_decimal( $new_selling_price); } foreach ($sale_price_array as $key => $value) { if($value['on_date'] == $transaction->date) { unset($sale_price_array[$key]); } } $sale_price_data = array_values($sale_price_array); $sale_price_data[] = ["list_price" => $new_selling_price, "discount" => 0, "discount_amount" => 0.00, "sale_price" => $update_price, "on_date" => $transaction->date]; $selected_item->purchase_price = $item->rate; $selected_item->selling_price = $new_selling_price; $selected_item->base_price = $update_price; $selected_item->purchase_tax_id = $item->tax_id; $selected_item->sale_price_data = json_encode($sale_price_data); $selected_item->save(); /* Inventory Stock Update */ $stock = InventoryItemStock::find($item->item_id); //dd($stock); if($selected_item->purchase_tax_id != null) { //dd($selected_item->purchase_tax_id); $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($selected_item->purchase_price)); //dd($purchase_tax_value->value/100); $purchase_tax_price = Custom::two_decimal($selected_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price =$selected_item->purchase_price; } //$inventory_item = InventoryItem::find($item->item_id); $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); if($stock != null) { $inventory_stock = $stock->in_stock + $item->quantity; $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); //$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock]; $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => ($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d H:i:s') : date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $selected_item->base_price,'status' => 1]; $stock->data = json_encode($data); $stock->save(); /* Account Transaction */ $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $data_entry[] = ['debit_ledger_id' => $selected_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $data_entry, $stock->entry_id, $transaction_type_name->voucher_type, $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); /* End */ //$stock->entry_id = Custom::add_entry($stock->date, $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false,null,null,null,null,null,null); $stock->save(); } /* Inventory Stock Update - End */ //$voucher = AccountEntry::where('id',$stock->entry_id)->first(); $voucher_reference = Transaction::find($transaction->reference_id); $batch_date = str_replace('-', '', $transaction->date); $inventory_item_batch = new InventoryItemBatch; $inventory_item_batch->item_id = $item->item_id; $inventory_item_batch->global_item_model_id = $selected_item->global_item_model_id; $inventory_item_batch->batch_number = $batch_date.'/'.$selected_item->id.'/'.$transaction->order_no; $inventory_item_batch->purchase_price = $selected_item->purchase_price; $inventory_item_batch->purchase_plus_tax_price = $purchase_tax_price; $inventory_item_batch->selling_price = $selected_item->selling_price; $inventory_item_batch->selling_plus_tax_price = $selected_item->base_price; $inventory_item_batch->purchase_tax_id = $selected_item->purchase_tax_id; $inventory_item_batch->sales_tax_id = $selected_item->tax_id; $inventory_item_batch->quantity = $item->quantity; $inventory_item_batch->unit_id = $selected_item->unit_id; $inventory_item_batch->transaction_id = $transaction->id; $inventory_item_batch->user_type = $transaction->user_type; $inventory_item_batch->people_id = $transaction->people_id; $inventory_item_batch->organization_id = $organization_id; $inventory_item_batch->save(); Custom::userby($inventory_item_batch, true); /* Inventory Stock ledger*/ $model = new InventoryItemStockLedger(); $model->inventory_item_stock_id = (isset($stock->id)) ? $stock->id : null; $model->inventory_item_batch_id = (isset($inventory_item_batch->id)) ? $inventory_item_batch->id : null; $model->transaction_id = (isset($transaction->id)) ? $transaction->id : null; $model->account_entry_id = (isset($transaction->entry_id)) ? $transaction->entry_id : null; $model->voucher_type = $transaction_type_name->voucher_type; $model->order_no = (isset($transaction->order_no)) ? $transaction->order_no : null; $model->quantity = (isset($t_items->quantity)) ? $t_items->quantity : 0.00; $model->date = (isset($stock->date)) ? $stock->date : date('Y-m-d H:i:s'); $model->in_stock = (isset($stock->in_stock)) ? $stock->in_stock : 0.00; $model->purchase_price = (isset($purchase_tax_price)) ? $purchase_tax_price : 0.00; $model->sale_price = (isset($selected_item->base_price)) ? $selected_item->base_price : 0.00; $model->status = 1 ; $model->created_at = (Carbon::now()); $model->save(); /*End*/ } } } } if($transaction_type->name == "goods_receipt_note") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } if($stock_update == 0 && $invoice_approval == 1 && $transaction->approval_status == 1){ if($method == "store" || $method == "remote" || $method == "lowstock" || $method == "update") { $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { //if($item->tax_id != null){ $selected_item = InventoryItem::find($item->item_id); $sales_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value')) ->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id') ->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id') ->where('tax_groups.organization_id', $organization_id) ->where('tax_groups.id', $item->tax_id) ->groupby('tax_groups.id') ->first(); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value')) ->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id') ->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id') ->where('tax_groups.organization_id', $organization_id) ->where('tax_groups.id', $selected_item->purchase_tax_id) ->groupby('tax_groups.id')->first(); $sale_price_array = json_decode($selected_item->sale_price_data, true); $sale_price = Custom::two_decimal($item->rate); $new_selling_price = $item->new_selling_price; if($new_selling_price != $sale_price){ $new_selling_price = $item->new_selling_price; }else{ $new_selling_price = $sale_price; } if($sales_tax_value != null){ //$update_price = Custom::two_decimal( $new_selling_price / (($sales_tax_value->value/100) + 1)); $tax_amount = Custom::two_decimal(($sales_tax_value->value/100) * ($new_selling_price)); $update_price = Custom::two_decimal($new_selling_price + $tax_amount); }else{ $update_price = Custom::two_decimal( $new_selling_price); } foreach ($sale_price_array as $key => $value) { if($value['on_date'] == $transaction->date) { unset($sale_price_array[$key]); } } $sale_price_data = array_values($sale_price_array); $sale_price_data[] = ["list_price" => $new_selling_price, "discount" => 0, "discount_amount" => 0.00, "sale_price" => $update_price, "on_date" => $transaction->date]; $selected_item->purchase_price = $item->rate; $selected_item->selling_price = $new_selling_price; $selected_item->base_price = $update_price; $selected_item->purchase_tax_id = $item->tax_id; $selected_item->sale_price_data = json_encode($sale_price_data); $selected_item->save(); /* Inventory Stock Update */ $stock= InventoryItemStock::find($item->item_id); if($selected_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($selected_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($selected_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $selected_item->purchase_price; } //$inventory_item = InventoryItem::find($item->item_id); $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); if($stock != null) { $inventory_stock = $stock->in_stock + $item->quantity; $stock->in_stock = $inventory_stock; $stock->date = $transaction->date; $data = json_decode($stock->data, true); //$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock]; $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => ($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d H:i:s') : date('Y-m-d H:i:s'), "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $selected_item->base_price,'status' => 1]; $stock->data = json_encode($data); $stock->save(); /* Account Transaction */ $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $data_entry[] = ['debit_ledger_id' => $selected_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; /* End */ //$stock->entry_id = Custom::add_entry($stock->date, $entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false,null,null,null,null,null,null); $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $data_entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$transaction->gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); } /* Inventory Stock Update - End */ //$voucher = AccountEntry::where('id',$stock->entry_id)->first(); $voucher_reference = Transaction::find($transaction->reference_id); $batch_date = str_replace('-', '', $transaction->date); $inventory_item_batch = new InventoryItemBatch; $inventory_item_batch->item_id = $item->item_id; $inventory_item_batch->global_item_model_id = $selected_item->global_item_model_id; $inventory_item_batch->batch_number = $batch_date.'/'.$selected_item->id.'/'.$transaction->order_no; $inventory_item_batch->purchase_price = $selected_item->purchase_price; $inventory_item_batch->purchase_plus_tax_price = $purchase_tax_price; $inventory_item_batch->selling_price = $selected_item->selling_price; $inventory_item_batch->selling_plus_tax_price = $selected_item->base_price; $inventory_item_batch->purchase_tax_id = $selected_item->purchase_tax_id; $inventory_item_batch->sales_tax_id = $selected_item->tax_id; $inventory_item_batch->quantity = $item->quantity; $inventory_item_batch->unit_id = $selected_item->unit_id; $inventory_item_batch->transaction_id = $transaction->id; $inventory_item_batch->user_type = $transaction->user_type; $inventory_item_batch->people_id = $transaction->people_id; $inventory_item_batch->organization_id = $organization_id; $inventory_item_batch->save(); Custom::userby($inventory_item_batch, true); /* Inventory Stock ledger*/ $model = new InventoryItemStockLedger(); $model->inventory_item_stock_id = $stock->id; $model->inventory_item_batch_id = (isset($inventory_item_batch->id)) ? $inventory_item_batch->id : null; $model->transaction_id = (isset($transaction->id)) ? $transaction->id : null; $model->account_entry_id = (isset($transaction->entry_id)) ? $transaction->entry_id : null; $model->voucher_type = $transaction_type_name->voucher_type; $model->order_no = (isset($transaction->order_no)) ? $transaction->order_no : null; $model->quantity = (isset($t_items->quantity)) ? $t_items->quantity : 0.00; $model->date = (isset($stock->date)) ? $stock->date : date('Y-m-d H:i:s'); $model->in_stock = (isset($stock->in_stock)) ? $stock->in_stock : 0.00; $model->purchase_price = (isset($purchase_tax_price)) ? $purchase_tax_price : 0.00; $model->sale_price = (isset($selected_item->base_price)) ? $selected_item->base_price : 0.00; $model->status = 1 ; $model->created_at = (Carbon::now()); $model->save(); /*End*/ } } } } /* trade - sale return is credit note*/ if($transaction_type->name == "credit_note") { if($transaction->transaction_type_id != null) { $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id') ->where('transactions.transaction_type_id',$transaction->transaction_type_id) ->first(); } if($stock_update == 0 && $invoice_approval == 1 && $transaction->approval_status == 1){ if($method == "store" || $method == "remote" || $method == "lowstock" || $method == "update") { $items = TransactionItem::where('transaction_id', $transaction->id)->get(); foreach ($items as $item) { $stock = InventoryItemStock::find($item->item_id); $inventory_item = InventoryItem::find($item->item_id); $inventory_item_batch = InventoryItemBatch::find($item->batch_id); $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first(); if($inventory_item->purchase_tax_id != null) { $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price)); $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount); } else{ $purchase_tax_price = $inventory_item->purchase_price; } $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)')) ->where('transaction_items.transaction_id', $transaction->id) ->where('transaction_items.item_id', $item->item_id)->first(); /*if($request->gen_no){ $gen_no = $request->gen_no; } else{ $gen_no = null; }*/ $getGen_no = Custom::getLastGenNumber( $transaction_type->id, $organization_id,$transaction->id ); //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first(); //dd($vou_restart_value); if($vou_restart_value->restart == 0) { $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value; Log::info("TransactionController->create :- after if Custom::gen_no - ".$gen_no); } else { $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no; Log::info("TransactionController->create :- after Custom::gen_no - ".$gen_no); } if($stock != null) { $inventory_stock = $stock->in_stock + $item->quantity; /*if($stock->in_stock <= $item->quantity) { $inventory_stock = 0.00; }else{ $inventory_stock = $stock->in_stock + $item->quantity; }*/ $stock->in_stock = $inventory_stock ; $stock->date = $transaction->date; $data = json_decode($stock->data, true); /*$data[] = ["date" => $transaction->date, "in_stock" => $inventory_stock];*/ $data[] = ["transaction_id" => $transaction->id,"entry_id" => $transaction->entry_id,"voucher_type" => $transaction_type_name->voucher_type,"order_no" => $transaction->order_no,"quantity" => $t_items->quantity,"date" => $transaction->date, "in_stock" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1]; $stock->data = json_encode($data); $credit_ledger = AccountLedger::where('name', 'opening_equity')->where('organization_id', $organization_id)->first(); $data_entry[] = ['debit_ledger_id' => $inventory_item->inventory_account, 'credit_ledger_id' => $credit_ledger->id, 'amount' => ($purchase_tax_price * $inventory_stock) ]; $stock->entry_id = Custom::add_entry(($transaction->date != null) ? Carbon::parse($transaction->date)->format('Y-m-d') : date('Y-m-d'), $data_entry, $stock->entry_id, 'stock_journal', $organization_id, 1, false, null,$gen_no, null, $request->input('reference_id'), null, null, $transaction->payment_mode_id); $stock->save(); /* Inventory Stock ledger*/ $model = new InventoryItemStockLedger(); $model->inventory_item_stock_id = $stock->id; $model->inventory_item_batch_id = (isset($inventory_item_batch->id)) ? $inventory_item_batch->id : null; $model->transaction_id = (isset($transaction->id)) ? $transaction->id : null; $model->account_entry_id = (isset($transaction->entry_id)) ? $transaction->entry_id : null; $model->voucher_type = $transaction_type_name->voucher_type; $model->order_no = (isset($transaction->order_no)) ? $transaction->order_no : null; $model->quantity = (isset($t_items->quantity)) ? $t_items->quantity : 0.00; $model->date = (isset($stock->date)) ? $stock->date : date('Y-m-d H:i:s'); $model->in_stock = (isset($stock->in_stock)) ? $stock->in_stock : 0.00; $model->purchase_price = (isset($purchase_tax_price)) ? $purchase_tax_price : 0.00; $model->sale_price = (isset($selected_item->base_price)) ? $inventory_item->base_price : 0.00; $model->status = 1 ; $model->created_at = (Carbon::now()); $model->save(); /*End*/ /* Item batch */ if($inventory_item_batch != null) { $inventory_item_batch->quantity = $inventory_item_batch->quantity + $item->quantity; $inventory_item_batch->save(); } /* End */ } } } } } /* inventory stock update - end */ if($transaction_type->name == "sales_cash") { $cash_transaction_type = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; $cash_entry[] = ['debit_ledger_id' => $cash_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->total]; $cash_transaction_id = null; if($method == "update") { $cash_transaction = AccountEntry::select('account_entries.id') ->leftjoin('account_transactions', 'account_transactions.entry_id', '=', 'account_entries.id') ->where('account_entries.reference_transaction_id', $transaction->id) ->where('account_entries.voucher_id', $transaction_type->id) ->first(); if($cash_transaction != null) { $cash_transaction_id = $cash_transaction->id; } } Custom::add_entry($transaction->date, $cash_entry, $cash_transaction_id, 'receipt', $organization_id, 1, false, null, null, null, $transaction->id, null, null, $transaction->payment_mode_id); } if($transaction_type->name == "sales" && $transaction->approval_status == 1) { $pay_method_id = Term::select('name')->where('id',$request->term_id)->where('organization_id',$organization_id)->first(); $custom_values = OrgCustomValue::select('data1 as data1') ->where('screen','invoice') ->where('organization_id',$organization_id) ->first(); if($pay_method_id != null && $custom_values != null) { if($pay_method_id->name == "on_receipt" && $request->payment_method_id == 1 && $custom_values->data1 == 1) { $cash_transaction_type = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; $cash_entry[] = ['debit_ledger_id' => $cash_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->total]; $cash_transaction_id = null; if($method == "update") { $cash_transaction = AccountEntry::select('account_entries.id') ->leftjoin('account_transactions', 'account_transactions.entry_id', '=', 'account_entries.id') ->where('account_entries.reference_transaction_id', $transaction->id) ->where('account_entries.voucher_id', $transaction_type->id) ->first(); if($cash_transaction != null) { $cash_transaction_id = $cash_transaction->id; } } Custom::add_entry($transaction->date, $cash_entry, $cash_transaction_id, 'receipt', $organization_id, 1, false, null, null, null, $transaction->id, null, null, $transaction->payment_mode_id); } } } if($reference_transaction_type != null && $reference_transaction_type == "sales_cash") { if($transaction_type->name == "debit_note") { $cash_transaction_type = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; //Accounts payable credit //Cash debit $cash_entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $cash_ledger_id, 'amount' => $transaction->total]; if($method == "update") { AccountEntry::select('account_entries.id') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'account_entries.voucher_id') ->where('account_vouchers.name', $transaction_type->name) ->where('account_entries.reference_voucher_id', $transaction->entry_id) ->delete(); } Custom::add_entry($transaction->date, $cash_entry, null, $transaction_type->name, $organization_id, 1, false, null, null, null, $transaction->entry_id); } if($transaction_type->name == "credit_note") { $cash_transaction_type = AccountVoucher::where('name', 'payment')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; //Accounts receivable debit //Cash credit $cash_entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $cash_ledger_id, 'amount' => $transaction->total]; if($method == "update") { AccountEntry::select('account_entries.id') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'account_entries.voucher_id') ->where('account_vouchers.name', $transaction_type->name) ->where('account_entries.reference_voucher_id', $transaction->entry_id) ->delete(); } Custom::add_entry($transaction->date, $cash_entry, null, $transaction_type->name, $organization_id, 1, false, null, null, null, $transaction->entry_id); } } if($transaction_type->name == "job_invoice_cash") { $cash_transaction_type = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; $cash_entry[] = ['debit_ledger_id' => $cash_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->total]; $cash_transaction_id = null; if($method == "update") { $cash_transaction = AccountEntry::select('account_entries.id') ->leftjoin('account_transactions', 'account_transactions.entry_id', '=', 'account_entries.id') ->where('account_entries.reference_transaction_id', $transaction->id) ->where('account_entries.voucher_id', $transaction_type->id) ->first(); if($cash_transaction != null) { $cash_transaction_id = $cash_transaction->id; } } Custom::add_entry($transaction->date, $cash_entry, $cash_transaction_id, 'receipt', $organization_id, 1, false, null, null, null, $transaction->id, null, null, $transaction->payment_mode_id); } if($transaction_type->name == "job_invoice" && $transaction->approval_status == 1) { //dd($transaction_type->name); $pay_method_id = PaymentMode::select('name')->where('id',$request->payment_method_id)->first(); //dd($pay_method_id); if($pay_method_id != null) { //dd($pay_method_id->name.$request->payment_terms); $custom_values = OrgCustomValue::select('data1 as data1') ->where('screen','job_invoice') ->where('organization_id',$organization_id) ->first(); //dd($custom_values); if($request->payment_terms == 1 && $pay_method_id->name == "cash") { if($custom_values != null) { if($custom_values->data1 == 1) { //dd($custom_values); $cash_transaction_type = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; $cash_entry[] = ['debit_ledger_id' => $cash_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->total]; $cash_transaction_id = null; if($method == "update") { $cash_transaction = AccountEntry::select('account_entries.id') ->leftjoin('account_transactions', 'account_transactions.entry_id', '=', 'account_entries.id') ->where('account_entries.reference_transaction_id', $transaction->id) ->where('account_entries.voucher_id', $transaction_type->id) ->first(); if($cash_transaction != null) { $cash_transaction_id = $cash_transaction->id; } } Custom::add_entry($transaction->date, $cash_entry, $cash_transaction_id, 'wms_receipt', $organization_id, 1, false, null, null, null, $transaction->id, null, null, $transaction->payment_mode_id); } } } } } if($reference_transaction_type != null && $reference_transaction_type == "job_invoice_cash") { if($transaction_type->name == "debit_note") { $cash_transaction_type = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; //Accounts payable credit //Cash debit $cash_entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $cash_ledger_id, 'amount' => $transaction->total]; if($method == "update") { AccountEntry::select('account_entries.id') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'account_entries.voucher_id') ->where('account_vouchers.name', $transaction_type->name) ->where('account_entries.reference_voucher_id', $transaction->entry_id) ->delete(); } Custom::add_entry($transaction->date, $cash_entry, null, $transaction_type->name, $organization_id, 1, false, null, null, null, $transaction->entry_id); } if($transaction_type->name == "credit_note") { $cash_transaction_type = AccountVoucher::where('name', 'payment')->where('organization_id', $organization_id)->first(); $cash_ledger_id = AccountLedger::where('name', 'cash')->where('organization_id', $organization_id)->first()->id; $cash_entry = []; //Accounts receivable debit //Cash credit $cash_entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $cash_ledger_id, 'amount' => $transaction->total]; if($method == "update") { AccountEntry::select('account_entries.id') ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'account_entries.voucher_id') ->where('account_vouchers.name', $transaction_type->name) ->where('account_entries.reference_voucher_id', $transaction->entry_id) ->delete(); } Custom::add_entry($transaction->date, $cash_entry, null, $transaction_type->name, $organization_id, 1, false, null, null, null, $transaction->entry_id); } } if($transaction && $vou_restart_values) { if($vou_restart_values->restart == 1) { DB::table('account_vouchers')->where('id',$transaction_type->id)->update(['restart'=> 0, 'last_restarted' => Carbon::now()]); } } $transaction_last = Transaction::select('transactions.id', 'transactions.order_no','transactions.originated_from_id','referenced_in.order_no as jc_order_no', DB::raw("DATE_FORMAT(transactions.date, '%d %b, %Y') as date"), DB::raw("DATE_FORMAT(transactions.due_date, '%d %b, %Y') as due_date"), 'transactions.date as original_date', 'transactions.due_date as original_due_date', 'account_vouchers.name AS transaction_type','transactions.total', DB::raw("DATE_FORMAT(transactions.shipping_date, '%d %b, %Y') as shipping_date"), DB::raw("IF( (transactions.total - SUM(cash_transactions.total)) = 0, '', IF(cash_transactions.id IS NULL, transactions.total, '') ) AS balance"), DB::raw("CASE WHEN (transactions.total - SUM(cash_transactions.total)) = 0 THEN 1 WHEN transactions.due_date < CURDATE() THEN 3 WHEN (transactions.total - SUM(cash_transactions.total)) > 0 THEN 2 ELSE 0 END AS status"), 'transactions.approval_status', 'transactions.transaction_type_id', DB::raw("IF(people.display_name IS NULL, business.display_name, people.display_name) as customer"), DB::raw("IF(people.first_name IS NULL, COALESCE(business.display_name, ''), CONCAT(people.first_name, '', COALESCE(people.last_name, ''))) as customer_contact"), DB::raw("COALESCE(transactions.reference_no, '') AS reference_no"), DB::raw('IF(persons.crm_code IS NULL, businesses.bcrm_code, persons.crm_code) AS code'), DB::raw('COALESCE(reference_vouchers.display_name, "Direct") as reference_type'),'wms_transactions.registration_id','vehicle_register_details.registration_no','hrm_employees.first_name AS assigned_to','service_types.name as service_type','vehicle_jobcard_statuses.name as jobcard_status','wms_transactions.name as name_of_job','wms_transactions.job_date','wms_transactions.job_due_date','wms_transactions.job_completed_date','wms_transactions.advance_amount','transactions.mobile'); $transaction_last->leftJoin('people', function($join) use($organization_id) { $join->on('people.person_id','=', 'transactions.people_id') ->where('people.organization_id', $organization_id) ->where('transactions.user_type', '0'); }); $transaction_last->leftJoin('people AS business', function($join) use($organization_id) { $join->on('business.business_id','=', 'transactions.people_id') ->where('business.organization_id', $organization_id) ->where('transactions.user_type', '1'); }); if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { $receipt_voucher = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first()->id; $transaction_last->leftJoin('transactions AS cash_transactions', function($join) use($organization_id, $receipt_voucher) { $join->on('cash_transactions.reference_id','=', 'transactions.id') ->where('cash_transactions.transaction_type_id', $receipt_voucher); }); } else if($transaction_type->name == "purchases") { $payment_voucher = AccountVoucher::where('name', 'payment')->where('organization_id', $organization_id)->first()->id; $transaction_last->leftJoin('transactions AS cash_transactions', function($join) use($organization_id, $payment_voucher) { $join->on('cash_transactions.reference_id','=', 'transactions.id') ->where('cash_transactions.transaction_type_id', $payment_voucher); }); } else { $transaction_last->leftJoin('transactions AS cash_transactions', 'cash_transactions.reference_id','=', 'transactions.id'); } $transaction_last->leftjoin('job_cards AS referenced_in', 'transactions.originated_from_id', '=', 'referenced_in.id'); $transaction_last->leftjoin('persons', 'people.person_id', '=', 'persons.id'); $transaction_last->leftjoin('businesses', 'business.business_id', '=', 'businesses.id'); $transaction_last->leftJoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id'); $transaction_last->leftjoin('transactions AS reference_transactions','transactions.reference_id','=','reference_transactions.id'); $transaction_last->leftJoin('account_vouchers AS reference_vouchers', 'reference_vouchers.id', '=', 'reference_transactions.transaction_type_id'); $transaction_last->leftJoin('wms_transactions', 'transactions.id', '=', 'wms_transactions.transaction_id'); $transaction_last->leftJoin('vehicle_jobcard_statuses', 'vehicle_jobcard_statuses.id', '=', 'wms_transactions.jobcard_status_id'); $transaction_last->leftJoin('service_types', 'service_types.id', '=', 'wms_transactions.service_type'); $transaction_last->leftjoin('vehicle_register_details', 'vehicle_register_details.id', '=', 'wms_transactions.registration_id'); $transaction_last->leftJoin('hrm_employees', 'hrm_employees.id', '=', 'wms_transactions.assigned_to'); $transaction_last->where('transactions.organization_id', $organization_id); if($transaction_type->name == "sales" || $transaction_type->name == "sales_cash") { $transaction_sales = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id; $transaction_cash = AccountVoucher::where('name', 'sales_cash')->where('organization_id', $organization_id)->first()->id; $transaction_last->where(function ($query) use ($transaction_sales, $transaction_cash) { $query->where('transactions.transaction_type_id', '=', $transaction_sales) ->orWhere('transactions.transaction_type_id', '=', $transaction_cash); }); } else { $transaction_last->where('transactions.transaction_type_id', $transaction_type->id); } if($transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { $transaction_sales = AccountVoucher::where('name', 'job_invoice')->where('organization_id', $organization_id)->first()->id; $transaction_cash = AccountVoucher::where('name', 'job_invoice_cash')->where('organization_id', $organization_id)->first()->id; //$transaction_sales = AccountVoucher::where('name', 'job_invoice')->where('organization_id', $organization_id)->first()->id; //$transaction_cash = AccountVoucher::where('name', 'job_invoice_cash')->where('organization_id', $organization_id)->first()->id; $transaction_last->where(function ($query) use ($transaction_sales, $transaction_cash) { $query->where('transactions.transaction_type_id', '=', $transaction_sales) ->orWhere('transactions.transaction_type_id', '=', $transaction_cash); }); } else { $transaction_last->where('transactions.transaction_type_id', $transaction_type->id); } $transaction_last->where('transactions.id', $transaction->id); $transactions = $transaction_last->first(); $due = Custom::time_difference(Carbon::now()->format('Y-m-d H:i:s'), Carbon::parse($transactions->due_date)->format('Y-m-d H:i:s'), 'd'); $business_name = Session::get('business'); if($modulename == "trade_wms"){ $vehicle_note = $transactions->vehicle_note; if($vehicle_note == null){ $vehicle_note = "No Specific Notes"; }else{ $vehicle_note = $transactions->vehicle_note; } } /* Approved transacation - Send SMS*/ if($transaction->approval_status == 1) { $sms_date =Carbon::now(); $current_date = $sms_date->format('d-m-Y'); $organization_id = session::get('organization_id'); //$id = $request->id; $sms_content_requerment = Transaction::select('vehicle_register_details.registration_no as vehicle_no','transactions.name','transactions.mobile') ->leftjoin('wms_transactions','wms_transactions.transaction_id','=','transactions.id') ->leftjoin('vehicle_register_details','vehicle_register_details.id','=','wms_transactions.registration_id') ->where('transactions.id',$transaction->id)->get(); foreach ($sms_content_requerment as $key => $value) { $vehicle=$value->vehicle_no; $mobile_no=$value->mobile; $customer_name=$value->name; } if($transaction_type->name == "receipt" || $transaction_type->name == "purchases" || $transaction_type->name == "purchase_order" || $transaction_type->name == "sale_order" || $transaction_type->name == "sales" || $transaction_type->name == "sales_cash" || $transaction_type->name == "delivery_note" || $transaction_type->name == "estimation" || $transaction_type->name == "job_request" || $transaction_type->name == "job_card" || $transaction_type->name == "job_invoice" || $transaction_type->name == "job_invoice_cash") { switch ($transaction_type->name) { case 'receipt': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Payment of Rs. ".$transactions->total." for Invoice:".$transactions->order_no." "."Created on"." ".$current_date.""." \n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge ="Receipt"; break; case 'purchase_order': $sms_content = "You have a new purchase order from ".$business_name." for Rs. ".$transactions->total. "\n\n" ."Your Propel ID: ".$transactions->code; $mge ="Purchase Order"; break; case 'purchases': $sms_content = "You have a new purchase from ".$business_name." for Rs. ".$transactions->total. "\n\n" ."Your Propel ID: ".$transactions->code; $mge ="Purchase"; break; case 'sale_order': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Sale Order of Rs. ".$transactions->total." for Sale Order Number:".$transactions->order_no." "."Created on"." ".$current_date.""." \n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge ="Sale Order"; break; case 'estimation': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Estimation of Rs. ".$transactions->total." for Estimation Number:".$transactions->order_no." "."Created on"." ".$current_date.""." \n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge ="Estimation"; break; case 'sales': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Credit Invoice of Rs. ".$transactions->total." for Invoice Number:".$transactions->order_no." "."Created on"." ".$current_date.""." \n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge ="Credit Sale"; break; case 'sales_cash': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Cash Invoice of Rs. ".$transactions->total." for Invoice Number:".$transactions->order_no." "."Created on"." ".$current_date.""." \n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge ="Cash Sale"; break; case 'delivery_note': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Your order for ".$transactions->reference_no. " of Rs. ".$transactions->total." has been delivered. Ref: ".$transactions->order_no. "\n\n" ."Thanks for choosing ".$business_name. "\n\n" ."Your Propel ID: ".$transactions->code; $mge ="Delivery Note"; break; case 'job_card': /*$sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Your Jobcard Number:".$transactions->order_no." "."for vehicle"." "..$vehicle." "."Created on"." ".$current_date." "."."."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code;*/ $url=url('jc_acknowladge/'); $sms_content ="Please note the Jobcard"." ".$transactions->order_no." "."for Vehicle ".$vehicle." "."dated ".$current_date."."."\n\n"."Vehicle Note: ".$vehicle_note."\n\n"."Visit below link for the Status of Job. " . $url . '/' . $transaction->id. '/'.$organization_id; $mge ="Job Card"; break; case 'job_request': $url=url('viewlist/'); $sms_content="Click this link to approve estimation for your vehicle : ".$vehicle." ". $url . '/' . $transaction->id. '/'.$organization_id."\r\n".$customer_name; $mge ="Estimation link "; break; case 'job_invoice': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Credit Invoice of Rs. ".$transactions->total." for Invoice Number:".$transactions->order_no." "."Created on"." ".$current_date." ". "\n\n" ."Vehicle Note: ".$vehicle_note."\n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge = "Invoice"; break; case 'job_invoice_cash': $sms_content = "Dear ".$transactions->customer.",". "\n\n" ."Cash Invoice of Rs. ".$transactions->total." for Invoice Number:".$transactions->order_no." "."Created on"." ".$current_date." ". "\n\n" ."Vehicle Note: ".$vehicle_note."\n\n"."Thanks for choosing"." ".$business_name."."."\n\n"."Your Propel ID: ".$transactions->code; $mge ="Invoice"; break; } if($transactions->mobile != "") { //$msg = Custom::send_transms(config('constants.sms.user'), config('constants.sms.pass'), config('constants.sms.sender'),$mobile_no, $sms_content); Custom::add_addon('sms'); } } } if($transaction->approval_status == 1) { $transaction_message = 'Transaction'.config('constants.flash.added_approved'); }else{ $transaction_message = 'Transaction'.config('constants.flash.added'); } //$transaction_message = 'Transaction'.config('constants.flash.added'); /* End Send SMS */ /*if($method == "remote") { return redirect()->route('transaction.index', $transaction_type->name); } else { $transaction_message = 'Transaction'.config('constants.flash.added'); if($request->input('sms')) { $transaction_message = 'Transaction SMS has been sent!'; } else if($request->input('print')) { $transaction_message = ""; } else if($request->input('approve')) { $transaction_message = 'Transaction approved!'; } else if($request->input('send_po')) { $transaction_message = 'Transaction has been sent!'; } return response()->json(array('status' => 1, 'message' => $transaction_message, 'data' => ['id' => $transactions->id, 'order_no' => $transactions->order_no, 'date' => $transactions->date, 'people' => $transactions->customer, 'people_contact' => $transactions->customer_contact, 'due_date' => ($transactions->due_date != null) ? $transactions->due_date : "", 'transaction_type' => $transactions->transaction_type, 'total' => $transactions->total, 'balance' => $transactions->balance, 'status' => $transactions->status, 'approval_status' => $transactions->approval_status, 'due' => $due])); }*/ // Attachments if($uuid) { $IsExisted=WmsAttachment::where('uuid',$uuid)->exists(); $is_exist_in_complaints = WmsTransactionComplaintService::where('uuid',$uuid)->exists(); if($IsExisted) { DB::table('wms_attachments')->where('uuid',$uuid)->update(['transaction_id'=>$transaction->id]); } if($is_exist_in_complaints) { DB::table('wms_transaction_complaint_services')->where('uuid',$uuid)->update(['transaction_id'=>$transaction->id]); } } // Attachments if($request->input('sms')) { $transaction_message = 'Transaction SMS is successfully sent!'; } else if($request->input('print')) { $transaction_message = ""; } else if($request->input('approve')) { $transaction_message = 'Transaction approved! & SMS Sent'; } else if($request->input('send_po') == 1) { $transaction_message = 'Transaction is successfully sent!'; } else if($request->input('update_goods')) { $transaction_message = 'Items has been updated!'; } if($request->input('update_customer_info') != null) { if($request->input('update_customer_info') == 1) { if($request->people_type == 0) { $stored_date = DB::table('people')->where('user_type',0)->where('organization_id',$organization_id)->where('person_id',$request->people_id)->update(['first_name' => $request->name,'display_name' => $request->name , 'mobile_no' => $request->mobile ,'email_address' => $request->email]); $people_id = People::where('organization_id',$organization_id)->where('user_type',0)->where('person_id',$request->people_id)->first()->id; if($stored_date) { DB::table('people_addresses')->where('people_id',$people_id)->update(['address' => $request->address]); } } if($request->people_type == 1) { $stored_date = DB::table('people')->where('user_type',1)->where('organization_id',$organization_id)->where('business_id',$request->people_id)->update(['company' => $request->name,'display_name' => $request->name ,'mobile_no' => $request->mobile ,'email_address' => $request->email ]); $people_id = People::where('organization_id',$organization_id)->where('user_type',1)->where('business_id',$request->people_id)->first()->id; if($stored_date) { DB::table('people_addresses')->where('people_id',$people_id)->update(['address' =>$request->address ]); } } } } Log::info("TransactionController->store_transaction :- return TRY"); return response()->json(array('status' => 1, 'message' => $transaction_message, 'data' => ['id' => $transactions->id, 'order_no' => $transactions->order_no, 'date' => $transactions->date, 'people' => $transactions->customer, 'people_contact' => $transactions->customer_contact, 'due_date' => ($transactions->due_date != null) ? $transactions->due_date : "", 'transaction_type' => $transactions->transaction_type, 'total' => $transactions->total, 'balance' => $transactions->balance, 'status' => $transactions->status, 'approval_status' => $transactions->approval_status, 'due' => $due,'reference_no'=> $transactions->reference_no,'reference_type' => $transactions->reference_type,'shipping_date' => $transactions->shipping_date,'assigned_to' => $transactions->assigned_to,'registration_id' => $transactions->registration_no,'service_type' => $transactions->service_type,'jobcard_status'=> $transactions->jobcard_status, 'name_of_job'=> $transactions->name_of_job, 'job_date' => $transactions->job_date, 'job_due_date' => $transactions->job_due_date, 'jc_order_no' => $transactions->jc_order_no, 'job_completed_date' => $transactions->job_completed_date,'advance_amount' => ($transactions->advance_amount != null) ? $transactions->advance_amount : "" ])); }); Log::info("TransactionController->store_transaction :- return TRY OUT"); return $result; } catch (\Exception $e) { Log::info("TransactionController->store_transaction :- return Catch"); $error = sprintf('[%s],[%d] ERROR:[%s]', __METHOD__, __LINE__, json_encode($e->getMessage(), true)); Log::info("TransactionController->store_transaction :- return Catch ".$error); return response()->json(['status' => 2, 'error' => $e->getMessage()]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReference():string\n {\n return $reference;\n }", "public function getCreditComment();", "public function getReferenceNumber()\n\t{\n\t return $this->referenceNumber;\n\t}", "public function getReference(){\n return $this->reference;\n }", "public function getReferenceNumber()\n {\n return $this->referenceNumber;\n }", "function SICEKIT_ParserFunctions_ContractRef_Magic(&$magicWords, $langCode) {\n $magicWords['contractref'] = array(0, 'contractref');\n return true;\n}", "public function getCustref()\n {\n return $this->custref;\n }", "public static function generatePaymentRef()\r\n\t {\r\n\t \t// Payment ref is a randomly generates string of 'safechars'\r\n\t\t\t// Stolen from London Hackspace code\r\n\t\t\t$safeChars = \"2346789BCDFGHJKMPQRTVWXY\";\r\n\r\n\t\t\t// We prefix the ref with a string that lets people know it's us\r\n\t\t\t$prefix = 'HSNOTTS';\r\n\r\n\t\t\t// Payment references can be up to 18 chars according to: http://www.bacs.co.uk/Bacs/Businesses/BacsDirectCredit/Receiving/Pages/PaymentReferenceInformation.aspx\r\n\t\t\t$maxRefLength = 16;\r\n\r\n\t\t\t$paymentRef = $prefix;\r\n\t\t\tfor($i = strlen($prefix); $i < $maxRefLength; $i++)\r\n\t\t\t{\r\n\t\t\t\t$paymentRef .= $safeChars[ rand(0, strlen($safeChars) - 1) ];\r\n\t\t\t}\r\n\r\n\t\t\treturn $paymentRef;\r\n\t }", "public function getReference()\r\n {\r\n return $this->reference;\r\n }", "public function getOurReference(): string;", "public function getReference() {\n return $this->reference;\n }", "public function getCardReference()\n {\n return $this->data->creditCard->token;\n }", "function getReference() {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReferenceTo() {}", "public function get_reference() {\n return $this->reference;\n }", "public function getCustomerNote();", "public function getPaymentReference() {\n return isset($this->data['charge']['id']) ? $this->data['charge']['id'] : false;\n }", "public function getRefNo()\n {\n return $this->ref_no;\n }", "public function getReferenceNum()\n {\n return $this->referenceNum;\n }", "public function getObtainFinancialReference()\n {\n return $this->obtainFinancialReference;\n }", "function mbifthen_format_ref( $ref ) {\r\n\t\treturn WC_IfthenPay_Webdados()->format_multibanco_ref( $ref );\r\n\t}", "public function getRefNo()\n {\n return $this->refNo;\n }", "public function getRefNo()\n {\n return $this->refNo;\n }", "public function get_reference()\n\t{\n\t\treturn $this->user->lang(\n\t\t\t'NOTIFICATION_REFERENCE',\n\t\t\t$this->get_data('message_subject')\n\t\t);\n\t}", "function Reference($id)\n {\n \n global $MAIN_TABLE;\n global $NOTES_TABLE;\n\n $q = \"SELECT * FROM `$MAIN_TABLE` WHERE id=$id;\";\n $rows = dbSelect($q, 'Reference()');\n $row = $rows[0];\n $this->id = $id;\n $this->year = $row[1];\n $this->title = $row[3];\n $this->author = $row[2];\n $this->keywords = $row[4];\n $this->html = $row[5];\n $this->bibtex = $row[6];\n\n $q = \"SELECT * FROM `$NOTES_TABLE` WHERE refid=$id ORDER BY timestamp;\";\n $rows = dbSelect($q, 'Bug()');\n $this->notes = array();\n foreach ($rows as $row) {\n $this->notes[] = new Note($row);\n }\n }", "public function getDealReference()\n {\n return $this->dealReference;\n }", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$arrBDAplicar = array('erpplacacentro','erpplacacentro_CAPA','erpplacacentro_DES' );\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode as moneda,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans \n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tINNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON debtortrans.debtorno = custbranch.branchcode\n\t\t\t\tINNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON stockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON stockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n \n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}\n\t\t//descuento\n\t\t$descuento=number_format($descuento,2,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n \n\t\t$moneda=$myrow['currcode'];\n \n\t\t// CANTIDAD CON LETRAS\n\t\t$amount = number_format($myrow['ovamount'],3);\n\t\t$ovgst = number_format($myrow['ovgst'],2);\n\t\t$rountotal = $amount + $ovgst ;\n\t\t$rountotal = number_format($rountotal,2);\n\t\t$totaletras=round($myrow['ovamount']+$myrow['ovgst'],2);\n\n\t\t$totalx=str_replace(',','',$total);\n\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\n\t\t$separa2=explode(\".\",$totalx,4);//\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}//\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=number_format($myrow['cambio'],6,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"99\";\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\t\t\n\t\t\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\n\t\tif (in_array($_SESSION['DatabaseName'], $arrBDAplicar)) {\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t}\n\t\telse{\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\n\t\tif ($imprimepublico==0 || in_array($_SESSION['DatabaseName'], $arrBDAplicar)){\n $colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],4,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=11\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n $descrnarrative = str_replace('|', '-', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\t// consultar cantidad restante para tyqsa en remisones contra orden de trabajo\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";*/\n\t\t\t\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t\n\t\t\t//IF($_SESSION)\n\t\t\t//ECHO $charelectronicdetail;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description']; \n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,2,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal'] - $totalRowAnticipo),6,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal']),6,'.','');\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=number_format($myrow3['taxrate']*($myrow2['subtotal']),6);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t\n\t//echo '<pre><br>'.$cadenaenviada; \n\treturn $cadenaenviada;\n}", "public function referenceAction ()\n {\n $speciesId = (int) $this->getHelper('DataFormatter')->naturalKeyToId($this->_getParam('species'));\n $synonymId = (int) $this->getHelper('DataFormatter')->naturalKeyToId($this->_getParam('synonym'));\n $referenceId = $this->_getParam('id');\n $references = false;\n $sn = false;\n\n $detailsModel = new ACI_Model_Details($this->_db);\n\n if ($referenceId) {\n $ids = explode(',', $referenceId);\n foreach ($ids as $id) {\n $references[] = $detailsModel->getReferenceById($id);\n }\n $preface = $this->getHelper('DataFormatter')->getReferencesLabel(count($ids));\n }\n elseif ($speciesId) {\n $taxa = $detailsModel->getScientificName($speciesId);\n if ($taxa instanceof ACI_Model_Table_Taxa) {\n $references = $detailsModel->getReferencesByTaxonId(\n $taxa->id);\n $numReferences = count($references);\n $preface = $this->getHelper('DataFormatter')->getReferencesLabel(\n $numReferences, $taxa->name);\n }\n }\n elseif ($synonymId) {\n $taxa = $detailsModel->getSynonymName($synonymId);\n if ($taxa instanceof ACI_Model_Table_Taxa) {\n $references = $detailsModel->getReferencesBySynonymId(\n $taxa->id);\n $numReferences = count($references);\n $preface = $this->getHelper('DataFormatter')->getReferencesLabel(\n $numReferences, $taxa->taxaFullName);\n }\n }\n $this->view->title = $this->view->translate('Literature_references');\n $this->view->headTitle($this->view->title, 'APPEND');\n $this->_logger->debug($references);\n $this->view->references = $references;\n $this->view->sn = $sn;\n $this->view->preface = $preface;\n }", "public function getReference() {\n\t\treturn $this->ref;\n\t}", "public function getRFCommande()\n {\n return $this->reference;\n }", "public function getCredit()\n\t{\n\t\treturn $this->credit;\n\t}", "public function getCredit(){\n return $this->priceCurrency->convert($this->getBaseCredit());\n }", "public function getBillingReference()\n {\n return $this->billingReference;\n }", "public function getBillingReference()\n {\n return $this->billingReference;\n }", "public function doReferenceTransaction($ref) {\n\t\t$nvpstr =\n\t\t\t'&REFERENCEID=' . $ref .\n\t\t\t'&AMT=10' .\n\t\t\t'&PAYMENTACTION=Sale&REQCONFIRMSHIPPING=0';\n\n\t\t$this->hash_call('DoReferenceTransaction', $nvpstr);\n\t}", "function Payment ($Amt, $glt, $ref, $cur, $leg, $id, $tipocambio, $conversion, $tag){\n\t\t$this->Amount =$Amt;\n\t\t$this->gltemp = $glt;\n\t\t$this->reference = $ref;\n\t\t$this->currency = $cur;\n\t\t$this->legalname = $leg;\n\t\t$this->ID = $id;\n\t\t$this->tipocambio = $tipocambio;\n\t\t$this->conversion = $conversion;\n\t\t$this->tag = $tag;\n\t}", "function debit($total, $creditCard)\n {\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "public function getOrderReferenceDetails($requestParameters = array());", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans INNER JOIN debtorsmaster ON\n\t\t\t\tdebtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON\n\t\t\t\tdebtortrans.branchcode = custbranch.branchcode\n\t\t\t\tAND debtortrans.debtorno = custbranch.debtorno\n\t\t\t\tINNER JOIN currencies ON\n\t\t\t\tdebtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON\n\t\t\t\tstockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON\n\t\t\t\tstockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento\n\t\t$descuento=FormatNumberERP($myrow['ovdiscount']);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=$myrow['ovamount']+$myrow['ovgst'];\n\t\t$totalx=str_replace(',' ,'', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra, 'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda == 'MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"No Identificado\";\n\t\t}\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\n\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0) {\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=11\n\t\t\t\t \tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\t\t\t\t\t\t\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\t\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\t\n\t\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t//echo '<pre><br>'.$cadenaenviada;\n\treturn $cadenaenviada;\n}", "function makeRef($ota){\n $ref = '';\n $ref = $ota->NPOSNR.'-'.$ota->NJOURNALNR.'-'.$ota->NSERIALNR.'-'.$ota->NPROJNR;\n return $ref;\n }", "function shortcode_reference_get_reference(){\n\t$ShortcodeReferenceUIManager = new ShortcodeReferenceUIManager();\n\t$shortcode = $_POST['shortcode'];\n\t$ShortcodeReferenceUIManager->getReference($shortcode);\t\n}", "function furik_shortcode_order_ref($atts) {\n\t$s = \"\";\n\t$order_ref = \"unknown\";\n\n\tif ($_REQUEST['furik_order_ref'] && furik_order_sign($_REQUEST['furik_order_ref']) == $_REQUEST['furik_check']) {\n\t\t$order_ref = $_REQUEST['furik_order_ref'];\n\t\t$s .= $order_ref;\n\t}\n\n\treturn $s;\n}", "public function getBaseCredit(){\n return $this->creditAccount->getCredit();\n }", "public function getTransactionReference()\n {\n return $this->getDataItem('transactionReference');\n }", "function &act() {\n return $this->reference;\n }", "public function getReferences() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('references'));\n return (is_array($result)) ? reset($result) : $result;\n }", "public function testGetCompleteReferenceNumberWithReferenceNrDisabled()\n {\n $this->slipData->setWithReferenceNumber(false);\n $this->slipData->getCompleteReferenceNumber();\n }", "public function test_generate_reference()\n\t{\n\t\t// reference generator\n\t\t$generator = new phpIso11649;\n\n\t\t// eg: input '5390 0754 7034' should give 'RF18539007547034'\n\t\t$reference = $generator->generateRfReference('5390 0754 7034', false);\n\t\t$this->assertEquals('RF18539007547034', $reference);\n\n\t\t// eg: input 'RF18000000000539007547034' should give 'RF18000000000539007547034'\n\t\t$reference = $generator->generateRfReference('000000000539007547034', false);\n\t\t$this->assertEquals('RF18000000000539007547034', $reference);\n\t}", "public function getCustomerReferenceNumber()\n {\n return isset($this->CustomerReferenceNumber) ? $this->CustomerReferenceNumber : null;\n }", "public function testGetCompleteReferenceNumber()\n {\n // Test with reference number & banking customer ID\n $this->slipData->setReferenceNumber('7520033455900012');\n $this->slipData->setBankingCustomerId('215703');\n\n // Formatted and filled with zeros\n $this->assertEquals(\n '21 57030 00075 20033 45590 00126',\n $this->slipData->getCompleteReferenceNumber()\n );\n // Not formatted but filled with zeros\n $this->assertEquals(\n '215703000075200334559000126',\n $this->slipData->getCompleteReferenceNumber(false)\n );\n // Formatted but not filled with zeros\n $this->assertEquals(\n '21 57030 00075 20033 45590 00126',\n $this->slipData->getCompleteReferenceNumber(true, false)\n );\n // Neither formatted nor filled with zeros\n $this->assertEquals(\n '215703000075200334559000126',\n $this->slipData->getCompleteReferenceNumber(false, false)\n );\n\n // Test with reference number but without banking customer ID\n $this->slipData->setWithBankingCustomerId(false);\n\n // Formatted and filled with zeros\n $this->assertEquals(\n '00 00000 00075 20033 45590 00129',\n $this->slipData->getCompleteReferenceNumber()\n );\n // Not formatted but filled with zeros\n $this->assertEquals(\n '000000000075200334559000129',\n $this->slipData->getCompleteReferenceNumber(false)\n );\n // Formatted but not filled with zeros\n $this->assertEquals(\n '75 20033 45590 00129',\n $this->slipData->getCompleteReferenceNumber(true, false)\n );\n // Neither formatted nor filled with zeros\n $this->assertEquals(\n '75200334559000129',\n $this->slipData->getCompleteReferenceNumber(false, false)\n );\n }", "public function getAccessNote() {\n $fields = array(\n 'accessInformationNote' => array(\n 'accessUrl',\n 'accessUrlDescriptor',\n 'accessUrlDisplay',\n )\n );\n return TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n }", "public function getRefNumber()\n\t{\n\t\treturn $this->get('RefNumber');\n\t}", "function makeRef2($ota){\n $ref = '';\n $ref = $ota->NPOSNO.'-'.$ota->NJOURNALNO.'-'.$ota->NSERIALNO.'-'.$ota->NPROJECTNO;\n return $ref;\n }", "function reference()\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Reference;\n }", "public function getReferenceIdentifier();", "public function getRef()\n {\n return $this->_ref;\n }", "function mREFERENCE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REFERENCE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:601:3: ( '^^' ) \n // Tokenizer11.g:602:3: '^^' \n {\n $this->matchString(\"^^\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function getRef()\n {\n return $this->ref;\n }", "public function confirmOrderReference($requestParameters = array());", "public function getBalanceTransactionReference()\n {\n return $this->getParameter('balanceTransactionReference');\n }", "public function getSource() {\n return $this->getCreditmemo();\n }", "public function getReferenceName()\n {\n return $this->reference_name;\n }", "public function bookCreditBalance($relatedDocNo, $gsaUid, $amount) {\n trace('[METHOD] '.__METHOD__);\n \n $gsaAccTransAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $gsaShopTransAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $freeCreditArr = $gsaAccTransAccessorObj->selectFreeCredits($gsaUid);\n $amountResidual = $amount;\n foreach ($freeCreditArr as $key=>$creditDocNo) {\n \n \n $freeCredit = $gsaShopTransAccessorObj->selectTransactionDocumentData($creditDocNo);\n $freeCreditUpdate = array();\n $credit = bcsub($freeCredit['ENDPRB'],$freeCredit['GUTSCHRIFTZAHLUNG'],$this->precision);\n if (bcsub($credit,$amountResidual,$this->precision) > 0) {\n $freeCreditUpdate['GUTSCHRIFTZAHLUNG'] = bcadd($amountResidual,$freeCredit['GUTSCHRIFTZAHLUNG'] ,$this->precision);\n $amountResidual = 0; \n } else {\n $amountResidual = bcsub($amountResidual,$credit,$this->precision); \n $freeCreditUpdate['GUTSCHRIFTZAHLUNG'] = bcadd($credit,$freeCredit['GUTSCHRIFTZAHLUNG'] ,$this->precision);\n }\n $freeCreditUpdate['LETZTERUSER'] = 'Online-Shop selected by Customer'; // data type: varchar(30)\n $freeCreditUpdate['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n \n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $gsaShopTransAccessorObj->updateTransactionDocument($freeCredit['AUFNR'], $freeCreditUpdate);\n } \n if ($amountResidual <= 0) {\n break;\n }\n \n } \n\n if ($amountResidual > 0) {\n $this->bookPayment($relatedDocNo, bcsub($amount, $amountResidual,$this->precision), 0, false, date('Y-m-d'), $additionalNote='Online-Shop '.$gsaUid, $amount);\n //throw new tx_pttools_exception('There is not enough free credit for this customer', 3);\n } else {\n $this->bookPayment($relatedDocNo, $amount, 0, false, date('Y-m-d'), $additionalNote='Online-Shop Customer:'.$gsaUid, $amount);\n }\n // get related customer object, set booking data\n $customerObj = new tx_ptgsauserreg_customer($gsaUid);\n $bookingDate = date('Y-m-d');\n \n // update the related customer's transaction volume (\"Umsatz\"): ADRESSE.KUMSATZ, KUNDE.UMSATZ, KUNDE.SALDO, KUNDE.LETZTERUMSATZ\n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $customerObj->registerTransactionVolume(0); // saldo and umsatz doesn't change\n }\n }", "function Receipt ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $tag){\n\t\t$this->Amount =$Amt;\n\t\t$this->Customer = $Cust;\n\t\t$this->CustomerName = $CustomerName;\n\t\t$this->Discount = $Disc;\n\t\t$this->Narrative = $Narr;\n\t\t$this->GLCode = $GLCode;\n\t\t$this->PayeeBankDetail=$PayeeBankDetail;\n\t\t$this->ID = $id;\n\t\t$this->tag = $tag;\n\t}", "public function addCreditNote($creditNoteDate, $total, $currency, $idCreditAddress)\n {\n $nowExpr = new Zend_Db_Expr('NOW()');\n\n $data = array(\n 'idCreditNote' => new Zend_Db_Expr('NULL'),\n 'creditNoteDate' => $creditNoteDate,\n 'total' => (float) $total,\n 'currency' => $currency,\n 'idCreditAddress' => (int) $idCreditAddress,\n 'refunded' => (int) 0,\n 'added' => $nowExpr,\n 'updated' => $nowExpr\n );\n\n try {\n $this->insert($data);\n $idInvoice = $this->_db->lastInsertId();\n\n return $idInvoice;\n } catch (Exception $e) {\n throw $e;\n }\n }", "function template_preprocess_stripe_payment_sepa_mandate_info(array &$variables) {\n $payment = $variables['payment'];\n $variables['creditor_id'] = $payment->method->controller_data['creditor_id'];\n $variables['mandate_reference'] = $payment->stripe_sepa['mandate_reference'];\n $variables['iban_last4'] = $payment->stripe_sepa['last4'];\n}", "public function getTransactionReference()\n {\n foreach (['vpc_MerchTxnRef', 'vpc_TransactionNo'] as $key) {\n if (isset($this->data[$key])) {\n return $this->data[$key];\n }\n }\n }", "function testObjReference() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n \r\n\t\t// Create an object to reference\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testGenSave\");\r\n\t\t$oid = $obj->save(false);\r\n\r\n\t\t// Create an activity with the reference\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", null, $this->user);\r\n\t\t$objAct->setValue(\"obj_reference\", \"customer:$oid\");\r\n\t\t$aid = $objAct->save(false);\r\n\t\t$this->assertTrue($aid > 0 );\r\n\t\tunset($objAct);\r\n\r\n\t\t// Close and then open again\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", $aid, $this->user);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n\t\tunset($objAct);\r\n\r\n\t\t// Test with the list cache\r\n\t\t$list = new CAntObjectList($dbh, \"activity\", $this->user);\r\n\t\t$list->addCondition(\"and\", \"id\", \"is_equal\", $aid);\r\n\t\t$list->getObjects();\r\n\t\t$this->assertEquals($list->getNumObjects(), 1);\r\n\t\t$objAct = $list->getObject(0);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n \r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\t$objAct->removeHard();\r\n\t}", "public function getNote();", "public function getRef() {\n return $ref;\n }", "public function get_credit($key = 0)\n {\n }", "function roomify_conversations_add_accommodation_booking_reference_field() {\n field_info_cache_clear();\n\n // \"booking_accommodation_ref\" field.\n if (field_read_field('booking_accommodation_ref') === FALSE) {\n $field = array(\n 'field_name' => 'booking_accommodation_ref',\n 'type' => 'entityreference',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'target_type' => 'bat_booking',\n ),\n );\n field_create_field($field);\n }\n\n // \"booking_accommodation_ref\" field instance.\n if (field_read_instance('bat_booking', 'booking_accommodation_ref', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_accommodation_ref',\n 'entity_type' => 'bat_booking',\n 'label' => 'Accommodation Booking',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'entityreference_autocomplete',\n ),\n );\n field_create_instance($instance);\n }\n}", "public function getSubtotalRefunded();", "public function getFormattedReference() {\n\t\t$parser = $this->parseContent();\n\t\t$items = $parser->reference;\n\t\t$this->processReference($items);\n\t\treturn $items;\n\t}", "public function testGenerateReferenceNumber ()\n\t{\n\t\trequire_once BUILD_ROOT.'/modules/checkout/bpay/module.bpay.php';\n\t\t$bpay = new CHECKOUT_BPAY();\n\n\t\t// Test padding with prefix.\n\t\t$res = $bpay->GenerateReferenceNumber(7, 10, 5);\n\t\t$this->assertEquals(5000000074, $res);\n\n\t\t$res = $bpay->GenerateReferenceNumber(2951);\n\t\t$this->assertEquals(29512, $res);\n\n\t\t// Example from BPAY Q&A..\n\t\t$res = $bpay->GenerateReferenceNumber(272573);\n\t\t$this->assertEquals(2725737, $res);\n\n\t\t// Test alphabet prefix, should ignore.\n\t\t$res = $bpay->GenerateReferenceNumber(272573, '', 'a');\n\t\t$this->assertEquals(2725737, $res);\n\n\t\t// Test leading zeros.\n\t\t$res = (string) $bpay->GenerateReferenceNumber(272573, 10);\n\t\t$this->assertEquals('0002725737', $res);\n\t}", "public function creditCardPayment()\n {\n }", "public function setOrderReferenceDetails($requestParameters = array());", "public function getBaseDiscountRefunded();", "abstract public function isPaymentValid($reference, $expected_naira_amount);", "function roomify_conversations_add_booking_reference_field() {\n field_info_cache_clear();\n\n // \"conversation_booking_ref\" field.\n if (field_read_field('conversation_booking_ref') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_booking_ref',\n 'type' => 'entityreference',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'target_type' => 'bat_booking',\n ),\n );\n field_create_field($field);\n }\n\n // \"conversation_booking_ref\" field instance.\n if (field_read_instance('roomify_conversation', 'conversation_booking_ref', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_booking_ref',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'Booking',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'entityreference_autocomplete',\n ),\n );\n field_create_instance($instance);\n }\n}", "public function reverseProviderCredit($requestParameters = array());", "public static function formatCredit($value)\n {\n $returned_ref = '';\n $ref = str_split($value);\n $i = 0;\n for ($c = count($ref) - 1; $c >= 0 ; $c--) {\n $returned_ref = ($i % 3) === 0 ? @$ref[$c].\" \".$returned_ref : @$ref[$c].$returned_ref;\n $i++;\n }\n return $returned_ref;\n }", "public function isReference()\n {\n return $this->reference;\n }", "public function generateReference()\n {\n $reference = $this->getVoucherFormatter()->format($this->getSequenceStrategy()->nextVal($this->getSlug()));\n \n if(!$this->validateReference($reference)) {\n throw new LedgerException('Generated reference failed to validate, maybe sequence is broken');\n }\n \n return $reference;\n }", "function vistaportal_references_callback($form, $form_state) {\n return $form['references'];\n }", "public function getTransactionReference()\n {\n return $this->transactionReference;\n }", "function ListRefStr($entry, $usage) {\r\n\t\t\r\n\t\t$str = '<span class=\"bibtex-ref bibtex-key-'.$entry['key'].'\">';\r\n\t\t$str .= ($usage['ref'] === false ? $this->UnknownRefStr() : $this->LastNamesStr($entry, 2) . ', ' . $entry['year']);\r\n\t\t$str .= '</span>';\r\n\t\treturn $str;\r\n\t}", "public function getTransactionReference()\n {\n if (empty($this->getOrder()->reference)) {\n return null;\n }\n\n $attributes = $this->getOrder()->reference->attributes();\n\n if (isset($attributes['id'])) {\n return $attributes['id'];\n }\n\n return null;\n }", "public function cercaReferti() {\r\n $fReferto = USingleton::getInstance(\"FReferto\");\r\n return $fReferto->cercaRefertiClinica($this->getPartitaIVAClinica());\r\n }", "function furik_shortcode_payment_info($atts) {\n\t$s = \"\";\n\t$order_ref = \"unknown\";\n\n\tif ($_REQUEST['furik_order_ref'] && furik_order_sign($_REQUEST['furik_order_ref']) == $_REQUEST['furik_check']) {\n\t\t$order_ref = $_REQUEST['furik_order_ref'];\n\t\t$transaction = furik_get_transaction($order_ref);\n\t\t$s .= __('SimplePay reference id', 'furik') . ': ' . $transaction->vendor_ref . \"<br />\";\n\t}\n\n\t$s .= __('Order reference', 'furik') . ': ' . $order_ref . '<br />';\n\t$s .= __('Date', 'furik') . ': ' . date(\"Y-m-d H:i:s\");\n\treturn $s;\n}", "function acf_get_reference($field_name, $post_id)\n{\n}", "protected function addReference()\n {\n $this->add(array(\n 'name' => 'reference',\n 'required' => true,\n 'filters' => array(\n array('name' => 'Zend\\Filter\\HtmlEntities'),\n array('name' => 'Zend\\Filter\\StringTrim'),\n array('name' => 'Zend\\Filter\\StripTags'),\n ),\n ));\n \n return $this;\n }", "public function getCustomerNoteNotify();", "function fn_yandex_checkpoint_get_refunded_order($order_info)\n{\n /** @var \\Tygh\\Addons\\RusTaxes\\ReceiptFactory $receipt_factory */\n $receipt_factory = Tygh::$app['addons.rus_taxes.receipt_factory'];\n\n $receipt = $receipt_factory->createReceiptFromOrder($order_info, CART_PRIMARY_CURRENCY);\n\n if (!$receipt) {\n return $order_info;\n }\n\n foreach ($order_info['products'] as $cart_id => &$product) {\n $receipt_item = $receipt->getItem($cart_id, ReceiptItem::TYPE_PRODUCT);\n\n if ($receipt_item) {\n $product['price'] = $receipt_item->getPrice();\n }\n }\n unset($product);\n\n if (Registry::get('addons.gift_certificates.status') == 'A' && !empty($order_info['gift_certificates'])) {\n foreach ($order_info['certificates'] as $cart_id => &$certificate) {\n $receipt_item = $receipt->getItem($cart_id, ReceiptItem::TYPE_GIFT_CERTIFICATE);\n\n if ($receipt_item) {\n $certificate['amount'] = $receipt_item->getPrice();\n }\n }\n }\n unset($certificate);\n\n $shipping_receipt_item = $receipt->getItem(0, ReceiptItem::TYPE_SHIPPING);\n $surcharge_receipt_item = $receipt->getItem(0, ReceiptItem::TYPE_SURCHARGE);\n\n if ($shipping_receipt_item) {\n $order_info['shipping_cost'] = $shipping_receipt_item->getPrice();\n }\n\n if ($surcharge_receipt_item) {\n $order_info['payment_surcharge'] = $surcharge_receipt_item->getPrice();\n }\n\n /**\n * Executes after prepared order data to refund via Yandex.Checkpoint, allows to modify order content.\n *\n * @param array $order_info Order info\n * @param Receipt $receipt Receipt instance\n */\n fn_set_hook('yandex_checkpoint_get_refunded_order', $order_info, $receipt);\n\n return $order_info;\n}", "public function getRef1() {\n return $this->_ref1;\n }", "public function getFormatedBaseCredit(){\n return $this->formatBasePrice($this->getBaseCredit());\n// $baseCurrency = $this->_storeManager->getStore()->getBaseCurrency();\n// return $baseCurrency->formatPrecision($this->getBaseCredit(),2,[],false);\n }" ]
[ "0.61350095", "0.6033051", "0.6026905", "0.601214", "0.60003287", "0.5998225", "0.59576964", "0.5937737", "0.59151816", "0.5906056", "0.5895023", "0.5861598", "0.5834728", "0.580039", "0.580039", "0.580039", "0.580039", "0.57988876", "0.57937014", "0.57894915", "0.5705075", "0.5695438", "0.5687579", "0.5679433", "0.5676319", "0.5663298", "0.5663298", "0.56465346", "0.5643987", "0.5638584", "0.56371874", "0.5626705", "0.56252486", "0.5616024", "0.5599883", "0.5588913", "0.55832165", "0.55832165", "0.5578889", "0.5573611", "0.5537613", "0.5534797", "0.55190045", "0.55075824", "0.5505147", "0.5502118", "0.54881173", "0.5487246", "0.54798627", "0.5478483", "0.54707295", "0.54653144", "0.54505646", "0.54478985", "0.54284334", "0.5420736", "0.53902733", "0.5383205", "0.5379071", "0.53697205", "0.53669626", "0.5352805", "0.5340242", "0.5328751", "0.53186935", "0.5315787", "0.5315513", "0.5283281", "0.52801555", "0.5267274", "0.5261075", "0.5258992", "0.5258851", "0.5244714", "0.5238154", "0.5237334", "0.5230082", "0.5225785", "0.52131", "0.5210068", "0.5210039", "0.5201752", "0.5165956", "0.5158149", "0.5157865", "0.51297253", "0.5121138", "0.51191074", "0.5111329", "0.5106613", "0.51060283", "0.5095294", "0.50906986", "0.50882727", "0.5083426", "0.50794166", "0.50790507", "0.50786895", "0.5066721", "0.50664353", "0.5066031" ]
0.0
-1
/$data=$request>pdf; dd($data); view()>share('data',$data); PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sansserif']); pass view file $pdf = PDF::loadHTML('hiii'); download pdf return $pdf>download('pdfview.pdf');
public function generte_pdf(Request $request){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pdflistaFacultadesI(){\n $user=user::all();\n $facultades=Facultad::all();\n \n /*return view(\"ues.facultades.listaFacI\",array('user'=>$user,'facultades'=>$facultades));\n\n $pdf = App::make('dompdf.wrapper');\n $view = \\View::make('ues.facultades.listaFacI', compact('user','facultades'))->render();\n $pdf->loadHTML($view)->setPaper('portrait');\n return $pdf->stream('listado_Facultades_Inacivas'.'pdf'); */\n\n $pdf=\\PDF::loadview('ues.facultades.listaFacI', array('user' =>$user, 'facultades' => $facultades))->setPaper('letter','landscape');\n return $pdf->stream('Lista_Facultad_Inactivas.pdf');\n // return $pdf->download('listado de docentes.pdf'); Paper orientation ('portrait' or 'landscape') //Estas son tus opciones\n}", "public function createPDF() {\n $item = Item::all();\n\n // share data to view\n view()->share('items',$item);\n// $options = new Options();\n// $options->set('isRemoteEnabled', true);\n \n $pdf = PDF::loadView('layouts.report.item_report', $item);\n // $pdf->loadHtml($item['layouts.report.item_report']);\n \n // $pdf->set_option('isRemoteEnabled',TRUE);\n \n$pdf->setpaper('A4','landscape', $item);\n // download PDF file with download method\n return $pdf->download('item.pdf');\n }", "public function createPDF() {\n $category = Category::all();\n\n // share data to view\n view()->share('categories',$category);\n\n \n $pdf = PDF::loadView('layouts.report.category_report', $category);\n \n \n $pdf->setpaper('A4','landscape', $category);\n // download PDF file with download method\n return $pdf->download('category.pdf');\n }", "public function cetak_pdf()\n{\n\t$karyawan=Karyawan::all();\n\t$pdf=PDF::loadview('karyawan_pdf',['karyawan'=>$karyawan]);\n\treturn $pdf->download('laporan-karyawan-pdf');\n \t}", "public function pdf() \n {\n $proveedores = Proveedor::all();\n $coment = 'Reporte de proveedores con los datos sin filtrar';\n $pdf = PDF::loadView('pdf.proveedor', compact('proveedores','coment'))->setPaper('letter');//,'landscape' para cambiar la horientacion de la hoja\n return $pdf->stream('proveedor.pdf');//descargar directa \"dawnload\" en lugar de stream\n }", "public function printPDF()\n {\n //$data = [\n // 'title' => 'First PDF for Medium',\n // 'heading' => 'Hello from 99Points.info',\n // 'content' => 'Lorem Ipsum is simply dummy textesetting, remaining essentially unchanged.' \n // ];\n\n $members=Member::all();\n //return view('members.list',compact('members'));\n \n $pdf = PDF::loadView('members.pdf', compact('members')); \n return $pdf->stream('medium.pdf');\n }", "public function createPDF(Request $request) {\n if($request->get('mobil') == 1){\n $data = sewa_kendaraan_pribadi::with('kendaraan_pribadi','User')->where('id',$request->get('id'))->first();\n }else if($request->get('mobil') == 0){\n $data = sewa_kendaraan_umum::with('kendaraan_umum','User')->where('id',$request->get('id'))->first();\n }\n $user_detail = detail_user::with('user')->where('user_id',$data->user->id)->first();\n $mobil =$request->get('mobil');\n \n // share data to view\n $pdf = PDF::loadview('resi', ['data'=>$data , 'mobil'=>$mobil ,'user_detail'=>$user_detail])->stream();\n // download PDF file with download method\n // return $mobil;\n // return $data->kendaraan_umum->harga;\n return view('resi', ['data'=>$data , 'mobil'=>$mobil, 'user_detail'=>$user_detail]);\n\n // return $data;\n }", "public function createPDF() {\n $data = Product::all();\n\n // share data to view\n view()->share('products',$data);\n $pdf = PDF::loadView('admin.pdf.product_pdf', $data);\n\n // download PDF file with download method\n return $pdf->download('pdf_file.pdf');\n }", "function pdf()\n {\n $pdf = \\App::make('dompdf.wrapper');\n $pdf->loadHTML($this->convert_pedido_data_to_html());\n $date = Carbon::now();\n return $pdf->stream('Ventas_diarias_'.$date.'.pdf');\n }", "public function tampil($id)\n{\n // $tamu=\\App\\models\\tamu_model::find($id);\n // return ('export.tampilpdf',['tamu'=>$tamu]);\n\n // // menampilkan pdf \n // $pdf = PDF::loadView('export.tampilkpdf');\n // return $pdf->stream();\n}", "public function pdfview(Request $request)\n {\n if(session('liste') == \"attente\") \n $liste = DB::table('candidats')\n ->where('promo_id', session('promo_id'))\n ->whereIn('liste', ['attente', 'candidat'])\n ->orderby('Nom', 'asc'); \n else\n $liste = DB::table('candidats')->where([['liste', session('liste')], ['promo_id', session('promo_id')]] )->orderby('Nom', 'asc');\n \n view()->share('liste',$liste->get());\n // Set extra option\n \tPDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']);\n \t// pass view file\n $pdf = PDF::loadView('promo.liste');\n // download pdf\n return $pdf->download('liste.pdf');\n\n \n }", "public function createPDF() { \n\n $data = Offre::where('offre', '=', 0)->get();\n view()->share('offres',$data);\n $pdf = PDF::loadView('admin.offre.pdf.stage', $data);\n return $pdf->download('stage_liste.pdf');\n }", "public function pdf(Request $request)\n {\n /**\n * toma en cuenta que para ver los mismos\n * datos debemos hacer la misma consulta\n **/\n\n $id=$request->input('codigoOt');\n\n $ordenDeTrabajoAsignada = ot_orden_trabajo::where('OT_ID','1');\n\n $pdf = PDF::loadView('pdfs.pdfOT', compact('ordenDeTrabajoAsignada'));\n\n return $pdf->download('ot.pdf');\n }", "public function CreatePdf()\n {\n\n if(is_null($this->user) || !$this->user->can('admin.createPdf') ){\n abort('403','You dont have acces!!!!');\n }\n $product=Product::all();\n return view('pdf',compact('product'));\n // $pdf = PDF::loadView('pdf', $product);\n // return $pdf->download('products.pdf');\n // return view('pdf.CreatePdf');\n }", "public function pdflistaFacultades(){\n\n $user=user::all();\n $facultades=Facultad::all();\n \n /* return view(\"ues.facultades.listaFac\",array('persona' =>$persona,'carreras' =>$carreras,'docentes' =>$docentes,'user'=>$user,'departamento'=>$departamento,'facultades'=>$facultades));*/\n\n $pdf=\\PDF::loadview('ues.facultades.listaFac', array('user' =>$user, 'facultades' => $facultades))->setPaper('letter','landscape');\n //$pdf->setOptions('isPhpEnabled', true);\n return $pdf->stream('Lista_Facultad_Activas.pdf');\n }", "public function printdata($id)\n{\n $hardware = hard::with(['customer', 'detail', 'detail.product'])->find($id);\n //LOAD PDF YANG MERUJUK KE VIEW PRINT.BLADE.PHP DENGAN MENGIRIMKAN DATA DARI INVOICE\n //KEMUDIAN MENGGUNAKAN PENGATURAN LANDSCAPE A4\n $pdf = PDF::loadView('invoice.print', compact('invoice'))->setPaper('a4', 'landscape');\n return $pdf->stream();\n}", "function dom_pdf_gen_pdf() {\n $this->load->view($this->router->class.'/dom_pdf_gen_pdf');\n // Get output html\n $html = $this->output->get_output();\n // Load library\n $this->load->library('dompdf_gen');\n // Convert to PDF\n $this->dompdf->load_html($html);\n $this->dompdf->render();\n $this->dompdf->stream(\"mypdf_\" . time() . \".pdf\");\n }", "public function pdf()\n {\n $assets=Assigned::all();\n $pdf=PDF::loadView('dashboard.admin.assets.assignedAssets',['assets'=>$assets]);\n return $pdf->download('assets.pdf');\n }", "public function pdf()\n {\n $this->load->library('Dompdf_gen');\n\n $data['isi_paket'] = $this->Model_promo->getAll('isi_paket')->result();\n\n $this->load->view('admin/isipaket/laporan_pdf', $data);\n\n $paper_size = 'A4';\n $oriantation = 'landscape';\n $html = $this->output->get_output();\n $this->dompdf->set_paper($paper_size, $oriantation);\n\n $this->dompdf->load_html($html);\n $this->dompdf->render();\n $this->dompdf->stream(\"laporan_isi_paket_\".date('Y-m-d_H-i-s').\".pdf\", array('Attachment' => 0));\n }", "public function createPDF($id) {\n $data = \\App\\Rampas::find($id);\n \n $pdf = PDF::loadView('pdf_view', $data);\n \n // download PDF file with download method\n return $pdf->stream('pdf_file.pdf');\n }", "public function printPDF()\n {\n $data = [\n 'title' => 'First PDF for Medium',\n 'heading' => 'Hello from 99Points.info',\n 'content' => \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.\"\n ];\n\n $pdf = PDF::loadView('pdf_view', $data);\n return $pdf->download('medium.pdf');\n }", "public function createPDF() {\n $user=auth()->user();\n $restaurant=$user->restaurant_profile;\n $orders=$user->restaurant_profile->orders;\n \n // share data to view\n view()->share('portal.today_order_report', compact($user, $restaurant, $orders));\n $pdf = PDF::loadView('portal.today_order_report', compact($user, $restaurant, $orders));\n \n // download PDF file with download method\n return $pdf->download('today_report.pdf');\n }", "public function despacho()\n {\n $config=Config::first();\n $productos=Producto::where('status',1)->get();\n $pdf=PDF::loadview('pdf.despacho',compact('productos','config'));\n // $pdf->setPaper(array(0,0,285,10000)); \n $pdf->setPaper ('a4','landscape'); \n return $pdf->stream('despacho.pdf');\n }", "function index()\n {\n $pedido_data = $this->get_pedido_data();\n $date = Carbon::now();\n return view('administrador/dynamic_pdf')->with('pedido_data', $pedido_data)->with('date', $date); //Se envian los datos del informe diario a la vista.\n }", "public function downloadPdf() {\n $file_name = get('name');\n return \\Response::download(temp_path($file_name . '.pdf'));\n }", "public function generatePDF()\n {\n $data = [\n 'title' => 'List of Houses',\n 'company' => 'Real Construction',\n 'date' => date('m/d/Y'),\n 'location' => 'KK 705 St, Kigali',\n 'email' => '[email protected]',\n 'contact' => '+250 788306817',\n 'contact1' => '+250 788314255',\n ];\n \n $products = DB::table('products')->get();\n \n $pdf = PDF::loadView('myPDF', $data, compact('products'));\n \n return $pdf->download('Houseslist.pdf');\n }", "public function pdfDownload()\n {\n try {\n $data = Quotation::get();\n $fileName = 'document.pdf';\n $mpdf = new \\Mpdf\\Mpdf([\n 'margin-left' => 10,\n ]);\n $html = \\View::make('dashboard/quotation/pdf/pdf_download')->with('data', $data);\n $html = $html->render();\n\n // get current date\n $current = Carbon::now()->format('l jS M Y');\n $mpdf->SetHeader($current . '- Netra Back-end -');\n $mpdf->SetFooter('&copy; Copyright -{PAGENO}-');\n $mpdf->WriteHTML($html);\n $mpdf->Output($fileName, 'I');\n } catch (Exception $e) {\n DB::rollBack();\n return redirect()->route('quotation-list')\n ->with('error', 'Quotation can not download!');\n }\n }", "public function pdf()\n {\n $dates = Date::all(); \n\n $pdf = PDF::loadView('products.senreport', compact('dates'));\n\n return $pdf->download('listado.pdf');\n }", "public function downloadPdf($name){\n $file = base_path().'/public/pedidos/pdfs/'.$name;\n\n\n return response()->download($file);\n\n //return Storage::download($file);\n\n }", "public function showbrochure(){\n// 'Content-Type' => 'application/pdf',\n// 'Content-Disposition' => 'inline; filename=swotah_e-brochure.pdf'\n// ]);\n\t\treturn response()->download(storage_path('pdf/swotah_e-brochure.pdf'));\n\t}", "public function pdf(){\n $users = User::all();\n $pdf = PDF::loadView('user.pdf', compact('users'));\n return $pdf->download('listado usuarios.pdf');\n }", "public function generatePDF()\n {\n \t$allclass = Classroom::all();\n\t\tview()->share('allclass',$allclass);\n \n $pdf = PDF::loadView('pdf.classallpdf');\n return $pdf->download('pdf.pdf');\n }", "public function generatePDF()\n {\n\n return view('pdf');\n }", "public function pdfview(Request $request){\n \n $cabinateId = strrev($request->cabinateId); // $paramArray[0];\n $filename = strrev($request->fileName); //$paramArray[1];\n $fileDetails = DB::table('filedetails')\n ->select('filedetails.efilename', 'filedetails.size')->where('name', $filename)->where('cabinet_id', $cabinateId)->get();\n $eFilesize = $fileDetails[0]->size; \n //echo $eFilesize;\n $eFileName = $fileDetails[0]->efilename; // folder with file extenstion in DB\n $extension = explode(\".\", $eFileName);\n //echo $extension[1];\n $eFileNameWOExt = Str::replaceLast($extension[1], '', $eFileName);\n // echo $eFileNameWOExt;\n $fileAtLocation = storage_path().'/app/' .$eFileName.'.enc';\n $user = auth()->user();\n $fileAtPathTo = storage_path().'/app/cabinet_management/Session_file/'.$user->name.'_'.$user->user_id.'/'.$filename.'.enc';\n //echo $fileAtPathTo;\n copy($fileAtLocation, $fileAtPathTo); \n if ($fileAtPathTo) {\n header('Content-type: application/pdf');\n header('Content-Disposition: inline; filename=\"'. $filename .'\"');\n header('Content-Transfer-Encoding: binary');\n header('Accept-Ranges: bytes');\n \n $encryptedFile = 'cabinet_management/Session_file/'.$user->name.'_'.$user->user_id.'/'. $filename.'.enc';\n // echo $encryptedFile;\n\n // Below Code Also works fine\n //$file = file(FileVault::streamDecrypt($sws), \n // Str::replaceLast('.enc', '', $sws)); \n // $file = file(FileVault::streamDecrypt($sws),\n // Str::replaceLast('.enc', '', $sws));\n // readfile($file); \n \n return response()->file(\n FileVault::streamDecrypt($encryptedFile),\n Str::replaceLast('.enc', '', $encryptedFile));\n \n }\n\n }", "public function download()\n {\n $render = view::make('resources\\views\\inquirychart')->render();\n \n $pdf = new Pdf;\n $pdf->addPage($render);\n $pdf->setOptions(['javascript-delay' => 5000]);\n $pdf->saveAs(public_path('report.pdf'));\n \n return response()->download(public_path('report.pdf'));\n }", "public function pdf()\n {\n $pdf = \\App::make('dompdf.wrapper');\n $pdf->loadHTML($this->convert_sales_data_to_html());\n return $pdf->stream();\n }", "public function download_pdf(){\n $this->load->library('Pdf');\n $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);\n $pdf->SetCreator(PDF_CREATOR);\n $pdf->SetAuthor('SchoolERP');\n $pdf->SetTitle('Admission PDF');\n $pdf->SetSubject('Admission Reports in PDF');\n $pdf->SetKeywords('ADMISSION,Report,PDF');\n $pdf->AddPage();\n\n // create some HTML content\n\n $html = '\n <p style=\"font-size: 15px; font-weight: bold; text-align: center\">\n Admission Report\n </p>\n <hr>\n \n \n <div class=\"row\">\n <div class=\"col-lg-12\" id=\"\" style=\"overflow-y:scroll; overflow-x:hidden; height: 400px; width:1200px;\">\n <table class=\"table table-hover table-bordered\" id=\"userTbl\">\n <thead>\n <tr class=\"\">\n <th>Sno.</th>\n <th>Admission No.</th>\n <th>House</th>\n <th>Student Name</th>\n <th>Father</th>\n <th>Mother</th>\n <th>DOB</th>\n <th>Gender</th>\n </tr>\n </thead>\n <tbody>\n </tbody>\n </table>\n </div>\n</div>\n\n\n ';\n\n $pdf->writeHTML($html, true, false, true, false, 'center');\n //Close and output PDF document\n $pdf->output();\n\n }", "public function descargar_pdf(){\n $zonas=Zona::join('colonia','zona.id','=','colonia.id_zona')\n ->join('permiso','permiso.id_colonia','=','colonia.id')\n ->select('zona.*',DB::raw('count(permiso.id)as total'))\n ->groupBy('zona.id')\n ->get();\n\n $pdf=\\PDF::loadView('Pdfs.zonas',compact('zonas'));\n\n return $pdf->stream();\n }", "public function pdf() {\n $arriendos = DB::table('arriendo')->get();\n //Se genera el archive PDF\n $pdf = PDF::loadView('pdf.arriendos', compact('arriendos'));\n //Lo forzamos a iniciar descarga\n return $pdf->download('listado_arriendos.pdf');\n }", "public function employee_pdf()\n {\n\n $this->load->view('backend/admin/employee/employee_pdf');\n }", "public function generatePDF(){\n if (Auth::user()->admin===1) {\n\n $uniqueAwardForNominee = DB::select('SELECT firstName , lastName, category.name AS catName\n , award.name as awardName from nominee LEFT JOIN nomination on nomination.studentNumber = nominee.studentNumber\n INNER JOIN award on nomination.award_id = award.id INNER JOIN category on award.category_id=category.id GROUP by award.id , nominee.studentNumber');\n $pdf = new TCPDF();\n $pdf::SetTitle('Certificates');\n foreach ($uniqueAwardForNominee as $nominee) {\n\n $name = $nominee->firstName.\" \".$nominee->lastName;\n $award = $nominee->awardName.\" \".$nominee->catName;\n\n $data = array( 'name' => $name, 'award' =>$award);\n\n $view = \\View::make('PDF.certificate', $data);\n $html = $view->render();\n //define size and orentation of page\n $pdf::AddPage('L', 'A5'); //l for landscape and P for, you guessed it !\n $pdf::writeHTML($html, true, false, true, false, '');\n\n }\n\n $pdf::Output('Certificates.pdf');\n\n }\n else {\n return view('pages.noAccess');\n }\n }", "public function downloadPdf($id)\n {\n $userId = Auth::id();\n $record = DB::table('records')->select('id')->where([\n ['name', '=', 'projects'],\n ['record_id', '=', $id]\n ])->first();\n $count = DB::table('record_user')->where([\n ['user_id', '=', $userId],\n ['record_id', '=', $record->id],\n ['read', '=', true]\n ])->count();\n $response = [];\n if (!Gate::allows('project-read') && !Auth::user()->administrator && $count == 0){\n $response['status'] = 'error';\n $response['msg'] = 'No estas autorizado';\n return response()->json($response, 403);\n }\n $record = Project::find($id);\n $response['data'] = $record;\n #lee el json setting con los datos de configuracion de form\n $path = storage_path() . \"/settings.json\"; // storage/json/setting_form.json\n $json = json_decode(file_get_contents($path), true); \n $styles=[];\n $styles['width_logo']=$json['width_logo'];\n $styles['color']=$json['color'];\n $forms=array_get($json, 'forms');\n foreach($forms as $form){\n if($form['name']==$this->form_name){\n $form_code=$form['code'];\n $form_title=$form['title'];\n $data = $form['fields'];\n }\n }\n $pdf = \\PDF::loadView('pdf', compact('data','form_name','form_title','form_code','record','styles'));\n $pdf->save(storage_path().'/pdf_files_tmp/'.Auth::user()->id.'.pdf');\n $b64Doc = base64_encode(file_get_contents(storage_path('/pdf_files_tmp/'.Auth::user()->id.'.pdf')));\n $response['form']=$id;\n $response['route']=$b64Doc;\n $response['success'] = true;\n $response['req'] = true;\n return response()->json($response, 200);\n }", "public function pdf($id)\n {\n $controllerInfo = $this->controllerInfo;\n $passport_collection = Customer::with(['submitted_passports'])->withCount('submitted_passports')->findOrFail($id);\n// return view('Admin.passport-collection.pdf', compact('controllerInfo', 'passport_collection'));\n $pdf = PDF::loadView('Admin.passport-collection.pdf', compact('controllerInfo', 'passport_collection'))\n ->setOptions([\n 'defaultPaperSize' => 'A4',\n 'isRemoteEnabled' => true,\n 'isJavascriptEnabled' => true,\n 'isPhpEnabled' => true,\n 'isHtml5ParserEnabled' => true,\n 'fullBase' => true,\n ]);\n return $pdf->stream();\n }", "public function downloadPdf($id) {\n $payslip = Payroll::find($id);\n\n $data = \\View::make('admin.pdf-payslip', compact('payslip'));\n $html = $data->render();\n $pdf = \\App::make('snappy.pdf.wrapper');\n $pdf->loadHTML($html);\n return $pdf->inline();\n\n }", "public function pdf($id)\n {\n $bill = bill::find($id);\n \n // return $bill->transactions;\n $items = BillItem::where('bill_id',$id)->get();\n // return $items;\n $pdf = PDF::loadView('dashboard.bills.pdf', $items);\n\n\n return view('dashboard.bills.pdf',compact('bill','items'));\n\n }", "public function downloadPDF(){\n $classrooms_data = $this->getClassesInformation();\n $pdf = PDF::loadView('pdf', compact('classrooms_data'));\n return $pdf->download('Classrooms Information.pdf');\n }", "public function pdf() {\n $anuncios = DB::table('anuncio')->get();\n //Se genera el archive PDF\n $pdf = PDF::loadView('pdf.anuncios', compact('anuncios'));\n //Lo forzamos a iniciar descarga\n return $pdf->download('listado_anuncios.pdf');\n }", "public function downloadPDF()\n {\n\n $data = DB::table('tbgem_citramite')->select('AMBITO_MUN_CLAVE','Tbgem_cimunicipios.MUN_DESCRIPCION','tbgem_cimunlogos.RUTA')\n ->distinct()\n ->leftJoin('Tbgem_cimunicipios', 'tbgem_citramite.AMBITO_MUN_CLAVE', '=', 'Tbgem_cimunicipios.MUN_CLAVE')\n ->leftJoin('tbgem_cimunlogos', 'tbgem_citramite.AMBITO_MUN_CLAVE','=', 'tbgem_cimunlogos.MUN_CLAVE')\n ->orderBy('Tbgem_cimunicipios.MUN_DESCRIPCION')\n ->get();\n\n\n $pdf = \\PDF::loadView('VistasRetys.Municipios.minucipios',compact('data'));\n\n //$pdf = \\PDF::loadView('Trasnparencia.transparencia', $data);\n\n return $pdf->download('municipios.pdf');\n }", "public function landing()\n {\n // $data = [\n // 'title' => 'Welcome to ItSolutionStuff.com',\n // 'date' => date('m/d/Y')\n // ];\n\n // $pdf = PDF::loadView('myPDF', $data);\n // return $pdf->download('itsolutionstuff.pdf');\n\n // $pdf = PDF::loadView('pdf.document', $data);\n // return $pdf->stream('document.pdf');\n\n //$mpdf = new \\Mpdf\\Mpdf();\n return view('front.pages.landing');\n }", "public function cetakpdf($id)\n {\n $items = Complain::where('user_id', $id)->orderBy('id','DESC')->get();\n $user = User::findOrFail($id);\n //mencetak data tersebut\n $pdf = PDF::loadview('pages.pdf.cetakpdf',['items'=>$items,'user'=>$user]);\n return $pdf->download('laporan-pdf');\n }", "public function Pdf(){\n \n\n// $pdf->writeHTML($html, true, 0, true, 0);\n\n// $pdf->writeHTML($html);\n\n// pdf($html);die;\n\n // 如果是把数据库数据转PDF格式执行以下代码\n // 数据格式只能是字符串\n // $markTable = Db::table('unmark')\n // ->alias('a')\n // ->join('unstudent b', 'a.stu_id=b.stu_id ')\n // ->join('untest c', 'a.test_id = c.test_id')\n // ->join('unteacher d', ' c.tea_id =d.tea_id')\n // ->join('unmajor e', 'b.major_id =e.major_id')\n // ->join('uncourse f', 'c.course_id =f.course_id')\n // ->join('unqbank_type g', 'c.test_type =g.qbank_no')\n // ->select();\n // foreach ($markTable as $data) {\n // $PHPSheet->setCellValue(\"A\" . $i, $data['stu_rollno'])\n // ->setCellValue(\"B\" . $i, $data['stu_name'])\n // ->setCellValue(\"C\" . $i, $data['tea_name'])\n // ->setCellValue(\"D\" . $i, $data['major_name'])\n // ->setCellValue(\"E\" . $i, $data['course_name'])\n // ->setCellValue(\"F\" . $i, $data['test_desc'])\n // ->setCellValue(\"G\" . $i, $data['mark'])\n // ->setCellValue(\"H\" . $i, $data['qbank_type'])\n // ;\n // }\n\n\n // <table class=\"table table-striped table-hover\">\n\t// \t<thead>\n\t// \t\t<tr>\n\t// \t\t\t<th>\\</th>\n\t// \t\t\t<th id=\"stu_rollno\">学号<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"stu_name\">学生姓名<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"major_name\">专业名称<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"course_name\">课程名称<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"tea_name\">教师姓名<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"mark\">测试名称<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"mark\">成绩<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t\t<th id=\"type\">类型<i class=\"fa fa-fw fa-sort-amount-desc\"></i><i class=\"fa fa-fw fa-sort-amount-asc\"></i></th>\n\t// \t\t</tr>\n\t// \t</thead>\n\n\t// \t{volist name=\"markTable\" id=\"mark\" }\n\t// \t<tr>\n\t// \t\t<td>6666</td>\n\t// \t</tr>\n\t// \t{/volist}\n\t// </table>\n$html = <<<EOD\n<h1>该功能正在维护--敬请期待</h1>\n\nEOD;\n\n pdf($html);die;\n \n // //如果是把HTML页面转PDF格式执行以下代码\n // $html = \"http://localhost:8888/tp5/public/examOnlineForteacher/mark/listmark\";\n // $data = file($html);//获取html页面的url\n // pdf($data);die;\n \n }", "public function getpdftanggal(Request $request){\n $realisasi= Realisasi::All();\n $month = $request -> input('bulan');\n $year = $request -> input('tahun');\n\n $realisasi = Realisasi::where(DB::raw('month(tgl_realisasi)'),$month)->where(DB::raw('year(tgl_realisasi)'),$year)->get();\n $realisasi = Realisasi::where(DB::raw('year(tgl_realisasi)'),$year)->get();\n\n $pdf = PDF::loadView('realisasi.pdf',compact('realisasi','month','year'))\n ->setPaper('a4', 'potrait');\n return $pdf->stream('realisasipemesanan.pdf');\n }", "public function index()\n \n{\n\n \n\t$this->pdf=new pdf();\n global $title;\n\n\n\n $this->pdf->AddPage('P','A4',0);\n $this->pdf->SetFont('Arial','B',10);\n $hoy=date(\"dmyhis\");\n \n $this->pdf->Cell(180,19,'ESCUELA DE NATACION',0,1,'C');\n //$this->pdf->Image('upload/c1.jpg',10,10,-900);\n $this->pdf->Image('upload/NATA.png',10,10,-800);\n\n /****** FECHA ********/\n // $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(180,6,'FECHA:',0,1,'L');\n $this->pdf->Ln('0');\n\n $AAA3=$this->input->post('txtPDF3'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(40,4,$AAA3,0,1,'C');\n $this->pdf->Ln('1');\n/****** NOMBRE ********/\n // $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(50,20, 'NOMBRE:',1,0,'C');\n $this->pdf->Ln('0');\n\n $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(180,20,$AAA,1,1,'C');\n $this->pdf->Ln('1');\n\n/****** CONCEPTO ********/\n // $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(50,20, 'CONCEPTO DE:',1,0,'C');\n $this->pdf->Ln('0');\n\n $AAA2=$this->input->post('txtPDF2'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(180,20,$AAA2,1,1,'C');\n $this->pdf->Ln('1');\n\n/****** MENSUALIDAD ********/\n // $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(50,20, 'MENSUALIDAD DEL MES:',1,0,'C');\n $this->pdf->Ln('0');\n\n $AAA1=$this->input->post('txtPDF1'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(180,20,$AAA1,1,1,'C');\n $this->pdf->Ln('8');\n\n\n /********************************/\n \n $this->pdf->Cell(50,20, 'ENTREGADO CONFORME',0,0,'C');\n $this->pdf->Ln('0');\n\n $this->pdf->Cell(250,20,'RECIBIDO CONFORME',0,1,'C');\n $this->pdf->Ln('2');\n\n /*********************************/\n $this->pdf->Cell(180,60,'FECHA:',0,1,'L');\n $this->pdf->Cell(100,1,'FECHA:',0,1,'R');\n //$this->pdf->WriteHTML($AAA,9);\n $this->pdf->Output($pdfFilePath,\"I\");\n/* \n \n $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(200,20,$AAA,0,1,'C');\n $this->pdf->Output($pdfFilePath,\"I\");\n\n\n\n $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(300,30,$AAA,0,1,'R');\n $this->pdf->Output($pdfFilePath,\"I\");\n \n*/\n /* $AAA=$this->input->post('txtPDF'); \n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->load->library('pdf');\n $this->pdf->Cell(180,20,$AAA,1,1,'C');\n $this->pdf->Ln('2');\n*/\n \n\n\n\n/*\n //$pdf=new PDF_HTML();\n //$pdf->SetFont('Arial','',12);\n $pdf->AddPage();\n $pdf->WriteHTML($_POST['text']);\n $pdf->Output();\n*/\n/************************HEADER ****************************\n Arial bold 15\n $this->pdf->SetFont('Arial','B',15);\n // Calculamos ancho y posición del título.\n $w = $this->pdf->GetStringWidth($title)+6;\n $this->pdf->SetX((210-$w)/2);\n // Colores de los bordes, fondo y texto\n $this->pdf->SetDrawColor(0,80,180);\n $this->pdf->SetFillColor(230,230,0);\n $this->pdf->SetTextColor(220,50,50);\n // Ancho del borde (1 mm)\n $this->pdf->SetLineWidth(1);\n // Título\n// $this->pdf->Cell($w,9,$title,1,1,'C',true);\n // Salto de línea\n $this->pdf->Ln(10);\n\n\n\n\n$this->$title = '20000 Leguas de Viaje Submarino';\n//$this->$pdf->SetTitle($title);\n//$this->$pdf->SetAuthor('Julio Verne');\n$this->$pdf->PrintChapter(1,'UN RIZO DE HUIDA','20k_c1.txt');\n$this->$pdf->PrintChapter(2,'LOS PROS Y LOS CONTRAS','20k_c2.txt');\n$this->$pdf->Output();\n\n\n\t\n\t\n\t\t$hoy=date(\"dmyhis\"); \n $this->pdf->AddPage();\n $this->pdf->AliasNbPages();\n $this->pdf->SetTitle(\"recibo\");\n $this->pdf->SetAuthor(\"reciboooooooooo\");\n $this->pdf->SetDrawColor(0,80,180);\n $this->pdf->Cell(50);\n $this->pdf->Cell(1,100,'LISTA dddfffffffffffdddddddddddddd',0,1,'C',1);\n $this->pdf->Ln(10);\n $this->load->view('EST_agregarP','data',true);\n $pdfFilePath=\"cipdf_\".$hoy.\".pdf\";\n $this->pdf->Write(5,'www.fpdf.org','http://www.fpdf.org');\n $this->pdf->Output(\"lista.pdf\",'I');\n\n\t*/\n\n\n // $this->pdf->Cell(180,200,$AAA,0,0,'C','http://localhost/MVC4/034interfaz/index.php/usuarios/mensualidad');\n //$this->pdf->Cell(200,20,$AAA,1,1,'http://localhost/MVC4/034interfaz/index.php/usuarios/mensualidad');\n }", "public function pdf()\r\n {\r\n View::template('pdf/mpdf');\r\n //Modifica el nombre del archivo a descargar\r\n $this->fileName = 'user-list';\r\n //Modifica el título del documento PDF en la cabecera\r\n $this->title = 'User List';\r\n $this->data = User::all();\r\n $this->download = false;\r\n }", "public function PDF($data)\n\t{\n\t\t$filename = \"./assets/files_document/\".$data;\n\n\t\t// Let the browser know that a PDF file is coming.\n\t\theader(\"Content-type: application/pdf\");\n\t\theader(\"Content-Length: \" . filesize($filename));\n\n\t\t// Send the file to the browser.\n\t\treadfile($filename);\n\t\texit;\n\n\t}", "public function pdfac() //vista solo usuarios activos\n {\n $proveedores = Proveedor::orderBy('id','DESC')->where('estado', 'activo')->get();\n $coment = 'Reporte de proveedores activos';\n $pdf = PDF::loadView('pdf.proveedor', compact('proveedores','coment'))->setPaper('letter');//,'landscape' para cambiar la horientacion de la hoja\n return $pdf->stream('proveedores.pdf');//descargar directa \"dawnload\" en lugar de stream\n }", "public function printPDF()\n {\n $abc = Product::all();\n $data = [\n 'title' => 'Generate PDF',\n 'heading' => 'Invoices from UNILUXX',\n 'content' => 'Product',\n 'abc' => $abc\n ];\n\n $pdf = PDF::loadView('pages.pdf_view', $data);\n return $pdf->download('uni-invoice.pdf');\n }", "public function store(Request $request)\n {\n /*\n dd(public_path().\"/images/Layer.png\");\n die;\n */\n $pdf = \\App::make('dompdf.wrapper');\n $customPaper = array(0, 0, 850, 1100);\n $pdf->setPaper($customPaper);\n $pdf->setOptions(['isHtml5ParserEnabled' => true]);\n $pdf->loadView('pdf.pdfview');\n return $pdf->download('generatehtml.pdf');\n\n }", "public function pdf()\n { \n /**\n * toma en cuenta que para ver los mismos \n * datos debemos hacer la misma consulta\n **/\n $query = $this->getDatos();\n\n $pdf = PDF::loadView('reportegraduadospdf', compact('query'));\n\n return $pdf->stream('listado.pdf');\n }", "public function actionPdf()\n {\n $userid = Yii::$app->user->identity->id;\n\n $mahasiswa = VwmahasiswaProdi::find()\n ->where(['user_id' => $userid])\n ->one();\n\n $pengajuanPkl = PengajuanPkl::find()\n ->where(['mhs_id' => $mahasiswa->mhsid])\n ->orderBy(['id' => SORT_DESC])\n ->one();\n\n $mitraPkl = MitraPkl::find()\n ->where(['id' => $pengajuanPkl->mitra_id])\n ->one();\n\n $content = $this->renderPartial('_pdf', [\n 'mahasiswa' => $mahasiswa,\n 'mitraPkl' => $mitraPkl,\n 'model' => LogPkl::find()->where(['pkl_id' => $pengajuanPkl->id])->all(),\n ]);\n\n $pdf = new Pdf([\n 'mode' => Pdf::MODE_UTF8, // leaner size using standard fonts\n 'content' => $content,\n 'cssInline' => '.kv-heading-1{font-size:18px}',\n 'options' => [\n 'title' => 'FERGUSO',\n 'subject' => 'MAGANG GITO LHO'\n ],\n 'methods' => [\n 'SetHeader' => ['STT Terpadu Nurul Fikri||Dibuat: ' . date(\"r\")],\n 'SetFooter' => ['PKL - STT Terpadu Nurul Fikri'],\n ]\n ]);\n return $pdf->render();\n }", "public function pdf() {\n $noSurat = $this->input->post_get('no_surat');\n $data['title'] = \" Surat Pengajuan | Desa Kedung Pengawas\";\n $data['no_surat'] = $noSurat;\n $getPrint = $this->data_pengajuan->get_print($noSurat);\n foreach($getPrint as $p) {\n $tanggal = date(\"Y-m-d\", strtotime($p->created_at));\n \n }\n if($tanggal){\n $data['tgl_surat'] = date_indo($tanggal);\n } else {\n $data['tgl_surat'] = \"\";\n }\n\n $this->load->view('user_page/pengajuan/views/domisili_pdf', $data);\n }", "public function index()\n {\n //\n $params = [\n 'title' => 'Generate PDF',\n ];\n\n return view('pdf.index')->with($params);\n\t\t\n }", "public function proveedor(Request $request){\n try{\n $idAlmacen = \\App\\Almacenes::Where('almacen', '=', $request->id_almacen)->first();\n $proveedor = $request->id_proveedor == '' ? ' 1=1 ' : \" proveedores.id = '\".trim(explode('-', $request->id_proveedor)[0]).\"'\" ;\n $link = 'reporte.proveedorReporte';\n $datos = \\DB::table('movimientos')->join('proveedores', 'movimientos.id_proveedor', '=', 'proveedores.id')\n ->whereIn('movimientos.movimiento', array('INGRESO','INGRESO STOCK') )\n ->where('movimientos.id_gestion', '=', Gestiones::gestion())\n ->where('movimientos.eliminacion', '=', '')\n ->where('movimientos.id_almacen', '=', $idAlmacen->id)\n ->where('movimientos.created_at', '>=', Carbon::parse($request->fecha_inicio) )\n ->where('movimientos.created_at', '<=', Carbon::parse($request->fecha_fin) )\n ->whereRaw($proveedor)\n ->select('movimientos.*', 'proveedores.*')\n ->orderBy('proveedores.proveedor', 'asc')\n ->get();\n $fechaInicio = $request->fecha_inicio;\n $fechaFin = $request->fecha_fin;\n $configuracion = \\DB::table('configuraciones')->first();\n $almacen = \\DB::table('almacenes')->select('almacen')->first();\n\n $pdf = \\PDF::loadView($link, compact('datos', 'configuracion', 'almacen','fechaInicio', 'fechaFin') )\n ->setPaper('letter')->setOrientation('landscape')\n //->setPaper('letter')->setOrientation('portrait')\n ->setOption('page-width', '216mm')\n ->setOption('page-height', '279mm')\n ->setOption('margin-right', '10mm')\n ->setOption('margin-left', '15mm')\n ->setOption('margin-bottom', '15mm')\n ->setOption('header-spacing', 15)\n ->setOption('footer-spacing', 1)\n ->setOption('footer-html', asset('pie.php'));\n\n return $pdf->inline('UnidadAdministrativa_'.date('Ymdhis').'.pdf');\n }catch (Exception $e) {\n return \"<script> alert('Error R0019: Reporte de Unidad Administrativa Global|Resumen \\n\".$e->getMessage().\"'); location.href='\".asset('index.php/Reportes').\"'; </script>\";\n }\n }", "public function dailyReportPdf(Request $request)\n {\n $sdate = date('Y-m-d',strtotime($request->start_date));\n $edate = date('Y-m-d',strtotime($request->end_date));\n $data['alldata'] = Invoice::whereBetween('date',[$sdate,$edate])->where('status','1')->get();\n $data['start_date'] = date('Y-m-d',strtotime($request->start_date));\n $data['end_date'] = date('Y-m-d',strtotime($request->end_date));\n\n $pdf = PDF::loadView('backend.pdf.daily-invoice-report-pdf', $data);\n $pdf->SetProtection(['copy', 'print'], '', 'pass');\n return $pdf->stream('dailyInvoice.pdf');\n }", "public function pdf($form=''){\n $this->load->model('Report');\n $this->Report->downloadpdf($form);\n }", "public function exporttoPDF(Request $request, $id)\n {\n $purchaseInvoices = PurchaseInvoice::with('items')->find($id);\n $pdf = PDF::loadView('pdf-invoice',['purchaseInvoices'=>$purchaseInvoices])->setPaper('a4','portrait');\n $fileName = $purchaseInvoices->kode;\n //kalo mau liat pdfnya matiiin ini\n //return view('pdf-invoice', compact('purchaseInvoices'));\n //nyalain bawahnya\n return $pdf->stream($fileName.'.pdf');\n }", "public function pdf()\n {\n $data['order_users'] = DB::table('guest_details')->get();\n $data['total_amount'] = DB::table('guest_details')->sum('payment_amount');\n $pdf = PDF::loadView('admin.orders_by_promote_users.pdf', $data);\n return $pdf->download('order_list.pdf');\n }", "public function pdf($id, $no_template)\n {\n $bulan = array(\n 1 => 'Januari',\n 'Februari',\n 'Maret',\n 'April',\n 'Mei',\n 'Juni',\n 'Juli',\n 'Agustus',\n 'September',\n 'Oktober',\n 'November',\n 'Desember'\n );\n\n $data = Certificate::where('id',$id)->get();\n $tgl = ($data[0]['tanggal_selesai']);\n $komponen = explode(\"-\",$tgl);\n $tgl_indo = $komponen[2].' '.$bulan[(int) $komponen[1]].' '.$komponen[0];\n\n // html2pdf\n $html2pdf = new Html2Pdf('L','A4','en',false,'UTF-8', array(0,0,0,0));\n\n # mengarahkan view berdasarkan id template dengan format nama file 'certificate_pdf_idTempalteSertifikat.blade.php'\n # Setiap kali mengupload template sertifikat baru, harus menambahkan file view ke 'resources\\views\\content' UNTUK MASING-MASING TEMPLATE KARENA BERBEDA DESIGN.\n # note: penamaan file view sertifikat harus sesuai format 'certificate_pdf_idTempalteSertifikat.blade.php'\n $doc = view('content.certificate_pdf_'.$no_template, compact('data', 'tgl_indo')); \n $html2pdf->pdf->SetTitle('Certificate_'.$data[0]['nama']);\n $html2pdf->setTestIsImage(false);\n $html2pdf->writeHTML($doc, false);\n $html2pdf->Output($data[0]['nama'].\".pdf\",'I');\n // end of hrml2pdf\n\n }", "function pdf(){\n $mpdf = new \\Mpdf\\Mpdf();\n $mpdf->WriteHTML('<h1>Hello world!</h1>');\n // $mpdf->Output();\n $mpdf->Output('files/filename.pdf', \\Mpdf\\Output\\Destination::FILE);\n //$mpdf->Output('filename.pdf', \\Mpdf\\Output\\Destination::DOWNLOAD);\n }", "public function index()\n {\n $model = PDF::all();\n return view('dashboard.pages.pdfs.index')->withModel($model);\n }", "public function clientes2()\n {\n $clientes=Cliente::all();\n\n $config=Config::first();\n $pdf=PDF::loadview('pdf.clientes',compact('clientes','config'));\n // $pdf->setPaper(array(0,0,285,10000)); \n $pdf->setPaper ('a4','landscape'); \n return $pdf->stream('clientes.pdf');\n }", "public function generatePDFOrders(){\n $orders=UserOrder::all();\n $data=['orders'=>$orders];\n $pdf = PDF::loadView('pdf.document',$data);\n return $pdf->stream('document.pdf');\n }", "public function exportPdf($id)\n { \n $phieuxuat = PhieuXuat::where('id', $id)->with(['nhanvien', 'mathang', 'khachhang'])->first();\n // return view('pdf.phieugiaohang', compact('phieuxuat'));\n $DanhSach = [0 => \"Phiếu Xuất Kho\", 1 => 'Phiếu Giao Hàng', 2 => 'Phiếu thanh toán'];\n $tenphieu = $DanhSach[$phieuxuat->TrangThai];\n \n $pdf = PDF::loadView('pdf.phieugiaohang', compact('phieuxuat', 'tenphieu'));\n return $pdf->download('test.pdf');\n }", "public function orderinvoice(Request $request)\n {\n dd($request);\n $order = $request->input('order');\n $orderdes = DB::select(\"select * from orders where id='\" . $order . \"' \");\n $details = DB::select(\"select * from cart where orderid='\" . $order . \"' \");\n\n\n //dd($Jobid);\n $pdf = PDF::loadView('partials.invoiceorder', array('Jobid' => $order, 'order' => $orderdes, 'details' => $details));\n //dd($pdf);\n return $pdf->download($order . '.pdf');\n\n }", "public function index()\n {\n return view(\"pdf.reportes\");\n\n }", "public function actionReport()\n{\n // $content = $this->renderPartial('view');\n //set up the kartik\\mpdf\\Pdf component\n $pdf = new Pdf([\n 'content'=>$this->renderPartial('_reportView'),\n 'mode'=> Pdf::MODE_UTF8,\n 'format'=> Pdf::FORMAT_A4,\n 'orientation'=>Pdf::ORIENT_POTRAIT,\n 'destination'=> Pdf::DEST_BROWSER,\n 'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',\n 'cssInline'=> '.kv-heading-1{font-size:18px}',\n 'options'=> ['title'=> 'Article Card Reports'],\n 'methods'=> [\n 'setHeader'=>['Generated on: '.date(\"r\")],\n 'setFooter'=>['|page {PAGENO}|'],\n ]\n ]);\n return $pdf->render();\n}", "public function DownloadPdf(){\n\n // fetch data from db\n // $this->load->model('admin');\n $result = $this->Allusers_model->getAllUsers();\n //print_r($result);die();\n $this->load->library('Pdf');\n // create new PDF document\n $pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);\n // $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);\n\n // set document information\n $pdf->SetCreator(PDF_CREATOR);\n $pdf->SetAuthor('Bizmo Technologies');\n $pdf->SetTitle('Member Profile');\n $pdf->SetSubject('Member Metromanial Profile');\n $pdf->SetKeywords('MEA, Dakshata Wagh, Bizmo Technologies, Ranjeet Wagh');\n\n // set default header data\n $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);\n\n // set header and footer fonts\n $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));\n $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));\n\n // set default monospaced font\n $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);\n\n // set margins\n $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);\n $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);\n $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);\n\n // set auto page breaks\n $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);\n\n // set image scale factor\n $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);\n\n // set some language-dependent strings (optional)\n if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {\n require_once(dirname(__FILE__).'/lang/eng.php');\n $pdf->setLanguageArray($l);\n }\n\n // ---------------------------------------------------------\n\n // set font\n $pdf->SetFont('helvetica', '', 12);\n\n // add a page\n $pdf->AddPage();\n $fullname='';\n $dob='';\n $marrital_status='';\n $height='';\n $weight='';\n $bgroup='';\n $education_field ='';\n $occupation_type ='';\n $company_name ='';\n $Monthly_income ='';\n $annual_income ='';\n $father_name='';\n $father_occupation ='';\n $mother_name='';\n $mother_occupation='';\n $country='';\n $state='';\n $city='';\n $address='';\n $number1='';\n $number2='';\n $diet='';\n $drink='';\n $smoke='';\n $living_with='';\n $expections='';\n foreach($result['status_message'] as $row){\n // print_r($row);die();\n $fullname = $row['user_fullname'];\n $dob = $row['user_dob'];\n $marrital_status = $row['user_marital_status'];\n $height =$row['user_height'];\n $weight =$row['user_weight'];\n $bgroup =$row['user_blood_grp'];\n $education_field =$row['user_educational_field'];\n $occupation_type =$row['user_occupation_type'];\n $company_name=$row['user_company_name'];\n $Monthly_income =$row['user_monthly_income'];\n $annual_income=$row['user_annual_income'];\n $father_name =$row['user_father_name'];\n $father_occupation =$row['user_father_occupation'];\n $mother_name =$row['user_mother_name'];\n $mother_occupation =$row['user_mother_occupation'];\n $country =$row['user_country'];\n $state =$row['user_state'];\n $city =$row['user_city'];\n $address =$row['user_residential_address'];\n $number1 =$row['user_contact_no1'];\n $number2 =$row['user_contact_no2'];\n $diet =$row['user_diet'];\n $drink=$row['user_drink'];\n $smoke =$row['user_smoke'];\n $living_with =$row['user_living_with'];\n $expections =$row['user_partner_expections'];\n\n \n \n // Set some content to print\n $html = \n '<h3>User Profile:</h3>\n <p>\n <label>Full Name:</label> <span>'.$fullname.'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <label>Date Of Birth:</label> <span>'.$dob.'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <label>Marital status:<span>'.$marrital_status.'</span>\n </p>\n <p>\n <label>Height:</label> <span>'.$height.'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <label>Weight:</label> <span>'.$weight.'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <label>Blood Group:</label> <span>'.$bgroup.'</span>\n </p>\n <p>\n <label>Educational Field:</label> <span>'.$education_field.'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <label>Occupation Type:</label> <span>'.$occupation_type.'</span>\n </p>\n <p>\n <label>Company Name:</label> <span>'.$company_name.'</span>\n </p>\n ';\n } \n // Print text using writeHTMLCell()\n $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);\n\n // column titles\n $header = array('Sr.no', 'Member Name', 'Count', 'Mobile No.' , 'Gender' , 'Time');\n\n // Colors, line width and bold font\n $pdf->SetFillColor(255, 0, 0);\n $pdf->SetTextColor(255);\n $pdf->SetDrawColor(128, 0, 0);\n $pdf->SetLineWidth(0.3);\n $pdf->SetFont('', 'B');\n // Header\n $w = array(15, 70, 15, 35, 25, 25);\n $num_headers = count($header);\n // for($i = 0; $i < $num_headers; ++$i) {\n // $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1);\n // }\n $pdf->Ln();\n // Color and font restoration\n $pdf->SetFillColor(224, 235, 255);\n $pdf->SetTextColor(0);\n $pdf->SetFont('');\n // Data\n $fill = 0;\n $count=1;\n // if($result['status']=='500'){\n // //print_r($row);\n // $pdf->Cell($w[0], 6, 'N/A', 'LR', 0, 'C', $fill);\n // $pdf->Cell($w[1], 6, 'N/A', 'LR', 0, 'C', $fill);\n // $pdf->Cell($w[2], 6, 'N/A', 'LR', 0, 'C', $fill);\n // $pdf->Cell($w[3], 6, 'N/A', 'LR', 0, 'C', $fill);\n // $pdf->Cell($w[4], 6, 'N/A', 'LR', 0, 'C', $fill);\n // $pdf->Cell($w[5], 6, 'N/A', 'LR', 0, 'C', $fill);\n // $pdf->Ln();\n // $fill=!$fill;\n // }\n // else{\n // foreach($result['status_message'] as $row) {\n // $valid_date = date( 'd M, Y', strtotime($row['dated']));\n // $valid_time = date( 'h:i a', strtotime($row['time']));\n \n // //now do borders and fill\n // //cell height is 6 times the max number of cells\n // $pdf->Cell($w[0],6,$count.'.','LR', 0, 'C', $fill);\n // $pdf->Cell($w[1],6,$row['member_name'],'LR', 0, 'C', $fill);\n // $pdf->Cell($w[2],6,$row['accomp_count'],'LR', 0, 'C', $fill);\n // $pdf->Cell($w[3],6,$row['mobile_no'],'LR', 0, 'C', $fill);\n // $pdf->Cell($w[4],6,$row['gender'],'LR', 0, 'C', $fill);\n // $pdf->Cell($w[5],6,$valid_time,'LR', 0, 'C', $fill);\n\n // $pdf->Ln();\n // //print_r($row);\n \n // $fill=!$fill;\n\n // $count++;\n // } \n // }\n \n $pdf->Cell(array_sum($w), 0, '', 'T');\n // ---------------------------------------------------------\n\n // close and output PDF document\n \n $tarikh = date('Ydm h:i:s a', time());\n $pdf->Output('MEAEventList_'.$tarikh.'.pdf', 'I');\n }", "public function report_dosen(){\n\t\t$data['data'] = $this->m_aka->ambil_data_dosen();\n\t\t$output = $this->load->view(\"report/report_dosen\", $data, true);\n\t\t//$this->load->view(\"report/report_transkrip\",$data);\n\t\treturn $this->_gen_pdf($output,\"A4\",\"P\");\n\t}", "function pdf_save_in_server($html,$pdf_name) \n{\n$dompdf = new Dompdf();\n$dompdf->loadHtml($html);\n\n// (Optional) Setup the paper size and orientation\n$dompdf->setPaper('A4', 'landscape');\n\n// Render the HTML as PDF\n$dompdf->render();\n\n$pdf = $dompdf->output();\n\n$file_location = \"/home/safety/public_html/Report_pdf/\".$pdf_name.\".pdf\";\nfile_put_contents($file_location,$pdf);\n\n// Output the generated PDF to Browser\n$dompdf->stream();\n}", "function pdf_save_in_server_for_json($html,$pdf_name) \n{\n$dompdf = new Dompdf();\n$dompdf->loadHtml($html);\n\n// (Optional) Setup the paper size and orientation\n$dompdf->setPaper('A4', 'landscape');\n\n// Render the HTML as PDF\n$dompdf->render();\n\n$pdf = $dompdf->output();\n\n$file_location = \"/home/safety/public_html/uploads/pdf/\".$pdf_name.\".pdf\";\nfile_put_contents($file_location,$pdf);\n\n// Output the generated PDF to Browser\n//$dompdf->stream();\n}", "public function print($id_hard){\n // $hardware = DB::table('hardware')->where('id_hard',$id_hard)->first();\n $hardware = DB::table('hardware as a')\n ->select('a.*', 'b.nama_client', 'c.nama_its')\n ->join('client as b', 'b.id_client', 'a.i_client')\n ->join('its as c', 'c.id_its', 'a.h_its')\n ->where('a.id_hard',$id_hard)\n ->get(); \n $hardware2 = DB::table('dhard as a')\n ->select('a.*', 'b.nama_status', 'c.nama_progress')\n ->join('status as b', 'b.id_status', 'a.i_status')\n ->join('progress as c', 'c.id_progress', 'a.i_prog')\n ->where('a.id_hard', $id_hard)\n ->get(); \n // passing data yang did_hardwareapat ke view edit.blade.php\n $pdf = PDF::loadView('report/print_hard', compact('hardware','hardware2'))->setPaper('a4', 'landscape');\n return $pdf->stream();\n }", "public function scheduled_pdf( Request $request ) {\n\t\t$id = $request->input( 'id' );\n\t\t// $pdf = PDF::loadView(\n\t\t// \t'admin.invoice.Voucher',\n\t\t// \t[\n\t\t// \t\t'user' => $id, // user,\n\t\t// \t]\n\t\t// );\n\t\t$pdf = PDF2::loadView( 'admin.invoice.Voucher', [ 'asdf' => '2' ] )\n\t\t\t->setOption( 'margin-bottom', 0 )\n\t\t\t->setOption( 'page-width', '170' )\n\t\t\t->setOption( 'page-height', '324' );\n\n\t\t// $pdf->save(storage_path().rand().'filename.pdf');\n\t\treturn $pdf->download( 'voucher.pdf' );\n\t}", "public function scheduled_pdf( Request $request ) {\n\t\t$id = $request->input( 'id' );\n\t\t// $pdf = PDF::loadView(\n\t\t// \t'admin.invoice.Voucher',\n\t\t// \t[\n\t\t// \t\t'user' => $id, // user,\n\t\t// \t]\n\t\t// );\n\t\t$pdf = PDF2::loadView( 'admin.invoice.Voucher', [ 'asdf' => '2' ] )\n\t\t\t->setOption( 'margin-bottom', 0 )\n\t\t\t->setOption( 'page-width', '170' )\n\t\t\t->setOption( 'page-height', '324' );\n\n\t\t// $pdf->save(storage_path().rand().'filename.pdf');\n\t\treturn $pdf->download( 'voucher.pdf' );\n\t}", "public function pdf_paquete($url_key,$tipo='P') {\n if($this->session->userdata('s_busqueda_paquetes')){\n $data['busqueda_info'] = $this->session->userdata('s_busqueda_paquetes');\n }\n\n // boost the memory limit if it's low ;)\n /*ini_set('memory_limit','32M'); */\n\n //Consultar servicio\n $data_where = array('url_key' => $url_key);\n $resultado = $this->Paquetes->get_row($data_where);\n $data['post'] = $resultado;\n\n $url_servicio = base_url() . 'paquete-tour/' . $resultado['url_key'];\n $servicio = array(\n 'nombre_servicio' => $resultado['nombre'],\n 'descripcion_servicio' => $resultado['detalles'],\n 'url_servicio' => $url_servicio,\n 'itinerario' => $resultado['itinerarios']\n );\n\n $data['servicio'] = $servicio;\n $data['website'] = $this->Inicio->get_website();\n $cabeceras_email = $this->config->item('waemail');\n $cabeceras_email['titulo_email_admin'] = $servicio['nombre_servicio'];\n $data['cabeceras'] = $cabeceras_email;\n\n // render the view into HTML\n $data['titulo'] = $servicio['nombre_servicio'];\n\n //\n $file_name_pdf = $resultado['url_key'] . '.pdf';\n $html = $this->load->view('paginas/pdf/pdf_paquete', $data, true);\n /*die();*/\n\n $this->load->library('mimpdf');\n\n $pdf = $this->mimpdf->load();\n\n // Add a footer for good measure ;)\n $pdf->SetFooter($_SERVER['HTTP_HOST'].'|{PAGENO}|'.date(\"d/m/Y H:i\"));\n\n // write the HTML into the PDF\n $pdf->WriteHTML($html);\n\n //Formas de pago (página)\n if(!empty($resultado['formas_pago_id'])){\n $data_pagina = array('id' => $resultado['formas_pago_id']);\n $data['formas_pago'] = $this->Paginas->get_row($data_pagina);\n $html_formas_pago = $this->load->view('paginas/pdf/pdf_formas_pago', $data, true);\n $pdf->AddPage();\n $pdf->WriteHTML($html_formas_pago);\n }\n\n // save to file because we can\n $pdf->Output($file_name_pdf, 'D');\n\n }", "public function abiertasPDF2()\n {\n // instantiate and use the dompdf class\n $dompdf = new Dompdf();\n $solicitudes = Solicitud::orderBy('id', 'DESC')->where('estatus',1)->get();\n ob_start();\n include('app/admin/views/reportes/abiertas.php');\n\n $dompdf->loadHtml(ob_get_clean());\n // (Optional) Setup the paper size and orientation\n $dompdf->setPaper('letter', 'landscape');\n // Render the HTML as PDF\n $dompdf->render();\n\n // Output the generated PDF to Browser\n $dompdf->stream();\n }", "public function articulos(){\n \n $articulos=Articulo::get();\n \n $pdf=PDF::loadview('pdf.articulos',compact('articulos'));\n return $pdf->stream('Articulos-SIS.pdf');\n }", "public function pdf($id)\n {\n $repair2 = DB::table('repair')\n ->select('repair.id', 'repair.client_id', 'repair.marca_modelo', 'repair.datos', 'repair.descripcion', 'repair.estado', 'clients.name', 'clients.last_name', 'clients.email', 'clients.telefono', 'clients.cuit_cuil')\n ->join('clients', 'clients.id', '=', 'repair.client_id')\n ->where('repair.id', $id)\n ->get();\n\n $pdf = \\PDF::loadView('panel.ejemplo', compact('repair2'));\n return $pdf->stream($id.'.pdf');\n }", "public function downloadPDFPemesanan($id_transaksi){\n $data = TransaksiPemesanan::where('id_transaksi', '=', $id_transaksi)->get();\n $no = 0;\n $pemesanan = PemesananPembayaran::where('id_transaksi', '=', $id_transaksi)->firstOrFail();\n $pdf = PDF::loadView('pdfPemesanan', compact('data','no','pemesanan'));\n return $pdf->download(\"invoiceTransaksiPemesanan.pdf\");\n }", "public function outputPdfToBrowser();", "public function generatePDF()\n {\n $pdf = App::make('dompdf');\n $pdf = $pdf->loadHTML('<h1>Test</h1>');\n return $pdf->stream('company_background.pdf');\n }", "public function display()\n {\n $dompdf = $this->getDomPdfObject();\n // Affichage, proposition de télécharger sous le nom donné.\n Zend_Layout::getMvcInstance()->disableLayout();\n Zend_Controller_Front::getInstance()->setParam('noViewRenderer', true);\n $dompdf->stream($this->fileName.'.pdf');\n }", "public function actionPdf($id) {\n $model = $this->findModel($id);\n\n $content = $this->renderAjax('_pdf', [\n 'model' => $model,\n ]);\n\n $pdf = Yii::$app->pdf;\n $pdf->content = $content;\n return $pdf->render();\n\n }", "public function reporteServiciosPDF(){\n $datos=TablaSimulacion::all();\n $serv = Servicio::all();\n $servicios=[];\n $gananciaServicio=0;\n $indice = 0;\n foreach ($serv as $ser) {\n $count = 0;\n foreach ($datos as $dato) {\n if (strpos($dato->servicios,$ser->servicio) !== false ) {\n $count++;\n }\n }\n $gananciaServicio=$count*$ser->costo;\n $servicios[$indice] = [$ser->servicio,$count,$ser->costo,$gananciaServicio];\n $indice++;\n }\n $pdf=PDF::loadView('servicio/reporteServicioPdf',compact('servicios'));\n return $pdf->stream();\n }", "static function getPDF($uid){\n $pdf = self::load();\n \n $account = \\LK\\get_user($uid);\n $pdf->setUserSettings(\\LK\\VKU\\VKUManager::getVKU_RenderSettings($account));\n return $pdf;\n }", "public function printActivityReport(Request $request) {\n $data['data'] = ItemOrder::where('staff_id', auth()->user()->id)->orderBy('created_at', 'desc')->get();\n\n $pdf = PDF::loadView('orders.activity_report', $data); \n\n return $pdf->download('activity_report'.time().'.pdf');\n }", "public function getPdfContent();", "public function index() {\n \n return view('almacen.pdf.index');\n }", "public function getPDF() {\n $data = Input::all();\n $document = document::where(\"id\", \"=\", $data['docuId'])->first();\n $this->makePDF($document->path);\n return str_replace(\"/var/www/sphinx/\", \"\", $document->path) . \"/build/latex/\" . $document->name . \".pdf\";\n }", "public function addpdf()\n {\n //\n $channels = Channel::pluck('title','id');\n $videos = Video::pluck('title','id');\n // dd($videos);\n return view('Push::videos.addpdf', compact(['channels','videos']));\n }", "public function PDF_viewer($pdf_layout_name, $mail_type, $mail_number, $t)\n {\n $pdf_layout_name = xss_clean(urldecode($pdf_layout_name));\n if ($t == $this->session->userdata('CSRF'))\n {\n $mail_number = urldecode($mail_number);\n $mail_number = preg_replace('/&sol;/', '/', $mail_number);\n //\n $query = $this->db->where('layout_name', ucwords($pdf_layout_name))->get('pdf_layouts');\n $result = $query->result();\n //\n $this->pdfcdmanp->convert_data($result[0]->layout_data);\n $pdf_layout_data = $this->pdfcdmanp->get_data();\n //\n $this->pdfcdmanp->convert_data($result[0]->layout_page_setup);\n $pdf_page_setup = $this->pdfcdmanp->get_data();\n //\n if ($mail_type == 'im')\n {\n $query = $this->db->where(array(\n 'username' => $this->_username,\n 'mail_number' => $mail_number,\n ))->get('incoming_mail');\n $mail_data = $query->result();\n $mail_type = 'Surat Masuk';\n }\n else if ($mail_type == 'om')\n {\n $query = $this->db->where(array(\n 'username' => $this->_username,\n 'mail_number' => $mail_number,\n ))->get('outgoing_mail');\n $mail_data = $query->result();\n $mail_type = 'Surat Keluar';\n }\n\n //\n $query = $this->db->get('app_settings');\n $settings_data = $query->result();\n //\n $pdflay_data_name = array_keys($pdf_layout_data);\n $document_name = $result[0]->layout_name . '.pdf';\n $pdf_txt_data = array(\n 'idAndMailType' => $mail_data[0]->id . '.' . $mail_type,\n 'docTitle' => $settings_data[0]->mail_document_heading,\n 'docAddr' => $settings_data[0]->mail_document_address,\n 'docContact' => $settings_data[0]->mail_document_contact,\n 'docMailNum' => $mail_data[0]->mail_number,\n 'docDate' => $mail_data[0]->date,\n 'docFor' => $mail_data[0]->receiver,\n 'docSubject' => $mail_data[0]->subject,\n 'docContents' => $mail_data[0]->contents,\n 'docSignature' => array(\n 'ftxt' => 'Hormat Saya,',\n 'stxt' => '',\n 'thtxt' => $mail_data[0]->sender,\n ),\n );\n $pdf = new TCPDF($pdf_page_setup['orientation'], $pdf_page_setup['unit'], $pdf_page_setup['format']);\n $pdf->SetCreator(PDF_CREATOR);\n $pdf->SetAuthor(PDF_AUTHOR);\n $pdf->SetTitle($pdf_txt_data['docSubject']);\n $pdf->SetSubject($pdf_txt_data['docSubject']);\n $pdf->setPrintHeader(false);\n $pdf->setPrintFooter(false);\n $pdf->AddPage();\n $pdf->SetXY(0, 0);\n for ($i = 0; $i < count($pdflay_data_name); $i++)\n {\n switch ($pdflay_data_name[$i])\n {\n case 'idAndMailType':\n $data_name = 'idAndMailType';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['idAndMailType']);\n }\n break;\n case 'docTitle':\n $data_name = 'docTitle';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data[$data_name]);\n }\n break;\n case 'docAddr':\n $data_name = 'docAddr';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docAddr']);\n }\n break;\n case 'docContact':\n $data_name = 'docContact';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docContact']);\n }\n break;\n case 'line':\n $data_name = 'line';\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]) && array_key_exists('x2pos', $pdf_layout_data[$data_name]) && array_key_exists('y2pos', $pdf_layout_data[$data_name]))\n {\n $pdf->Line(\n $pdf_layout_data[$data_name]['xpos'],\n $pdf_layout_data[$data_name]['ypos'],\n $pdf_layout_data[$data_name]['x2pos'],\n $pdf_layout_data[$data_name]['y2pos']\n );\n }\n break;\n case 'docMailNum':\n $data_name = 'docMailNum';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docMailNum']);\n }\n break;\n case 'docDate':\n $data_name = 'docDate';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docDate']);\n }\n break;\n case 'docFor':\n $data_name = 'docFor';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docFor']);\n }\n break;\n case 'docSubject':\n $data_name = 'docSubject';\n $accept = 0;\n if (array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos']);\n $accept += 1;\n }\n\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_style', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n $pdf_layout_data[$data_name]['font_style'], $pdf_layout_data[$data_name]['font_size']);\n $accept += 1;\n }\n\n if ($accept == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docSubject']);\n }\n break;\n case 'docContents':\n $data_name = 'docContents';\n if (array_key_exists('font_family', $pdf_layout_data[$data_name]) && array_key_exists('font_size', $pdf_layout_data[$data_name]))\n {\n $pdf->SetFont($pdf_layout_data[$data_name]['font_family'],\n '', $pdf_layout_data[$data_name]['font_size']);\n if (array_key_exists('w', $pdf_layout_data[$data_name]) && array_key_exists('h', $pdf_layout_data[$data_name]) && array_key_exists('xpos', $pdf_layout_data[$data_name]) && array_key_exists('ypos', $pdf_layout_data[$data_name]))\n {\n $pdf->writeHTMLCell($pdf_layout_data[$data_name]['w'], $pdf_layout_data[$data_name]['h'],\n $pdf_layout_data[$data_name]['xpos'], $pdf_layout_data[$data_name]['ypos'], $pdf_txt_data['docContents']);\n }\n }\n break;\n case 'docSignature':\n $data_name = 'docSignature';\n if (array_key_exists('fxpos', $pdf_layout_data[$data_name]) && array_key_exists('fypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['fxpos'], $pdf_layout_data[$data_name]['fypos']);\n $fpos = 2;\n }\n\n if ($fpos == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docSignature']['ftxt']);\n }\n\n if (array_key_exists('sxpos', $pdf_layout_data[$data_name]) && array_key_exists('sypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['sxpos'], $pdf_layout_data[$data_name]['sypos']);\n $spos = 2;\n }\n\n if ($spos == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docSignature']['stxt']);\n }\n\n if (array_key_exists('thxpos', $pdf_layout_data[$data_name]) && array_key_exists('thypos', $pdf_layout_data[$data_name]))\n {\n $pdf->SetXY($pdf_layout_data[$data_name]['thxpos'], $pdf_layout_data[$data_name]['thypos']);\n $thpos = 2;\n }\n\n if ($thpos == 2)\n {\n $pdf->Write(0, $pdf_txt_data['docSignature']['thtxt']);\n }\n break;\n }\n }\n $pdf->Output($document_name);\n }\n }" ]
[ "0.79241866", "0.7821965", "0.77794117", "0.7676069", "0.76175916", "0.75604886", "0.7497096", "0.74722004", "0.74229825", "0.74118584", "0.7410941", "0.74021775", "0.7397943", "0.7309993", "0.7276196", "0.72760826", "0.7267899", "0.7248324", "0.7191447", "0.7175621", "0.71699965", "0.71648806", "0.7149147", "0.71317285", "0.71148115", "0.7104753", "0.70475227", "0.7043894", "0.7025337", "0.7017641", "0.70174605", "0.69920707", "0.6973903", "0.69667625", "0.69435805", "0.6914449", "0.6878544", "0.6841675", "0.683443", "0.68227994", "0.6814911", "0.6802968", "0.68004405", "0.67983854", "0.67842567", "0.6784085", "0.6781911", "0.6757684", "0.67555875", "0.67344385", "0.67275226", "0.6703791", "0.6696454", "0.6691015", "0.6683796", "0.6683366", "0.6682653", "0.66770154", "0.6673229", "0.666448", "0.6661943", "0.6646954", "0.6644244", "0.66385335", "0.66284275", "0.6615864", "0.660444", "0.6598112", "0.65881443", "0.6578823", "0.6561687", "0.6558654", "0.6550731", "0.65473664", "0.65409636", "0.6524823", "0.6521308", "0.65174484", "0.65149266", "0.65067434", "0.65016556", "0.6485515", "0.6485515", "0.6482924", "0.6475285", "0.64748067", "0.6469026", "0.6453991", "0.64533556", "0.64288074", "0.6426383", "0.6410671", "0.6405026", "0.6376358", "0.63712037", "0.63657016", "0.63584393", "0.63583565", "0.635806", "0.6345299" ]
0.6976499
32
this function using for payment for purchase,,invoice in ACtion button
public function get_estimations_views($id,$name,$identity_name) { Log::info("TransactionController->get_estimations_views :- Inside "); //dd($identity_name); $organization_id = Session::get('organization_id'); $name = $name; $id = $id; $identity_name = $identity_name; /*$job_request_id = AccountVoucher::select('id')->where('name','job_request')->where('organization_id',$organization_id)->first(); $job_invoice_id = AccountVoucher::select('id')->where('name','job_invoice') ->where('organization_id',$organization_id)->first(); $job_invoice_cash_id = AccountVoucher::select('id')->where('name','job_invoice_cash') ->where('organization_id',$organization_id)->first(); $delivery_id = AccountVoucher::select('id')->where('name','delivery_note') ->where('organization_id',$organization_id)->first(); $grn_id = AccountVoucher::select('id')->where('name','goods_receipt_note') ->where('organization_id',$organization_id)->first();*/ //dd($job_invoice_id->id); $status = ''; $transaction_type = AccountVoucher::where('name', $name)->where('organization_id', $organization_id)->first(); //dd($transaction_type); $payment = PaymentMode::where('status', 1)->pluck('display_name','id'); $payment->prepend('Cash','1'); $journal_voucher = AccountVoucher::where('name', 'journal')->where('organization_id', $organization_id)->first()->id; if($name == "payment") { $transaction_id = AccountVoucher::where('name', 'purchases')->where('organization_id', $organization_id)->first()->id; $cash_voucher = AccountVoucher::where('name', 'payment')->where('organization_id', $organization_id)->first()->id; $return_voucher = AccountVoucher::where('name', 'debit_note')->where('organization_id', $organization_id)->first()->id; $user = "Vendor"; } else if($name == "receipt") { $transaction_id = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id; $cash_voucher = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first()->id; $return_voucher = AccountVoucher::where('name', 'credit_note')->where('organization_id', $organization_id)->first()->id; $user = "Customer"; } else if($name == "wms_receipt") { $transaction_id = AccountVoucher::where('name', 'job_invoice')->where('organization_id', $organization_id)->first()->id; $cash_voucher = AccountVoucher::where('name', 'wms_receipt')->where('organization_id', $organization_id)->first()->id; //dd($cash_voucher); $return_voucher = AccountVoucher::where('name', 'credit_note')->where('organization_id', $organization_id)->first()->id; $user = "Customer"; } $view_estimations = Transaction::select('transactions.id', 'transactions.order_no', DB::raw('COALESCE(DATE_FORMAT(transactions.created_at, "%d-%m-%Y"), "") as created_on'), DB::raw('COALESCE(DATE_FORMAT(transactions.date, "%d-%m-%Y"), "") as date'), DB::raw('COALESCE(DATEDIFF(NOW(), transactions.due_date), "") as overdue'), DB::raw('COALESCE(DATE_FORMAT(transactions.due_date, "%d-%m-%Y"), "") as due_date'), DB::raw('IF(transactions.transaction_type_id = '.$transaction_type->id.', "1", 0) AS cash_transaction'), 'transactions.total', DB::raw('IF(people.id IS NULL, business.display_name, people.display_name ) AS customer'), 'transactions.due_date as original_due_date', DB::raw("IF( (SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)) IS NULL, transactions.total, transactions.total - (SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)) ) AS balance"), DB::raw("CASE WHEN (transactions.total - SUM((SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)))) = 0 THEN 1 WHEN transactions.due_date < CURDATE() THEN 3 WHEN (transactions.total - SUM((SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)))) > 0 THEN 2 ELSE 0 END AS status"), 'transactions.approval_status', 'transactions.user_type', 'transactions.people_id'); $view_estimations->leftJoin('people', function($query) { $query->on('transactions.people_id','=','people.person_id'); $query->where('transactions.user_type','=','0'); }); $view_estimations->leftJoin('people AS business', function($query) { $query->on('transactions.people_id','=','business.business_id'); $query->where('transactions.user_type','=','1'); }); $view_estimations->where('transactions.organization_id', $organization_id); if($identity_name == "job_invoice_payment") { $view_estimations->where('reference_id',$id); } if($identity_name == "payment") { $view_estimations->where('transactions.id',$id); } $view_estimations->where('transaction_type_id',$transaction_id); /*if($name == "job_request") { $view_estimations->where('transaction_type_id',$job_request_id->id); } if($name == "job_invoice") { $view_estimations->where(function($query) use($job_invoice_id,$job_invoice_cash_id) { $query->where('transaction_type_id',$job_invoice_id->id) ->orWhere('transaction_type_id',$job_invoice_cash_id->id); }); } if($name == "delivery_note") { $view_estimations->where('transaction_type_id',$delivery_id->id); } if($name == "goods_receipt_note") { $view_estimations->where('transaction_type_id',$grn_id->id); } */ $view_estimations->groupby('transactions.id'); $view_estimations->havingRaw('status != 1'); $view_estimations->havingRaw('balance > 0'); $view_estimation = $view_estimations->get(); //dd($view_estimation); $ledgers = AccountLedger::select('account_ledgers.id', 'account_ledgers.display_name AS name','account_groups.name AS group') ->leftJoin('account_groups', 'account_groups.id', '=', 'account_ledgers.group_id') ->whereIn('account_groups.name', ['cash','bank_account']) ->where('account_ledgers.organization_id', $organization_id) ->where('account_ledgers.approval_status', '1') ->where('account_ledgers.status', '1') ->orderby('account_ledgers.id','asc') ->pluck('name', 'id'); Log::info("TransactionController->get_estimations_views :- return "); if(count($view_estimation) == 0 ) { $status = 0; return view('inventory.pay_bill',compact('view_estimation','id','status','name','payment','ledgers')); } else { $status = 1; //dd($status); return view('inventory.pay_bill',compact('view_estimation','id','status','name','payment','ledgers')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processPayment();", "public function payment(){\n\n\t}", "function make_transaction_button($product,$item_name,$purchase_id,$amount,$currency)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\t\t$ipn_url=$this->get_ipn_url();\n\n $user_details=array();\n\t\tif (!is_guest())\n\t\t{\n\t\t\t$user_details['first_name']=get_ocp_cpf('firstname');\n\t\t\t$user_details['last_name']=get_ocp_cpf('lastname');\n\t\t\t$user_details['address1']=get_ocp_cpf('building_name_or_number');\n\t\t\t$user_details['city']=get_ocp_cpf('city');\n\t\t\t$user_details['state']=get_ocp_cpf('state');\n\t\t\t$user_details['zip']=get_ocp_cpf('post_code');\n\t\t\t$user_details['country']=get_ocp_cpf('country');\n\n\t\t\tif (($user_details['address1']=='') || ($user_details['city']=='') || ($user_details['zip']=='') || ($user_details['country']==''))\n\t\t\t{\n\t\t\t\t$user_details=array(); // Causes error on PayPal due to it crashing when trying to validate the address\n\t\t\t}\n\t\t}\n\n\t\treturn do_template('ECOM_BUTTON_VIA_PAYPAL',array('_GUID'=>'b0d48992ed17325f5e2330bf90c85762','PRODUCT'=>$product,'ITEM_NAME'=>$item_name,'PURCHASE_ID'=>$purchase_id,'AMOUNT'=>float_to_raw_string($amount),'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url,'MEMBER_ADDRESS'=>$user_details));\n\t}", "function process_button() \n {\n\t\tglobal $order, $currencies, $currency, $languages;\n\t\t \n\t\t \n\t\t//referencia de venta\n\t\t$refventa=time();\n\t\t \n\t\t//moneda\n\t\t$my_currency = $order->info['currency'];\n\t\t \n\t\t//descripcion de la venta\n\t \n\t \t/*for($i = 0; $i < sizeof($order->products); $i++) {\n\t\t\t\t\n\t\t\t\t$descripcion .= \"[\".$order->products[$i]['name'].\" x \".$order->products[$i]['qty'].\"] \";\n\t\t\t}*/\n\t\t\t\n\t\t//nombre del comprador\t\n\t\t$nombre_cliente = $order->customer['firstname'].\" \".$order->customer['lastname'];\n\t\t\n\t\t//telefono del comprador\t\n\t\t$telefono = $order->customer['telephone'];\n\t\t\n\t\t//iva del pedido\n\t\t$iva = number_format($order->info['tax'] * $currencies->get_value($my_currency),2,'.','');\n\t\t\t\n\t\t//base de devolucion\n\t\t$baseDevolucionIva = number_format(($iva / $this->tasa_iva),2,'.','');\n\t\t\n\t\t//se organiza la descripcion de la compra\n\t\t$descripcion = substr($descripcion,0,250);\n\t\t\n\t\t//valor total de la compra\n\t \t\n\t\t$total=$order->info['total']; \n $valor = round($total*$order->info['currency_value'],2);\n $valor = number_format($valor, 2, '.', '');\n \n\t \n\t //cadena para la firma digital\n\t $cadtmp = $this->clave_secreta.\"~\".$this->usuario_id.\"~\".$refventa.\"~\".$valor.\"~\".$my_currency;\n\t\t\n\t\t//firma digital\n\t\t$firma = md5($cadtmp);\n\t\t\t\n\t \t//pagina de respuesta\n\t\t$url_respuesta= HTTP_SERVER . DIR_WS_CATALOG . \"index.php?main_page=checkout_success\"; \n\t \n\t \n\t \t//creacion del boton de pago\n \t$process_button_string =\t\t\t\t \n\t\t\t\t\t\t\t \tzen_draw_hidden_field('valor', $valor).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('extra1', urlencode(\"Nombre Cliente : \".$nombre_cliente.\" Telefono : \".$telefono)).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('refVenta', $refventa).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('usuarioId', $this->usuario_id).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('descripcion', \"Compra en la tienda \".'::' . STORE_NAME . '::').\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('moneda', $my_currency).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('prueba', $this->prueba).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('emailComprador', $order->customer['email_address']).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('iva', $iva).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('baseDevolucionIva', $baseDevolucionIva).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('plantilla', \"\").\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('url_respuesta', $url_respuesta).\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('url_confirmacion', HTTP_SERVER . DIR_WS_CATALOG . \"confirmacion.php\").\n\t\t\t\t\t\t\t\tzen_draw_hidden_field('lng', $_SESSION['languages_code']);\n\n\t\t//creacion de la firma digital\n\t\tif(strlen($this->clave_secreta)) {\n\t\t\t\t$process_button_string = $process_button_string.\"\\n\".zen_draw_hidden_field('firma', $firma);\n\t\t\t}\n\n return $process_button_string;\n }", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "abstract protected function handlePayment();", "function invoice(){ \n\t$order_id=$this->uri->segment(3); \n\t$order = base64_decode(urldecode($order_id));\n\tif(empty($order)){$order=4;}\n\t\t$company_id = $this->session->userdata('id');\n\t\t$role = $this->session->userdata('role');\n\t\tif(!empty($company_id) &&($role=='admin') || ($role == 'super_admin')){\t\n\t\t\tif(!empty($order)){ \n\t\t\t$response = $this->InteractModal->get_order( $order);\n\t\t\t$where = array( 'company_id' =>$company_id);\n\t\t\t$user_data=$this->InteractModal->single_field_value('subscription',$where);\n\t\t\t$user_email= $user_data[0]['customer_email'];\n\t\t\t$pagedata['response'] = $response;\t\t\t\n\t\t\t$pagedata['user_email'] = $user_email;\t\t\t\n\t\t\t}\n\t\t\t\t$this->load->view('dashboard/header');\n\t\t\t\t$this->load->view('dashboard/invoice',$pagedata);\n\t\t\t\t$this->load->view('dashboard/footer');\n\t\t}else{\n\t\t\tredirect(base_url()); \n\t\t}\n\t}", "public function thankyou_page_kdbayar() {\n\t\tglobal $woocommerce;\n \n\t\t$invoice = $_POST['invoice'];\n\t\t$result_code = $_POST['result_code'];\n\t\t\n\t\t$customer_order = new WC_Order( $invoice );\n\t\t\n\t\tif($result_code == '00'){\n\t\t\t// Payment successful\n\t\t\t$customer_order->add_order_note( __( 'Finnet processing payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// paid order marked\n\t\t\t$customer_order->update_status('processing');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}elseif ($result_code == '05') {\n\t\t\t// Payment expired\n\t\t\t$customer_order->add_order_note( __( 'Finnet expired payment.', 'finnet-kode-bayar' ) );\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t// expired order marked\n\t\t\t$customer_order->update_status('failed');\n\n\t\t\t$url = \"http://\" . $_SERVER['SERVER_NAME'].\"/return.php\";\n \n wp_redirect($url);\n\t\t}\n\t}", "function do_pr_invoice($data){\n\t$client_id=$data['Clientpayment']['client_id'];\n\t$amount=$data['Clientpayment']['amount'];\n\t$invoice_number=$data['Clientpayment']['invoice_number'];\n \t$list=$this->query(\"select invoice_id, total_amount from invoice where invoice_number='$invoice_number' limit 1;\");\n \t$invoice_amount=isset($list[0][0]['total_amount'])?$list[0][0]['total_amount']:0;\n \t#付清\n \tif($invoice_amount<$amount){\n\t\t\t$this->paid_true_invoice($data,$invoice_amount);\n \t}\n \tif($invoice_amount<$amount)\n \t{\n \t#未付清\n\t\t$this->paid_false_invoice($data,$invoice_number,$invoice_amount);\n \t}\n\t \tif($invoice_amount==$amount)\n \t{\n \t\n \t#刚刚付清\n \t$this->do_pay_for_invoice($data);\n\t$this->query(\"update invoice set paid=true,pay_amount=pay_amount::numeric+$invoice_amount where invoice_number='$invoice_number'\");\n \t\n \t}\n \t$this->commit();\n\t}", "public function payWayPurchase()\n\t{\n\t}", "public function payment_scripts() {\n\n \t}", "public function payment_scripts() {\n \n\t\t\n \n\t \t}", "function payment_success()\n {\n\t\t\t/*log_message('INFO', 'Inside order2/payment_success');\n\t\t\t$this->morder->equateProductsQuantities();\n\t\t\tlog_message('INFO', 'end equateProductsQuantities()______________________________________________________');*/\n\t\t\t/* END ADDED BY SHAMMI SHAILAJ */\n\t\t\t\n //print \"<p>inside payments success</p>\";\n include('header_include.php');\n $data['email'] = $this->session->userdata('email');\n $this->session->unset_userdata('email');\n $txnid= $this->session->userdata('e_txn_id');\n $data['transID'] = $txnid;\n //print \"<p>transID = \".$txnid.\"</p>\";\n if(is_null($this->session->userdata('e_txn_id')) || strcmp($this->session->userdata('e_txn_id'), \"\") === 0)\n {\n $data['transID'] = NULL;\n }\n $this->session->unset_userdata('e_txn_id');\n \n //purchase email\n $this->load->model('vc_orders');\n /* following code added by shammi to generate data for sokrati and ecommerce tracking */\n if(!is_null($data['transID']))\n {\n $transDataDB = $this->vc_orders->orderDetails($data['transID']);\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n //exit();\n if($transDataDB !== FALSE)\n {\n $data['prodsCount'] = count($transDataDB);\n $data ['buyerFName'] = $transDataDB[0]->shipping_fname;\n $data ['buyerLName'] = $transDataDB[0]->shipping_lname;\n $data['buyerAddress'] = $transDataDB[0]->shipping_address;\n $data['buyerCity'] = $transDataDB[0]->shipping_city;\n $data['buyerPinCode'] = $transDataDB[0]->shipping_pincode;\n $data['buyerState'] = $transDataDB[0]->shipping_state;\n $data['buyerCountry'] = $transDataDB[0]->shipping_country;\n $data['buyerUserID'] = $transDataDB[0]->user_id;\n $data['tax'] = 0;\n $grandTotal = 0;\n $products = array();\n if(is_array($products))\n {\n for($j=0;$j < $data['prodsCount']; $j++)\n {\n $product = new productInfo;\n $product->storeID = $transDataDB[$j]->store_id;\n $product->storeName = $transDataDB[$j]->store_name;\n $order_no = $transDataDB[$j]->order_id;\n $product->orderID = $transDataDB[$j]->order_id;\n $product->productName = $transDataDB[$j]->product_name;\n $product->vSize = $transDataDB[$j]->vsize;\n $product->vColor = $transDataDB[$j]->vcolor;\n $product->unitPrice = $transDataDB[$j]->amt_paid;\n $product->quantity = $transDataDB[$j]->quantity;\n $grandTotal += $transDataDB[$j]->amt_paid * $transDataDB[$j]->quantity;\n $product->productID = $transDataDB[$j]->product_id; \n $product->cid = $transDataDB[$j]->couponid;\n $products[$j] = $product;\n /* ADDED BY SHAMMI SHAILAJ to keep quantities in the new and old products table EQUAL (NEW METHOD)*/\n\t\t\t\t\t\t\t//log_message('INFO', 'Inside order2/payment_success');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' => 1, 'msg' => 'Inside order2/payment_success'));\n\t\t\t\t\t\t\t$this->morder->equateProductsQuantities2($product->productID);\n\t\t\t\t\t\t\t//log_message('INFO', 'end equateProductsQuantities2()______________________________________________________');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' =>1, 'msg' => 'end equateProductsQuantities2()______________________________________________________'));\n /* END ADDED BY SHAMMI SHAILAJ */\n }\n }\n else\n {\n $product = new productInfo;\n $product->storeID = $transDataDB->store_id;\n $product->storeName = $transDataDB->store_name;\n $order_no = $transDataDB->order_id;\n $product->orderID = $transDataDB->order_id;\n $product->productName = $transDataDB->product_name;\n $product->vSize = $transDataDB->vsize;\n $product->vColor = $transDataDB->vcolor;\n $product->unitPrice = $transDataDB->amt_paid;\n $product->quantity = $transDataDB->quantity;\n $product->productID = $transDataDB->product_id;\n $product->cid = $transDataDB->couponid;\n $grandTotal += $transDataDB->amt_paid * $transDataDB->quantity;\n $products[] = $product;\n }\n $data['grandTotal'] = $grandTotal;\n $data['products'] = $products;\n }\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n }\n /* end code added by shammi to generate data for sokrati and ecommerce tracking */\n $base_url = base_url();\n $ip_address = (string)$this->input->ip_address();\n //log_message('Info',\"Ipaddress = $ip_address\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Ipaddress = $ip_address\"));\n if($ip_address!='127.0.0.1')\n {\n //log_message('Info',\"Allow mail as the Ip is not 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' =>1, 'msg' => \"Allow mail as the Ip is not 127.0.0.1\"));\n $mail_info = $this->vc_orders->purchaseMailDetails($txnid);\n $this->slog->write(array('level' =>1 ,'msg' => \"mail_info FROM ORDERS2/PAYMENT_SUCCESS_____\".print_r($mail_info, TRUE)));\n if($mail_info!=0)\n {\n $count_prod = count($mail_info);\n $buyer_name = $mail_info[0]['shipping_fname'].' '.$mail_info[0]['shipping_lname'];\n $shipping_address = $mail_info[0]['shipping_address'];\n $shipping_city = $mail_info[0]['shipping_city'];\n $pin_code = $mail_info[0]['shipping_pincode'];\n $couponcode = $mail_info[0]['couponid'];\n $payment_mode = $mail_info[0]['pg_type'];\n if ($payment_mode=='COD')\n {\n $payment_mode = 'Cash on Delivery';\n }\n elseif ($payment_mode=='CC')\n {\n $payment_mode = 'Credit Card';\n }\n elseif ($payment_mode=='DC')\n {\n $payment_mode = 'Debit Card';\n }\n elseif ($payment_mode=='NB')\n {\n $payment_mode = 'Net Banking';\n }\n \n for($j=0;$j<$count_prod;$j++)\n {\n $order_no = $mail_info[$j]['order_id'];\n $product_name = $mail_info[$j]['product_name'];\n $variant_size = \"Size: \".$mail_info[$j]['variant_size'];\n $variant_color = \"Color: \".$mail_info[$j]['variant_color'];\n $variant_details = \"\";\n $this->slog->write(array('level' => 1,'msg' => \"INDEX MAIL VALUE\".print_r($mail_info[$j]['sent_email_id'],TRUE)));\n if ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \"\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \" - (\".$variant_size.\")\";\n }\n elseif ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_color.\")\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_size.\",\".$variant_color.\")\";\n }\n $process_days = (int)$mail_info[$j]['process_days'];\n $productImagePath = './assets/images/stores/'.$mail_info[$j]['store_id'].'/'.$mail_info[$j]['product_id'].'/';\n if(file_exists($productImagePath.'fancy3.jpg'))\n {\n $productImage = $productImagePath.'fancy3.jpg';\n }\n elseif(file_exists($productImagePath.'fancy3.JPG'))\n {\n $productImage = $productImagePath.'fancy3.JPG';\n }\n else\n {\n $productImage = '';\n }\n //log_message('INFO', 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']));\n include 'mail_4.php';\n //Buyer Purchase Email\n $this->load->model('automate_model');\n\t\t\t\t\t\t\t$jobType = 1; // an email job\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate email\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 66); // current time + 1 minute 6 seconds\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => $mail_info[$j]['sent_email_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $purchase_message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>An Email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A (P)', $jobScheduledTime).\" </p>\" ) );\n\n\t\t\t\t\t\t\t$smsMsg = \"Dear \".$mail_info[$j]['shipping_fname'].' '.$mail_info[$j]['shipping_lname'].\", \\r\\n Thank you for placing an order with us. Your order ID \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$smsMsg .= \" will be dispatched by \".date( \"d-M-Y\", ( strtotime($mail_info[$j]['date_of_pickup']) ) ).\". Once dispatched, it will reach you in 1-5 working days. Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$smsNo = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\tif($smsNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$smsNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->load->model('smsc');\n\t\t\t\t\t\t\t$this->smsc->sendSMS($smsNo, $smsMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent an SMS to '.json_encode($smsNo).'. The msg sent is <p>'.$smsMsg.'</p>' ) );\n\n\t\t\t\t\t\t\t// now set an email job to be executed only after 24 hours if the seller has not sent the mail\n\t\t\t\t\t\t\t$orderEmail11Data = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerName'] = $mail_info[$j]['owner_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['orderID'] = $mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['dispatchDate'] = $mail_info[$j]['date_of_pickup'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerEmail'] = $mail_info[$j]['contact_email'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeName'] = $mail_info[$j]['store_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productName'] = $mail_info[$j]['product_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productID'] = $mail_info[$j]['product_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['bnbProductCode'] = $mail_info[$j]['bnb_product_code'];\n\t\t\t\t\t\t\t$orderEmail11Data['amountPaid'] = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n\t\t\t\t\t\t\t$orderEmail11Data['paymentType'] = $mail_info[$j]['pg_type'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerName'] = $mail_info[$j]['shipping_fname'].\" \".$mail_info[$j]['shipping_lname'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerAddress'] = $mail_info[$j]['shipping_address'].\"<br/>\".$mail_info[$j]['shipping_city'].\"<br/>\".$mail_info[$j]['shipping_pincode'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerContactNumber'] = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\t$orderEmail11Data['processingTime'] = $mail_info[$j]['process_days'];\n\n\t\t\t\t\t\t\t$orderEmail11 = $this->load->view('emailers/orderEmail11', $orderEmail11Data, TRUE);\n\n\t\t\t\t\t\t\t$jobType = 4; // a check and then send email job depending upon the result of the check\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate index\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 86460); // current time + 1 day (24 hrs 1 minute)\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'orderID' => $order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => ( (empty($mail_info[$j]['contact_email']) )? $mail_info[$j]['contact_email'] : '[email protected]'),\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => '[email protected],[email protected],[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $orderEmail11\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>A check and then email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A T (P)', $jobScheduledTime).\" </p>\" ) );\n\t\t\t\t\t\t\t/* OLD EMAIL SENDING CODE\n $this->load->library('email');\n $mailArraylog = array();\n $this->email->from('[email protected]','BuynBrag');\n $this->email->to($mail_info[$j]['sent_email_id']);\n $this->email->bcc('[email protected],[email protected]');\n $this->email->subject(\"BuynBrag: Order Success,Order Id:$order_no\");\n\n $this->email->message($purchase_message);\n $this->email->set_newline(\"\\r\\n\");\n if($this->email->send())\n {\n log_message('Info', 'SUCCESSFULLY SENT EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $mailArraylog = array('level' => 1, 'send status' => 1,'to' => $mail_info[$j]['sent_email_id'],'bcc' =>'[email protected],[email protected]','From' => '[email protected]','mail content' => $purchase_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog);\n }\n else\n {\n log_message('Info', 'FAILED SENDING EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n }*/\n\n //////////////////////////////\n $owner_name = $mail_info[$j]['owner_name'];\n $owner_email = $mail_info[$j]['contact_email'];\n $total_amount = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n include 'mail_7.php';\n\n $sellerSMSMsg = \"Dear \".$mail_info[$j]['owner_name'].\", \\r\\n You have recieved a new order for \".$mail_info[$j]['product_name'].\". The order ID is \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$sellerSMSMsg .= \" and the quantity ordered is \".$mail_info[$j]['quantity'].\". Please make sure that the product is dispatched by \".date( \"d-M-Y\", ( ( strtotime($mail_info[$j]['date_of_pickup']) ) - 86400) ).\". Contact us on +91-8130878822 or [email protected] \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$sellerSMSNo = $mail_info[$j]['contact_number'];\n\t\t\t\t\t\t\tif($sellerSMSNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sellerSMSNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->smsc->sendSMS($sellerSMSNo, $sellerSMSMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent seller SMS to '.json_encode($sellerSMSNo).'. The msg sent is <p>'.$sellerSMSMsg.'</p>' ) );\n\n //Seller New Order Email\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$config['protocol'] = 'smtp';\n\t\t\t\t\t\t\t$config['smtp_host'] = 'ssl://smtp.googlemail.com';\n\t\t\t\t\t\t\t$config['smtp_port'] = 465;\n\t\t\t\t\t\t\t$config['smtp_user'] = '[email protected]';\n\t\t\t\t\t\t\t$config['smtp_pass'] = '';*/\n\n $this->load->library('email');\n $mailArraylog2 = array();\n $this->email->clear(TRUE);\n $this->email->from('[email protected]','BuynBrag');\n if(empty($owner_email))\n {\n \t//log_message('INFO', 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]');\n \t$this->load->model('slog');\n \t$this->slog->write(array('level' => 1 , 'msg' => 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to [email protected]'));\n $owner_email = '[email protected]';\n }\n\n $this->email->to($owner_email);\n $this->email->bcc('[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]');\n $this->email->subject(\"New Order from BuynBrag,Order Id:\".$order_no);\n $this->email->message($new_order_message);\n $this->email->attach('./invoice/'.$txnid.'/buyer_invoice_order_'.$order_no.'.pdf');\n \n if(!empty($productImage))\n {\n $this->email->attach($productImage);\n }\n\n $this->email->set_newline(\"\\r\\n\");\n \n if($this->email->send())\n {\n //log_message('Info',\"Seller eMail sent to $owner_email for order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => \"Seller eMail sent to $owner_email for order no: $order_no\" ));\n $mailArraylog2 = array('level' => 1, 'send status' => 1,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n if($j==($count_prod-1))\n {\n $this->vc_orders->purchase_mail_success($txnid);\n }\n }\n else\n {\n //log_message('Info',\"ERROR occurred while sending Seller email to $owner_email order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write( array('level' => 1, 'msg' => \"ERROR occurred while sending Seller email to $owner_email order no: \".$order_no, 'debug' => $this->email->print_debugger() ) );\n $mailArraylog2 = array('level' => 1, 'send status' => 0,'to' => $owner_email,'bcc' =>'[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]','From' => '[email protected]','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n \n }\n $this->email->clear(TRUE);\n //end email send\n }//end for\n \n }//end if mail_info !=0\n }\n else\n {\n log_message('Info',\"Don't Allow mail as the Ip is 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Don't Allow mail as the Ip is 127.0.0.1\"));\n }\n $this->load->view('order_success',$data);\n }", "public function payment_scripts() {\n \n\t \t}", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function createPayment()\n\t{\n\n\t}", "public function invoice(){\n \n $page_name = 'invoice';\n \n $this->load->helper('num2word');\n \n // Check for valid request method\n if($this->input->server('REQUEST_METHOD') == 'POST') {\n \n // Get Student details\n $data['student_details'] = $this->pay_mdl->gets('student_details', $this->main->item('user_id'));\n \n // Get all form field values.\n $form_fields = $this->input->post(NULL);\n \n \n \n \n $pay_param = array(\n 'percent' => $form_fields['percentage'],\n 'schoolid' => $form_fields['schoolid'],\n 'exceptionid' => $form_fields['exceptionid'],\n 'can_name' => $data['student_details']['fname'] .' '. $data['student_details']['lname']. ' '.$data['student_details']['mname'],\n 'scheduleid' => $form_fields['scheduleid'],\n 'scheduletype' => $form_fields['scheduletype'],\n 'sessionname' => $form_fields['sessionname'],\n 'sessionid' => $form_fields['sessionid'],\n 'penalty_status' => $form_fields['penalty_status'],\n 'penalty' => $form_fields['penalty'],\n 'userid' => $this->main->item('user_id'),\n \"revenuehead\" => $form_fields['revenue_head'],\n );\n \n if($form_fields['penalty_status'] == \"active\"){\n \n //get the Calculated percentage of the amount to me paid if Penalty is active\n $pay_param['amount'] = $form_fields['amount'];\n $pay_param['amount2word'] = convert_number_to_words((double)$form_fields['amount']);\n \n }else{\n \n //get the Calculated percentage of the amount to me paid if Penalty is Inactive \n $paying_amount = (($form_fields['amount'] * $form_fields['percentage']) / 100);\n $pay_param['amount2word'] = convert_number_to_words((double)$paying_amount);\n $pay_param['amount'] = $paying_amount;\n }\n \n \n \n $data['form_fields'] = $pay_param;\n \n //build view page for Payment Invoice \n $page_content = $this->load->view($this->folder_name.'/'.$page_name, $data, true);\n $this->page->build($page_content, $this->folder_name, $page_name, $this->page_title ); \n }\n else{\n\n // Set error message for any request other than POST\n $error_msg = $this->lang->line('invalid_req_method'); \n $this->main->set_notification_message(MSG_TYPE_ERROR, $error_msg, TRUE); \n \n $this->index();\n }\n \n \n }", "public function invoiceAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Get order Id\n * @var unknown\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n /**\n * Getting order product ids\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n /**\n * Getting cancel order items\n */\n $cancelOrderItemProductIds = Mage::helper ( 'marketplace/vieworder' )->cancelOrderItemProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n /**\n * Getting the sonfiguration for order manage.\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id count is greater than one\n */\n if (count ( $orderPrdouctIds ) >= 1 && $orderStatusFlag == 1) {\n $order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n $itemsarray = $itemsArr = array ();\n /**\n * prepare invoice items\n */\n foreach ( $order->getAllItems () as $item ) {\n $qty = 0;\n /**\n * Prepare invoice qtys\n */\n $itemProductId = $item->getProductId ();\n $itemId = $item->getItemId ();\n /**\n * check whether item is in array\n */\n if (in_array ( $itemProductId, $orderPrdouctIds ) && ! in_array ( $itemProductId, $cancelOrderItemProductIds )) {\n $itemsArr [] = $itemId;\n /**\n * Qty ordered for that item\n */\n $qty = $item->getQtyOrdered () - $item->getQtyInvoiced ();\n }\n $itemsarray [$itemId] = $qty;\n }\n\n try {\n /**\n * Create invoice\n */\n if ($order->canInvoice ()) {\n /**\n * Generate invoice for shippment.\n */\n Mage::getModel ( 'sales/order_invoice_api' )->create ( $order->getIncrementId (), $itemsarray, '', 1, 1 );\n\t\t Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $itemsArr, $orderId, 1 );\n\t\t $order->setStatus('processing');\n\t\t $order->save();\n /**\n * add success message\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( 'The invoice has been created.' ) );\n }\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Checkk the permission for generate invoice.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "function receipt_page($order) {\n echo '<p>' . __('Gracias! - Tu orden ahora está pendiente de pago. Deberías ser redirigido automáticamente a la página de transbank.') . '</p>';\n\n echo $this->generate_webpayplus_form($order);\n }", "function view_invoice($param1 = '', $param2 = '', $param3 = '')\n\t{\n\t\t//if($this->session->userdata('patient_login')!=1)redirect(base_url().'index.php?login' , 'refresh');\n\t\tif ($param1 == 'make_payment') {\n\t\t\t$invoice_id = $this->input->post('invoice_id');\n\t\t\t$system_settings = $this->db->get_where('settings', array(\n\t\t\t\t'type' => 'paypal_email'\n\t\t\t))->row();\n\t\t\t$invoice_details = $this->db->get_where('invoice', array(\n\t\t\t\t'invoice_id' => $invoice_id\n\t\t\t))->row();\n\t\t\t\n\t\t\t/****TRANSFERRING USER TO PAYPAL TERMINAL****/\n\t\t\t$this->paypal->add_field('rm', 2);\n\t\t\t$this->paypal->add_field('no_note', 0);\n\t\t\t$this->paypal->add_field('item_name', $invoice_details->title);\n\t\t\t$this->paypal->add_field('amount', $invoice_details->amount);\n\t\t\t$this->paypal->add_field('custom', $invoice_details->invoice_id);\n\t\t\t$this->paypal->add_field('business', $system_settings->description);\n\t\t\t$this->paypal->add_field('notify_url', base_url() . 'index.php?patient/view_invoice/paypal_ipn');\n\t\t\t$this->paypal->add_field('cancel_return', base_url() . 'index.php?patient/view_invoice/paypal_cancel');\n\t\t\t$this->paypal->add_field('return', base_url() . 'index.php?patient/view_invoice/paypal_success');\n\t\t\t\n\t\t\t$this->paypal->submit_paypal_post();\n\t\t\t// submit the fields to paypal\n\t\t}\n\t\tif ($param1 == 'paypal_ipn') {\n\t\t\tif ($this->paypal->validate_ipn() == true) {\n\t\t\t\t$ipn_response = '';\n\t\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t\t\t$ipn_response .= \"\\n$key=$value\";\n\t\t\t\t}\n\t\t\t\t$invoice_id = $_POST['custom'];\n\t\t\t\t$data['status'] = 'paid';\n\t\t\t\t$this->db->where('invoice_id', $invoice_id);\n\t\t\t\t$this->db->update('invoice', $data);\n\t\t\t\t\n\t\t\t\t$data2['transaction_id'] = rand(10000, 100000);\n\t\t\t\t$data2['invoice_id'] = $invoice_id;\n\t\t\t\t$data2['patient_id'] = $this->crud_model->get_type_name_by_id('invoice', $invoice_id, 'patient_id');\n\t\t\t\t$data2['payment_method'] = 'paypal';\n\t\t\t\t$data2['description'] = $ipn_response;\n\t\t\t\t$data2['amount'] = $this->crud_model->get_type_name_by_id('invoice', $invoice_id, 'amount');\n\t\t\t\t$data2['timestamp'] = strtotime(date(\"m/d/Y\"));\n\t\t\t\t\n\t\t\t\t$this->db->insert('payment', $data2);\n\t\t\t}\n\t\t}\n\t\tif ($param1 == 'paypal_cancel') {\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_cancelled'));\n\t\t\tredirect(base_url() . 'index.php?patient/view_invoice/', 'refresh');\n\t\t}\n\t\tif ($param1 == 'paypal_success') {\n\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_successfull'));\n\t\t\tredirect(base_url() . 'index.php?patient/view_invoice/', 'refresh');\n\t\t}\n\t\t\n\t\t$page_data['page_name'] = 'view_invoice';\n\t\t$page_data['page_title'] = get_phrase('view_invoice');\n\t\t$page_data['invoices'] = $this->db->get_where('invoice', array(\n\t\t\t'patient_id' => $this->session->userdata('patient_id')\n\t\t))->result_array();\n\t\t$this->load->view('index', $page_data);\n\t}", "public function captureInvoice(Varien_Object $payment)\n {\n\n\n $transaction = Mage::getModel('sales/order_payment_transaction')->getCollection()\n ->addAttributeToFilter('order_id', array('eq' => $payment->getOrder()->getEntityId()))->getLastItem();\n $addData = $transaction->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);\n $transaction_id = $addData['transID'];\n\n\n if(empty($transaction_id)){\n $transaction_id = Mage::getSingleton('core/session')->getTransactionID();\n\n }\n if (empty($transaction_id)) {\n Mage::helper('paynovapayment')->log(\"Error. Missing transaction ID from order and cannot do capture.\");\n Mage::throwException(Mage::helper('paynovapayment')->__('Error. Missing transaction ID.'));\n }\n\n\n $invoice = $payment->getCurrentInvoice();\n $transInformation = $payment->getTransaction($transaction_id)->getAdditionalInformation();\n\n\n\n $order_id = $transInformation['raw_details_info']['order_id'];\n $order_number = $transInformation['raw_details_info']['order_number'];\n\n $order = Mage::getModel('sales/order');\n\n $order->loadByIncrementId($order_number);\n\n $res['orderId'] = $order_id;\n $res['transactionId'] = $transaction_id;\n $res['totalAmount'] = $invoice->getGrandTotal();\n $res['invoiceId'] = $transaction_id;\n\n $items = $invoice->getAllItems();\n\n\n $itemcount= count($items);\n $data = array();\n $i=0;\n $linenumber=1;\n\n $unitMeasure = Mage::getStoreConfig('paynovapayment/advanced_settings/product_unit');\n if (empty($unitMeasure)){\n $unitMeasure = \"pcs\";\n }\n $shippingname = Mage::getStoreConfig('paynovapayment/advanced_settings/shipping_name');\n if (empty($shippingname)){\n $shippingname = \"Shipping\";\n }\n $shippingsku = Mage::getStoreConfig('paynovapayment/advanced_settings/shipping_sku');\n if (empty($shippingsku)){\n $shippingsku = \"Shipping\";\n }\n\n foreach ($items as $itemId => $item)\n {\n\n $orderItem = $item->getOrderItem();\n\n $product = Mage::helper('catalog/product')->getProduct($item->getSku(), Mage::app()->getStore()->getId(), 'sku');\n $productUrl = Mage::getUrl($product->getUrlPath());\n $description = $product->getShortDescription();\n if (empty($description)){\n $description = $orderItem->getName();\n }\n $itemtype = $orderItem->getProductType();\n\n\n $lineqty = intval($item->getQty());\n // if product has parent - get parent qty\n\n\n if ($item->getParentItemID() AND $item->getParentItemID()>0){\n $parentQuoteItem = Mage::getModel(\"sales/quote_item\")->load($item->getParentItemID());\n $parentqty = intval($parentQuoteItem->getQty());\n $lineqty = $lineqty * $parentqty;\n }\n\n\n $lineprice = $orderItem->getPrice();\n $linetax = $orderItem->getTaxPercent();\n $unitAmountExcludingTax = $orderItem->getPrice();\n $linetaxamount = ($lineqty*$lineprice)*($linetax/100);\n $linetotalamount = $lineqty*$unitAmountExcludingTax+$linetaxamount;\n\n\n // If item has discount\n if ($orderItem->getDiscountAmount() AND $orderItem->getDiscountAmount()>0 )\n {\n $linediscountamount = $orderItem->getDiscountAmount();\n $itemdiscount = $linediscountamount/$lineqty;\n $unitAmountExcludingTax = $lineprice-$itemdiscount;\n $linetaxamount = ($lineqty*$unitAmountExcludingTax)*($linetax/100);\n $total1 = $lineqty*$unitAmountExcludingTax;\n $linetotalamount = $total1+$linetaxamount;\n $linetax1 = $lineqty*$unitAmountExcludingTax;\n $linetax2 = $linetax/100;\n $linetaxamount = $linetax1*$linetax2;\n }\n\n $res['lineItems'][$itemId]['id'] = $linenumber;\n $res['lineItems'][$itemId]['articleNumber'] = substr($orderItem->getSku(),0,50);\n $res['lineItems'][$itemId]['name'] = $item->getName();\n $res['lineItems'][$itemId]['quantity'] = $lineqty;\n $res['lineItems'][$itemId]['unitMeasure'] = $unitMeasure;\n $res['lineItems'][$itemId]['description'] = $description;\n $res['lineItems'][$itemId]['productUrl'] = $productUrl;\n\n\n if ($itemtype ==\"bundle\") {\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] =0;\n $res['lineItems'][$itemId]['taxPercent'] = 0;\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = 0;\n $res['lineItems'][$itemId]['totalLineAmount'] = 0;\n } else {\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] = round($unitAmountExcludingTax,2);\n $res['lineItems'][$itemId]['taxPercent'] = round($linetax,2);\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = round($linetaxamount,2);\n $res['lineItems'][$itemId]['totalLineAmount'] = round($linetotalamount,2);\n }\n\n $i++;\n $linenumber++;\n }\n if ($order->getShippingAmount() AND $order->getShippingAmount()>0) {\n $quoteid = $order->getQuoteId();\n $quote = Mage::getModel('sales/quote')->load($quoteid);\n $itemId++;\n $res['lineItems'][$itemId]['id'] = $linenumber;\n $res['lineItems'][$itemId]['articleNumber'] = substr($shippingsku,0,50);\n $res['lineItems'][$itemId]['name'] = $shippingname;\n $res['lineItems'][$itemId]['quantity'] = 1;\n $res['lineItems'][$itemId]['unitMeasure'] = $unitMeasure;\n $res['lineItems'][$itemId]['unitAmountExcludingTax'] = round($order->getShippingAmount(),2);\n $res['lineItems'][$itemId]['taxPercent'] = Mage::helper('paynovapayment')->getShippingTaxPercentFromQuote($quote);\n $res['lineItems'][$itemId]['totalLineTaxAmount'] = round($order->getShippingTaxAmount(),2);\n $res['lineItems'][$itemId]['totalLineAmount'] = round($order->getShippingInclTax(),2);\n $res['lineItems'][$itemId]['description'] = $description;\n $res['lineItems'][$itemId]['productUrl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);;\n }\n\n\n\n $output=$this->setCurlCall($res, '/orders/'.$order_id.'/transactions/'.$transaction_id.'/finalize/'.$res['totalAmount']);\n\n\n $order->save();\n\n $status = $output->status;\n if($status->statusKey == 'PAYMENT_COMPLETED'){\n\n $status->isSuccess = true;\n $output->transactionId = 'Order has been finalized';\n\n }\n\n if($status->isSuccess){\n\n $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);\n\n $order->save();\n\n $payment->setStatus(self::STATUS_APPROVED)\n ->setTransactionId($output->transactionId)\n ->setIsTransactionClosed(0);\n return $status->isSuccess;\n\n }else{\n\n $error=$status->statusMessage;\n\n\n $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,\n Mage::helper('paynovapayment')->__($error)\n );\n $order->save();\n\n Mage::throwException(\"$error\");\n\n $this->_redirect('checkout/onepage');\n\n }\n\n }", "public function createInvoice()\r\n {\r\n }", "function process_button() {\n\n global $order, $_POST, $HTTP_SERVER_VARS;\n global $db;\n\n $myOptions = array();\n $buttonArray = array();\n\n\t\t // A.NET INVOICE NUMBER FIX\n\t\t // find the next order_id to pass as x_Invoice_Num\n\t\t $next_inv = '';\n\t\t $inv_id = $db->Execute(\"select orders_id from \" . TABLE_ORDERS . \" order by orders_id DESC limit 1\");\n\t\t $last_inv = $inv_id->fields['orders_id'];\n\t\t $next_inv = $last_inv+1;\n\t\t // END A.NET INVOICE NUMBER FIX\n\n $check_query1 = $db->Execute(\"SELECT configuration_key,configuration_value FROM `configuration` WHERE `configuration_key` LIKE 'MODULE\\_PAYMENT\\_CCBILL\\_%'\");\n while(!$check_query1->EOF)\n {\n\n switch($check_query1->fields['configuration_key']){\n case 'MODULE_PAYMENT_CCBILL_ClientAccountNo': \t\t\t$this->ClientAccountNo \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_ClientSubAccountNo': \t\t\t$this->ClientSubAccountNo \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_FormName': \t\t\t$this->FormName \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_IsFlexForm': \t $this->IsFlexForm \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_Currency': \t\t\t$this->Currency \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_Salt': \t\t\t$this->Salt \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_ORDER_STATUS_ID':\t\t\t\t\t$this->order_status\t\t\t\t= $check_query1->fields['configuration_value'];\n break;\n }// end switch\n\n $check_query1->MoveNext();\n }// end while\n\n $this->setCurrencyCode();\n\n $isFlexForm = $this->IsFlexForm == 'True' ? true : false;\n\n $this->TransactionAmount = number_format($order->info['total'], 2, '.', '');\n $billingPeriodInDays = 2;\n\n\n \t\t$priceVarName = 'formPrice';\n \t\t$periodVarName = 'formPeriod';\n\n $stringToHash = '' . $this->TransactionAmount\n \t . $billingPeriodInDays\n \t . $this->CurrencyCode\n \t . $this->Salt;\n\n \t $this->Hash = md5($stringToHash);\n\n $ccbill_addr = 'http://www.goolge.com';//$this->form_action_url;\n\n if($isFlexForm) {\n $ccbill_addr = $this->flexform_base_url . $this->FormName;\n \t\t$priceVarName = 'initialPrice';\n \t\t$periodVarName = 'initialPeriod';\n }// end if\n\n\n $myOptions['clientAccnum'] = $this->ClientAccountNo;\n $myOptions['clientSubacc'] = $this->ClientSubAccountNo;\n $myOptions['formName'] = $this->FormName;\n $myOptions[$priceVarName] = $this->TransactionAmount;\n $myOptions[$periodVarName] = $billingPeriodInDays;\n $myOptions['currencyCode'] = $this->CurrencyCode;\n $myOptions['customer_fname'] = $order->customer['firstname'];\n $myOptions['customer_lname'] = $order->customer['lastname'];\n $myOptions['email'] = $order->customer['email_address'];\n $myOptions['zipcode'] = $order->billing['postcode'];\n $myOptions['country'] = $order->billing['country']['iso_code_2'];\n $myOptions['city'] = $order->billing['city'];\n $myOptions['state'] = $this->getStateCodeFromName($order->billing['state']);\n $myOptions['address1'] = $order->billing['street_address'];\n $myOptions['zc_orderid'] = $next_inv;\n $myOptions['MyCount'] = $_SESSION['MYCOUNT'];\n $myOptions['formDigest'] = $this->Hash;\n\n $_SESSION['CCBILL_AMOUNT'] = $this->TransactionAmount;\n\n // build the button fields\n foreach ($myOptions as $name => $value) {\n // remove quotation marks\n $value = str_replace('\"', '', $value);\n // check for invalid characters\n if (preg_match('/[^a-zA-Z_0-9]/', $name)) {\n //ipn_debug_email('datacheck - ABORTING - preg_match found invalid submission key: ' . $name . ' (' . $value . ')');\n break;\n }// end if\n\n $buttonArray[] = zen_draw_hidden_field($name, $value);\n }// end foreach\n\n $process_button_string = \"\\n\" . implode(\"\\n\", $buttonArray) . \"\\n\";\n\n $_SESSION['ccbill_transaction_info'] = array($this->transaction_amount, $this->transaction_currency);\n\n return $process_button_string;\n\n }", "public function calculatePayment()\n {\n }", "private function btn_payments(){\n\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] === VISIT_OUT_OF_SCOPE) \n\t\t\t|| ($this->rec['v_status']!= STATUS_YES) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t|| (is_object(VM::$e) && VM::$e->isEventEndorsed())\n\t\t\t)) $this->dbg('not_my_case '.$this->rec['av_lastname']);\n\n bTiming()->cpu(__function__);\n $reply = array();\n foreach(bForm_vm_Visit::_getPolicies($this->rec) as $p=>$descr){\n // The event policy has precedence over the visit policy\n if (!empty(VM::$e) && ($p_e = @VM::$E_V_policies[$p]) && !VM::$e->getPolicy($p_e)) continue;\n if (empty($descr['i'])) continue; \n\n $yes_no = (bool)bForm_vm_Visit::_getPolicy($p,$this->rec);\n $this->dbg(\"$p $descr[i] - \".var_export($yes_no,True),True);\n $icon = '';\n // don't draw useless button for the passed events\n if(!$not_my_case && (($yes_no || ($this->rec['v_end'] > time()-30*86400)))){\n\t$already_paid = Null;\n\tswitch($p){\n\t \n\tcase VM_V_provideOffice:\n\t if (myOrg()->eaMembers()->isMember($this->rec['av_id'])){\n\t $av = loader::getInstance_new('bForm_Avatar_vm',$this->rec['av_id'],array('fatal','nocache'));\n\t if ($av->isE(True) && $av->get_staffOffice()) break;\n\t }\n\t $already_paid = '';\n\t $hasRightTo = 'assign_offices';\n\t $paid = 'provided';\n\t break;\n\n\tcase VM_E_provideLunches:\n\tcase VM_E_conferenceDinner:\n\t if ($already_paid === Null){\n\t $already_paid = '';\n\t b_debug::var_dump($descr['i'],'already_paid===Null');\n\t }\n\t break;\n\n\tcase VM_V_payPerdiem:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipP(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tcase VM_V_payTrip:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipT(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tdefault:\n\t}\n\t \n\tif ($already_paid !== Null){\n\t // Show either a click-able button or just an icon\n\t $img = @$descr['i'] . ($yes_no ? '_on' : '_off');\n\t $icon = (!$already_paid && VM::hasRightTo($hasRightTo,$this->rec)\n\t\t ? bIcons()->getButton(array('class'=>'form-submit',\n\t\t\t\t\t 'i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' : ' not').\" to be $paid, click to change\",\n\t\t\t\t\t 'l'=>b_url::same(\"?resetcache_once=1&toggle_once=$p&v_id=\".$this->rec['v_id'],$this->anchor())))\n\t\t : bIcons()->get (array('i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' :' not').\" $paid\")));\n\t}\n }else{\n\t$this->dbg('too old visit '.$this->rec['av_lastname']);\n }\n $reply[] = $icon;\n }\n bTiming()->cpu();\n return $reply;\n }", "public function record_subscription_payment() { }", "public function ride_payment()\r\n\t{\r\n\t\tif (!empty($_SESSION['olouserid'])) {\r\n\t\t\t$ordercode = $_SESSION['order_code'];\r\n\t\t\t$this->load->library('zyk/OrderLib', 'orderlib');\r\n\t\t\t$data = $this->orderlib->getOrderDetails($ordercode);\r\n\t\t\t$this->template->set('ordercode',$ordercode);\r\n\t\t\t$this->template->set('userdata',$data[0]);\r\n\t\t\t$this->template->set ( 'page', 'Ride Payment' );\r\n\t\t $this->template->set ( 'description', '' );\r\n\t\t $this->template->set ( 'keywords', '' );\r\n\t\t $this->template->set_theme('default_theme');\r\n\t\t $this->template->set_layout ('default')\r\n\t\t ->title ( 'ServiceOn' )\r\n\t\t ->set_partial ( 'header', 'partials/header' )\r\n\t\t ->set_partial ( 'footer', 'partials/footer' );\r\n\t\t\t$this->template->build ('rider-payment-view');\r\n\t\t} else {\r\n\t\t\tredirect(base_url().\"login\");\r\n\t\t}\r\n\t}", "function confirm_order($order, $comments, $ecpay_feedback) {\r\n\t\t$order->add_order_note($comments, true);\r\n\t\t\r\n\t\t$order->payment_complete();\r\n\r\n\t\t// call invoice model\r\n\t\t$invoice_active_ecpay \t= 0 ;\r\n\t\t$invoice_active_allpay \t= 0 ;\r\n\r\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\r\n\r\n\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\r\n\r\n\t\tforeach($active_plugins as $key => $value)\r\n\t\t{\r\n\t\t\tif ( (strpos($value,'/woocommerce-ecpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_ecpay = 1;\r\n\t }\r\n\r\n\t if ( (strpos($value,'/woocommerce-allpayinvoice.php') !== false))\r\n\t {\r\n\t $invoice_active_allpay = 1;\r\n\t }\t\t\t\r\n\t\t}\r\n\r\n\t\tif($invoice_active_ecpay == 0 && $invoice_active_allpay == 1)\t\t// allpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/allpay_invoice/woocommerce-allpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_allpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_allpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_allpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('allpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($invoice_active_ecpay == 1 && $invoice_active_allpay == 0)\t//ecpay\r\n\t\t{\r\n\t\t\tif( is_file( get_home_path().'/wp-content/plugins/ecpay_invoice/woocommerce-ecpayinvoice.php') )\r\n\t\t\t{\r\n\t\t\t\t$aConfig_Invoice = get_option('wc_ecpayinvoice_active_model') ;\r\n\r\n\t\t\t\tif(isset($aConfig_Invoice) && $aConfig_Invoice['wc_ecpay_invoice_enabled'] == 'enable' && $aConfig_Invoice['wc_ecpay_invoice_auto'] == 'auto' )\r\n\t\t\t\t{\r\n\t\t\t\t\tdo_action('ecpay_auto_invoice', $order->id, $ecpay_feedback['SimulatePaid']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function Generate($objInvoice, $objAccount)\n \t{\n \t\t\n \t}", "public function payment(){\n\t\t$_POST['reference'] = date('NWHis');\n\t\techo json_encode($this->pagseguro->doPayment($_POST));\n\t}", "function invoice($student_id = '' , $param1 = '', $param2 = '', $param3 = '')\n\t\t{\n\t\t\t//if($this->session->userdata('parent_login')!=1)redirect(base_url() , 'refresh');\n\t\t\tif ($param1 == 'make_payment') {\n\t\t\t\t$invoice_id = $this->input->post('invoice_id');\n\t\t\t\t$system_settings = $this->db->get_where('settings', array(\n 'type' => 'paypal_email'\n\t\t\t\t))->row();\n\t\t\t\t$invoice_details = $this->db->get_where('invoice', array(\n 'invoice_id' => $invoice_id\n\t\t\t\t))->row();\n\t\t\t\t\n\t\t\t\t/****TRANSFERRING USER TO PAYPAL TERMINAL****/\n\t\t\t\t$this->paypal->add_field('rm', 2);\n\t\t\t\t$this->paypal->add_field('no_note', 0);\n\t\t\t\t$this->paypal->add_field('item_name', $invoice_details->title);\n\t\t\t\t$this->paypal->add_field('amount', $invoice_details->amount);\n\t\t\t\t$this->paypal->add_field('custom', $invoice_details->invoice_id);\n\t\t\t\t$this->paypal->add_field('business', $system_settings->description);\n\t\t\t\t$this->paypal->add_field('notify_url', base_url() . 'index.php?parents/invoice/paypal_ipn');\n\t\t\t\t$this->paypal->add_field('cancel_return', base_url() . 'index.php?parents/invoice/paypal_cancel');\n\t\t\t\t$this->paypal->add_field('return', base_url() . 'index.php?parents/invoice/paypal_success');\n\t\t\t\t\n\t\t\t\t$this->paypal->submit_paypal_post();\n\t\t\t\t// submit the fields to paypal\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_ipn') {\n\t\t\t\tif ($this->paypal->validate_ipn() == true) {\n\t\t\t\t\t$ipn_response = '';\n\t\t\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t\t\t\t$ipn_response .= \"\\n$key=$value\";\n\t\t\t\t\t}\n\t\t\t\t\t$data['payment_details'] = $ipn_response;\n\t\t\t\t\t$data['payment_timestamp'] = strtotime(date(\"m/d/Y\"));\n\t\t\t\t\t$data['payment_method'] = 'paypal';\n\t\t\t\t\t$data['status'] = 'paid';\n\t\t\t\t\t$invoice_id = $_POST['custom'];\n\t\t\t\t\t$this->db->where('invoice_id', $invoice_id);\n\t\t\t\t\t$this->db->update('invoice', $data);\n\t\t\t\t\t\n\t\t\t\t\t$data2['method']='paypal';\n\t\t\t\t\t$data2['invoice_id']=$_POST['custom'];\n\t\t\t\t\t$data2['timestamp']=strtotime(date(\"m/d/Y\"));\n\t\t\t\t\t$data2['payment_type']='income';\n\t\t\t\t\t$data2['title']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->title;\n\t\t\t\t\t$data2['description']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->description;\n\t\t\t\t\t$data2['student_id']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->student_id;\n\t\t\t\t\t$data2['amount']=$this->db->get_where('invoice' , array('invoice_id' => $data2['invoice_id']))->row()->amount;\n\t\t\t\t\t$this->db->insert('payment' , $data2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_cancel') {\n\t\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_cancelled'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/invoice/' . $student_id, 'refresh');\n\t\t\t}\n\t\t\tif ($param1 == 'paypal_success') {\n\t\t\t\t$this->session->set_flashdata('flash_message', get_phrase('payment_successfull'));\n\t\t\t\tredirect(base_url() . 'index.php?parents/invoice/' . $student_id, 'refresh');\n\t\t\t}\n\t\t\t$parent_profile = $this->db->get_where('parent', array(\n 'parent_id' => $this->session->userdata('parent_id')\n\t\t\t))->row();\n\t\t\t$page_data['student_id'] = $student_id;\n\t\t\t$page_data['page_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = get_phrase('manage_invoice/payment');\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}", "public function threeAction(){\n $isAjax = Mage::app()->getRequest()->isAjax();\n if($isAjax){\n $response = array();\n\n $payment_data = array(\n 'payment_m' => Mage::app()->getRequest()->getPost('payment_m'), // método de pago - value\n 'payment_t' => Mage::app()->getRequest()->getPost('payment_t'), // método de pago - text\n 't_payment_m' => Mage::app()->getRequest()->getPost('t_payment_m'), // forma de pago - value\n 't_payment_t' => Mage::app()->getRequest()->getPost('t_payment_t'), // forma de pago - text\n 'num_cta_m' => Mage::app()->getRequest()->getPost('num_cta_m') // num de cuenta\n );\n\n //helpers\n $facturahelper = Mage::helper('facturacom_facturacion/factura');\n\n $invoice = $facturahelper->createInvoice(\n $payment_data['payment_m'],\n $payment_data['payment_t'],\n $payment_data['t_payment_m'],\n $payment_data['t_payment_t'],\n $payment_data['num_cta_m']\n );\n\n if (isset($invoice->response) && $invoice->response == \"success\") {\n $response = array(\n 'error' => 200,\n 'message' => 'Factura creada exitósamente',\n 'data' => array(\n 'invoice' => $invoice\n )\n );\n } else {\n $response = array(\n 'error' => 400,\n 'message' => 'Ha ocurrido un error.',\n 'data' => $invoice,\n );\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }else{\n die('AJAX request only');\n }\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "public function finishPurchase() {}", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "function buy($garageID){\n if($garageID!=''){ \n if(isset($_SESSION['USERID']) && $_SESSION['USERID']!=''){ \n $productData = $this->Order->CheckGarageDataByID($garageID);\n if(!empty($productData)){\n $returnURL = DOMAIN_URL.'/'.'paypal/success'; //payment success url\n $cancelURL = DOMAIN_URL.'/'.'paypal/cancel'; //payment cancel url\n $notifyURL = DOMAIN_URL.'/'.'paypal/ipn'; //ipn url\n //get particular product data\n\n $userID = $_SESSION['USERID']; //current user id\n \n $userData=$this->Order->getUserDataByID($userID);\n if($userData['iWalletMoney']>0){\n $FInalAmount=$productData['vCoupenPrice']-$userData['iWalletMoney'];\n if($FInalAmount<=0){\n $userWalletamount=$productData['vCoupenPrice'];\n $FInalAmount=0;\n }else{\n $userWalletamount=$productData['vCoupenPrice']-$FInalAmount;\n }\n\n }else{\n $FInalAmount=$productData['vCoupenPrice'];\n $userWalletamount=0;\n }\n \n $logo =DOMAIN_URL.'/files/uploads/logo.png';\n $custom=$userID.','.$userWalletamount;\n\n $this->paypal_lib->add_field('return', $returnURL);\n $this->paypal_lib->add_field('cancel_return', $cancelURL);\n $this->paypal_lib->add_field('notify_url', $notifyURL);\n $this->paypal_lib->add_field('item_name', $productData['vGarageName']);\n $this->paypal_lib->add_field('custom', $custom);\n $this->paypal_lib->add_field('item_number', $productData['iGarageId']);\n $this->paypal_lib->add_field('amount', $FInalAmount); \n $this->paypal_lib->image($logo);\n \n $this->paypal_lib->paypal_auto_form();\n }else{\n $this->viewData['module'] = \"errors/front/404\";\n $this->load->view('template', $this->viewData); \n } \n }else{\n $this->session->set_userdata('last_page', 'order/summary/'.$garageID.'');\n redirect('../user/login'); \n }\n }else{\n $this->viewData['module'] = \"errors/front/404\";\n $this->load->view('template', $this->viewData);\n } \n }", "function process_payment( $order_id )\n {\n\n //cuando hace click en proceder al pago, luego de elegir seguripago\n //finalizar-comprar/ 1\n\n $order = new WC_Order( $order_id );\n\n return array\n (\n 'result' => 'success',\n 'redirect' => add_query_arg('order', $order->id, add_query_arg('key', $order->order_key, get_permalink(woocommerce_get_page_id('pay'))))\n );\n }", "public function paymentAction()\n {\n\n $this->initUnipagosPaymentStep();\n $this->loadLayout(); \n $this->getLayout()->getBlock(\"head\")->setTitle($this->__(\"Unipagos Payment\"));\n $this->renderLayout(); \n }", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "function Show_payonaccountPreview($return_pay_arr,$alert='',$just_for_display=false)\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,$ecom_themename,$components,\r\n\t\t\t\t\t$ecom_common_settings,$ecom_email;\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sessid\t= session_id();\r\n\t\t\t$customer_id \t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n\t\t\tif ($alert=='preview_before_gateway') // handing the case of session only if required\r\n\t\t\t{\r\n\t\t\t\t// Setting the current voucher id in session \r\n\t\t\t\tset_session_var('gateway_payonaccount_id',$return_pay_arr['pay_id']);\r\n\t\t\t}\r\n\t\t\tif(!$return_pay_arr['pay_id'])\r\n\t\t\t{\r\n\t\t\t\techo '<script type=\"text/javascript\">window.location = \"http://'.$ecom_hostname.'/payonaccountpayment.html?rt=1\"</script>';\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\tif ($alert=='preview_before_gateway' or $alert == 'preview_after_ptype') // handing the case of session only if required\r\n\t\t\t{\r\n\t\t\t\t// Get the details regarding current payment from pending details table\r\n\t\t\t\t$sql_pay = \"SELECT pendingpay_id, pay_date, sites_site_id, customers_customer_id, pay_amount, pay_transaction_type, pay_details, pay_paystatus,\r\n\t\t\t\t\t\t\t\t\t\t\tpay_paymenttype, pay_paymentmethod, pay_paystatus_changed_by, pay_paystatus_changed_on, pay_paystatus_changed_paytype,\r\n\t\t\t\t\t\t\t\t\t\t\tpay_additional_details, pay_curr_rate, pay_curr_code, pay_curr_symbol, pay_curr_numeric_code, pay_unique_key \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_pending_details \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tpendingpay_id = \".$return_pay_arr['pay_id'].\" \r\n\t\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t}\r\n\t\t\telse // case of coming to show the success details\r\n\t\t\t{\r\n\t\t\t\t// Get the details regarding current payment from pending details table\r\n\t\t\t\t$sql_pay = \"SELECT pay_id as pendingpay_id, pay_date, sites_site_id, customers_customer_id, pay_amount, pay_transaction_type, pay_details, pay_paystatus,\r\n\t\t\t\t\t\t\t\t\t\t\tpay_paymenttype, pay_paymentmethod, pay_paystatus_changed_by, pay_paystatus_changed_on, pay_paystatus_changed_paytype,\r\n\t\t\t\t\t\t\t\t\t\t\tpay_additional_details, pay_curr_rate, pay_curr_code, pay_curr_symbol, pay_curr_numeric_code \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tpay_id = \".$return_pay_arr['pay_id'].\" \r\n\t\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t$ret_pay = $db->query($sql_pay);\r\n\t\t\tif ($db->num_rows($ret_pay))\r\n\t\t\t{\r\n\t\t\t\t$row_pay = $db->fetch_array($ret_pay);\r\n\t\t\t\t// get other details related to current payment\r\n\t\t\t\t$sql_pay_cust = \"SELECT customer_title, customer_fname, customer_mname, customer_surname \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomer_id = \".$row_pay['customers_customer_id'].\" \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t\t$ret_pay_cust = $db->query($sql_pay_cust);\r\n\t\t\t\tif ($db->num_rows($ret_pay_cust))\r\n\t\t\t\t\t$row_pay_cust = $db->fetch_array($ret_pay_cust);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse // return back to payment initation page purchase page\r\n\t\t\t{\r\n\t\t\t\t// If voucher id is fake then redirect back to cart page\r\n\t\t\t\t\techo \"<script type='text/javascript'>window.location='http://\".$ecom_hostname.\"/mypayonaccountpayment.html'</script>\";\r\n\t\t\t\t\texit;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch($alert)\r\n\t\t\t{\r\n\t\t\t\tcase 'preview_before_gateway':// case of HSBC or worldpay\r\n\t\t\t\t\t$alert = 'PAYON_BEFORE_GATEWAY';\r\n\t\t\t\tbreak;\t\r\n\t\t\t\tcase 'preview_after_protx': // case of protx payment successfull\r\n\t\t\t\t\t$alert = 'PAYON_PROTX_SUCCESS';\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'preview_after_ptype': // checque/payonphone etc\r\n\t\t\t\tcase 'preview_after_self': // case of self\r\n\t\t\t\t\t$alert = 'PAYON_PREVIEW_DONE_AWAITING';\t\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'pay_succ': // case of coming directly after payment success from gateway\r\n\t\t\t\t\t// A double checking to see whether the payment status of currrent voucher is 'Paid'\r\n\t\t\t\t\tif($row_pay['pay_paystatus']=='Paid') // is paid\r\n\t\t\t\t\t\t$alert = 'PAYON_PREVIEW_DONE_PAYMENT';\t\r\n\t\t\t\t\telse \t// if not paid. case came here by directly typing the url\r\n\t\t\t\t\t\t$alert = '';\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t};\r\n\t\t\tswitch($row_pay['pay_paymentmethod'])\r\n\t\t\t{\r\n\t\t\t\tcase 'WORLD_PAY':\r\n\t\t\t\tcase 'HSBC':\r\n\t\t\t\tcase 'PROTX_VSP':\r\n\t\t\t\tcase 'GOOGLE_CHECKOUT':\r\n\t\t\t\t?>\r\n\t\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >><a href=\"<? url_link('mypayonaccountpayment.html');?>\"> <?=$Captions_arr['PAYONACC']['PAYONACCOUNT_MAINHEADING']?></a> >> <?=$Captions_arr['PAYONACC']['PAYON_BUY_TREEMENU_PREVIEWTITLE']?></div>\r\n\t\t\t\t<?php\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t?>\r\n\t\t\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >><a href=\"<? url_link('mypayonaccountpayment.html');?>\"> <?=$Captions_arr['PAYONACC']['PAYONACCOUNT_MAINHEADING']?></a> >> <?=$Captions_arr['PAYONACC']['PAYON_BUY_TREEMENU_PREVIEWTITLE']?></div>\r\n\t\t\t<?php\t\t\t\t\t\t\t\r\n\t\t\t};\r\n\t?>\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<?php \r\n\t\t\t\tif($alert and $auto_submit==false)\r\n\t\t\t\t{ \r\n\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"2\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo $alert;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t<?php \r\n\t\t\t\t}\r\n\t\t\tif($auto_submit==false)\r\n\t\t\t{\r\n\t\t\tif($Captions_arr['PAYONACC']['PAYON_VAL_PREVIEW_MESSAGE_TEXT'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"2\" class=\"shoppingcartheader\"><?=$Captions_arr['PAYONACC']['PAYON_VAL_PREVIEW_MESSAGE_TEXT']?> </td>\r\n\t\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"40%\" class=\"emailfriendtextnormal\" id=\"vouch_caption_td\"><?=$Captions_arr['PAYONACC']['PAY_AMT_LABEL']?></td>\r\n\t\t\t\t<td width=\"60%\" align=\"left\" valign=\"middle\" class=\"emailfriendtext\"><?php echo print_price($row_pay['pay_amount'])?></td>\r\n\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t\t\tif($row_pay['pay_additional_details']!='')\r\n\t\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t<td width=\"40%\" class=\"emailfriendtextnormal\" id=\"vouch_caption_td\" valign=\"top\"><?=\"Additional Details\"?></td>\r\n\t\t\t\t\t<td width=\"60%\" align=\"left\" valign=\"middle\" class=\"emailfriendtext\"><?php echo nl2br($row_pay['pay_additional_details'])?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t?>\t\t\r\n\t\t\t<tr>\r\n\t\t\t\t<td align=\"left\" width=\"40%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t<?=$Captions_arr['PAYONACC']['PAYON_PAYMENT_TYPE']?>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td align=\"left\" width=\"60%\" class=\"emailfriendtext\">\r\n\t\t\t\t<?php\techo getpaymenttype_Name($row_pay['pay_paymenttype']);?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t\t\tif ($row_pay['pay_paymentmethod']!='')\r\n\t\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td align=\"left\" width=\"40%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t\t<?=$Captions_arr['PAYONACC']['PAYON_PAYMENT_METHOD']?>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td align=\"left\" width=\"60%\" class=\"emailfriendtext\">\r\n\t\t\t\t\t\t<?php\techo getpaymentmethod_Name($row_pay['pay_paymentmethod']);?>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\tif($just_for_display==false) // show the following section only if required\r\n\t\t\t\t{\r\n\t\t\t\t\t// Get the details of current customer\r\n\t\t\t\t\t$sql_cust = \"SELECT customer_fname,customer_mname,customer_surname,customer_buildingname, customer_streetname, customer_towncity, customer_statecounty, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomer_phone, customer_fax, customer_postcode, customer_email_7503,country_id \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\t\t\tif($db->num_rows($ret_cust))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$row_cust = $db->fetch_array($ret_cust);\r\n\t\t\t\t\t\tif($row_cust['country_id'])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$sql_country = \"SELECT country_name \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgeneral_settings_site_country \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcountry_id = \".$row_cust['country_id'].\" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t\t\t\t\t$ret_country = $db->query($sql_country);\r\n\t\t\t\t\t\t\tif ($db->num_rows($ret_country))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$row_country\t \t= $db->fetch_array($ret_couintry);\r\n\t\t\t\t\t\t\t\t$cust_country\t\t= stripslashes($row_country['country_name']);\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t?>\t\t\t\t\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"2\" align=\"right\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t\t\t\tinclude 'payonaccount_preview_gateway_include.php';\r\n\t\t\t\t\t\t?>\t\t \r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"2\" align=\"right\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<input type=\"button\" name=\"submit_backhome\" class=\"buttongray\" value=\"<?php echo $Captions_arr['PAYONACC']['PAYON_PREVIEW_BACH_HOME']?>\" onclick=\"window.location ='<?php url_link('')?>'\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t</table>\r\n\t<?php\t\t\r\n\t\t\t// #############################################################################\r\n\t\t\t}", "public function custom_thankyou_page()\n {\n\n global $woocommerce;\n //respuesta del comercion tras envio de post desde seguripago\n $sp_recepcion = new seguripagoRecepcionInmediato($this->sp_idSocio, $this->sp_key, $this->sp_modo);\n\n $data = $sp_recepcion->recibir();\n $id_order = ltrim($data['num_pedido'], '0');\n $id_order = (int) $id_order;\n $order = new WC_Order( $id_order );\n /**\n * Valide aquí si el número de pedido ($data['num_pedido']) existe en su sistema.\n */\n\n if ( !isset($order->id))\n $mensaje = $this->log_payment(\"numero de orden invalido\");\n\n /**\n * Valide aquí si el número de pedido ya fue cancelado.\n */\n if ( $order->get_status() <> 'pending' )\n $mensaje = $this->log_payment(\"estado de pedido\");\n\n /**\n * Valide aquí si el importe informado por SeguriPago ($data['importe']) coincide\n * con el monto registrado en su sistema.\n */\n //$importe = (int) $data['importe'];\n\n if ( $order->get_total() <> (int) $data['importe'])\n $mensaje = $this->log_payment(\"importe del pedido\");\n\n /**\n * Validar aquí el vencimiento del pago.\n */\n //$data['fecha_vencimiento']\n\n //validando la moneda\n if ( 'PEN' <> $order->get_order_currency())\n $mensaje = $this->log_payment(\"moneda del pedido\");\n\n if ( isset($mensaje) ) return $mensaje;\n /**\n * Actualice su base de datos con la información recibida.\n */\n\n $sp_recepcion->confirmar();\n\n\n\n if($data['resultado'] == \"1\")\n {\n\n /**\n * MENSAJE PARA PAGO INMEDIATO (SeguriCrédito)\n */\n if($data['tipo_respuesta'] == \"1\")\n {\n /**\n * Envíar aquí un mensaje al usuario indicando que la operación fue aceptada\n * y dar otra información que crea conveniente.\n */\n\n include(\"includes/seguripago/plantillas/respuesta_inmediato_aceptado.php\");\n\n // Mark order processing\n $order->update_status( 'processing' );\n\n /**\n * MENSAJE PARA PAGO DIFERIDO (SeguriCash y otros)\n */\n }\n else\n {\n /**\n * Envíar aquí un mensaje al usuario indicando que se generó un número de cupón\n * a ser cancelado en las entidades financieras BCP, Scotia, según lo establecido\n * en SeguriPago.\n *\n * Se pasa como parámetro la ruta del logo del comercio y el segundo parámetro\n * indica si se mostrará la orden de pago, en modo completo (true) o resumido (false - default)\n * Ver MANUAL.txt para más detalle.\n */\n $ruta_logo = PLUGIN_DIR . 'assets/images/qhatu-logo.png';\n $html = $sp_recepcion->pantallaSeguricash( $ruta_logo, $this->title, true);\n\n /**\n * Enviar $html por correo (opcional)\n */\n\n $subject = sprintf( __( 'Pendiente de pago para la Orden %s ', 'Seguripago' ), $id_order );\n\n $customer = new WC_Customer( $order_id );\n\n //Filtro para indicar que email debe ser enviado en modo HTML\n add_filter('wp_mail_content_type',create_function('', 'return \"text/html\";'));\n\n wp_mail( $order->billing_email, $subject, $html, 'header');\n\n echo \"<center><div style='width:700px;'>$html</div></center>\";\n\n // Change the status to pending / unpaid\n //$order->update_status('pending');\n\n }\n /**\n * ---------------------- MENSAJE PARA PAGO DESAPROBADO ------------------------\n */\n } else {\n /**\n * Envíar aquí un mensaje al usuario indicando que la operación no fue aceptada.\n */\n $mailer = WC()->mailer();\n\n $message = $mailer->wrap_message( 'Error al pagar' , 'Pago a través de seguripago falló' );\n\n $subject = sprintf( __( 'Pendiente de pago para la Orden %s ', 'Seguripago' ), $id_order );\n\n //Filtro para indicar que email debe ser enviado en modo HTML\n add_filter('wp_mail_content_type',create_function('', 'return \"text/html\";'));\n\n wp_mail( $order->billing_email, $subject, $message, 'header');\n\n // Mark order complete\n $message = 'Pago a través de seguripago falló';\n $order->update_status('failed', $message );\n\n include(\"includes/seguripago/plantillas/respuesta_inmediato_rechazado.php\");\n }\n // Empty cart and clear session\n $woocommerce->cart->empty_cart();\n\n }", "public function generate_invoice() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $status = $this->input->post('status');\n $this->load->helper('common_helper');\n \n $paid_details = $this->payments_model->get_invoice_paid_details($invoice_id);\n $paid_arr = array();\n $paid_rcd_till_date = 0;\n foreach ($paid_details as $row) \n {\n $paid_rcd_till_date = $row->amount_recd + $paid_rcd_till_date;\n }\n $total_paid = $paid_rcd_till_date;\n $refund_details = $this->payments_model->get_refund_paid_details($invoice_id);\n $refund_amount = 0;\n foreach ($refund_details as $k => $row) \n {\n $refund_amount = $refund_amount + $row->amount_refund;\n }\n $paid_paid_till_date = $paid_rcd_till_date - $refund_amount;\n \n \n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n $invoice = $this->payments_model->get_invoice_details($clsid, $crsid, $userid);\n $user_org = $this->payments_model->get_user_org_details($userid);\n $invoice_amount=$invoice['total_inv_amount'];\n $invoice_amount_temp=$invoice['total_inv_amount'];\n if($status==\"PAID\"){\n \n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n $invoice_amount=$sfc_amount['amount_recd'];\n $invoice_amount1=$sfc_amount['amount_recd'];\n $invoice_amount=$invoice['total_inv_amount']-$sfc_amount['sfc_claimed'];\n if($sfc_amount['sfc_claimed']>0){\n $mop=explode('_',$sfc_amount['mode_of_pymnt']);\n \n }\n \n }\n //$outstanding_amount=$invoice_amount_temp-$invoice_amount1;\n $outstanding_amount=$invoice_amount_temp-$paid_paid_till_date;\n $tanant = $this->payments_model->get_tanant();\n $date = date('M d Y', strtotime($invoice['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date(''\n . 'h:i A', strtotime($ack_data[class_start_datetime]));\n $after_discount = $invoice['class_fees'] - $invoice['total_inv_discnt'];\n $after_gst = $after_discount + $invoice['total_gst'];\n $Url = base_url() . 'payments/print_invoice';\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n //added by sankar\n $gst_label = 'GST Not Applicable';\n $gst_prelabel = 'GST OFF';\n if (!empty($invoice['gst_rule'])) {\n $gst_label = 'GST ON, ' . $this->meta_data[$invoice['gst_rule']];\n $gst_prelabel = 'GST (' . number_format($invoice['gst_rate'], 2, '.', '') . '%)';\n }\n \n //code ends here\n\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <h2 class=\"sub_panel_heading_style\">Invoice \n <!-- commended by sankar <span class=\"label label-default push_right\"><a href=\"#export\" rel=\"modal:open\" class=\"small_text1\">Print/ Export to PDF</a></span>-->\n </h2>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td align=\"left\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n </tr>\n <tr>\n <td class=\"td_heading\" align=\"left\">' . $tanant[tenant_address] . ' </br>' .\n $tanant[tenant_city] . ' ' . get_catname_by_parm($tanant[tenant_state]) . ' ' . get_catname_by_parm($tanant[tenant_country]) . '</br>\n Tel:' . $tanant[tenant_contact_num] . ' <br>\n ' . $tanant[tenant_email_id] . ' </td>\n </tr>\n\n </table>\n\n </div>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td colspan=\"2\"><font style=\"font-size:18px; font-weight:bold;\">' . $tanant['invoice_name'] . '</font></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong>' . $tanant['invoice_name'] . ' No. </strong> ' . date('Y') . '' . $invoice['invoice_id'] . '<br><strong>' . $tanant['invoice_name'] . ' Date</strong>: ' . $date . '<br><br></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong><u>Individual Details:</u></strong></td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Address:</td>\n <td>' . $user_org[personal_address_bldg] . '</br>\n ' . $user_org[personal_address_city] . ' '\n . $this->meta_data[$user_org[personal_address_state]] . ' '\n . $this->meta_data[$user_org[personal_address_country]] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Contact No:</td>\n <td>' . $user_org[contact_number] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Attention:</td>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n </tr>\n </table>\n\n </div>\n\n <div style=\"clear:both;\"></div>\n <br>\n <div class=\"table-responsive\">\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th class=\"th_header\">Description</th>\n <th class=\"th_header\">Unit Price</th>\n <th class=\"th_header\">Total</th>\n \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' . $ack_data['crse_name'] . ', ' . $invoice['class_name'] . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n \n </tr>\n \n <tr>\n <td>' . $this->meta_data[$invoice['discount_type']] . ' Discount @ ' . number_format($invoice['discount_rate'], 2, '.', '') . '%</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">After Discounts</td>\n <td>$' . number_format($after_discount, 2, '.', '') . '</td>\n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_prelabel . '</td>\n <td>$' . number_format($invoice['total_gst'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_label . '</td>\n <td>$' . number_format($after_gst, 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Subsidy :</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Skills Future Credit :</td>\n <td></td>\n <td>$' .number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n </tr>\n \n <tr class=\"info\">\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">Invoice Amount</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n \n </tr>\n </tbody>\n </table>\n </div>\n <br>\n <div class=\"table-responsive\">\n <div>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th colspan=\"9\">Particulars of Participants</th>\n </tr>\n <tr>\n <th width=\"16%\" class=\"th_header\">Name</th>\n <th width=\"13%\" class=\"th_header\">Tax Code</th>\n <th width=\"9%\" class=\"th_header\">TG# </th>\n <th width=\"10%\" class=\"th_header\">Subsidy</th>\n <th width=\"12%\" class=\"th_header\">Discount</th>\n <th width=\"13%\" class=\"th_header\">GST Amount</th>\n <th width=\"13%\" class=\"th_header\">SFC('.$mop[1].') Amount</th>\n <th width=\"16%\" class=\"th_header\">Unit Fee(GST Applicable)</th>\n <th width=\"11%\" class=\"th_header\">Remarks </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n <td>' . $user_org[tax_code] . '</td>\n <td>' . $invoice[tg_number] . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_discnt], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_gst], 2, '.', '') . '</td>\n <td>$' . number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n <td>'. $invoice['payment_status'].'</td> \n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n <tr>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n \n <td colspan=\"2\">OUT STANDING AMOUNT</td>\n <td>$' . number_format($outstanding_amount, 2, '.', '') . '</td>\n <td></td> \n \n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div style=\"clear:both;\"></div>\n <br>\n <p class=\"red\">This is a computer generated invoice. No signature is required- ' . $tanant['tenant_name'] . ' Administrator.</p>\n <div style=\"color:red;\">' . html_entity_decode($tanant['invoice_footer_text']) . '</div>\n <div style=\"clear:both;\"></div><br>\n <span style=\"float:right;\">\n<!-- <button class=\"btn btn-primary\" type=\"submit\">Print</button></form><br><br>-->\n ';\n }", "public function display_billing_invoice()\n\t{\n\t\t$table_contact_select = '\n\t\t\t<tr>\n\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t<td>'.$this->ml_client_contact_select($this->account->client_id).'</td>\n\t\t\t</tr>\n\t\t';\n\n\t\t?>\n\t\t<h2>Invoice PDF</h2>\n\n\t\t<div id=\"invoice_data\">\n\t\t\t<?php $this->print_payment_form('none', $table_contact_select);?>\n\t\t</div>\n\n\t\t<div id=\"invoice_edit\">\n\t\t\t<div>\n\t\t\t\t<label>Client:</label><input type=\"text\" name=\"pdf_client\" value=\"<?= $this->account->name ?>\"><br/>\n\t\t\t\t<label>Contact Name:</label><input type=\"text\" name=\"pdf_contact\"><br/>\n\t\t\t\t<label>Inv Date:</label><input type=\"text\" name=\"pdf_date\" class=\"date_input\" value=\"<?php echo date(util::DATE);?>\"><br/>\n\t\t\t\t<label>Inv Number:</label><input type=\"text\" name=\"pdf_invoice_num\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div>\n\t\t\t\t<label>Address 1:</label><input type=\"text\" name=\"pdf_address_1\"><br/>\n\t\t\t\t<label>Address 2:</label><input type=\"text\" name=\"pdf_address_2\"><br/>\n\t\t\t\t<label>Address 3:</label><input type=\"text\" name=\"pdf_address_3\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?= $this->print_pdf_wpro_phone() ?>\n\n\t\t\t<div id=\"pdf_charges\" ejo>\n\t\t\t\t<label>Charges</label>\n\t\t\t\t<table>\n\t\t\t\t\t<tr><th>Amount</th><th>Description</th></tr>\n\t\t\t\t</table>\n\t\t\t\t<input type=\"button\" id=\"pdf_add_charge\" value=\"Add Charge\">\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<label>Notes</label><br/>\n\t\t\t\t<input type=\"text\" name=\"pdf_notes\">\n\t\t\t</div>\n\n\t\t\t<input type=\"hidden\" name=\"pdf_type\" value=\"invoice\">\n\t\t\t<input type=\"submit\" a0=\"action_gen_pdf\" value=\"Generate Invoice\">\n\t\t</div>\n\t\t\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "function buy(){\r\n\t\t$returnURL = base_url().'paypal/success'; //payment success url\r\n\t\t$cancelURL = base_url().'paypal/cancel'; //payment cancel url\r\n\t\t$notifyURL = base_url().'paypal/ipn'; //ipn url\r\n\t\t\r\n\t\t$r_name = $this->input->post('r_name');\r\n\t\t$id = $this->input->post('id');\r\n\t\t$price = $this->input->post('price_room');\r\n\t\t$userID = 1; //current user id\r\n\t\t$logo = base_url().'assets/img/logo.png';\r\n\t\t\r\n\t\t$this->paypal_lib->add_field('return', $returnURL);\r\n\t\t$this->paypal_lib->add_field('cancel_return', $cancelURL);\r\n\t\t$this->paypal_lib->add_field('notify_url', $notifyURL);\r\n\t\t$this->paypal_lib->add_field('item_name', $r_name);\r\n\t\t$this->paypal_lib->add_field('custom', $userID);\r\n\t\t$this->paypal_lib->add_field('item_number', $id);\r\n\t\t$this->paypal_lib->add_field('amount', $price);\t\t\r\n\t\t$this->paypal_lib->image($logo);\r\n\t\t\r\n\t\t$this->paypal_lib->paypal_auto_form();\r\n\t}", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "public function processPayment(){\r\n return true;\r\n }", "public function PaymentCredit()\n {\n\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $currency_code = $this->input->post('currencycode');\n\t\t\t$user_currencycode = $this->input->post('user_currencycode');\n if ($this->input->post('creditvalue') == 'authorize') {\n $Auth_Details = unserialize(API_LOGINID);\n $Auth_Setting_Details = unserialize($Auth_Details['settings']);\n error_reporting(-1);\n define(\"AUTHORIZENET_API_LOGIN_ID\", $Auth_Setting_Details['merchantcode']);\n define(\"AUTHORIZENET_TRANSACTION_KEY\", $Auth_Setting_Details['merchantkey']);\n define(\"API_MODE\", $Auth_Setting_Details['mode']);\n if (API_MODE == 'sandbox') {\n define(\"AUTHORIZENET_SANDBOX\", true);\n } else {\n define(\"AUTHORIZENET_SANDBOX\", false);\n }\n \n define(\"TEST_REQUEST\", \"FALSE\");\n require_once './authorize/autoload.php';\n\n $transaction = new AuthorizeNetAIM;\n $transaction->setSandbox(AUTHORIZENET_SANDBOX);\n\n\t\t\t\t$payable_amount = currency_conversion($this->input->post('user_currencycode'), 'USD', $this->input->post('total_price'),$this->input->post('currency_cron_id'));\n //echo $payable_amount;exit();\n $transaction->setFields(array('amount' => $payable_amount, 'card_num' => $this->input->post('cardNumber'), 'exp_date' => $this->input->post('CCExpMonth') . '/' . $this->input->post('CCExpYear'), 'first_name' => $userDetails->row()->firstname, 'last_name' => $userDetails->row()->lastname, 'address' => $this->input->post('address'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'country' => $userDetails->row()->country, 'phone' => $userDetails->row()->phone_no, 'email' => $userDetails->row()->email, 'card_code' => $this->input->post('creditCardIdentifier'),));\n\n $response = $transaction->authorizeAndCapture();\n //print_r($response);exit();\n\n // echo $this->input->post('total_price');exit();\n if ($response->approved != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n // echo $totalAmnt;exit();\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\t\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n if ($user_booked->num_rows() == 0) {\n $totalAmount = $totalAmnt;\n $currencyCode = $currency_code;\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n if ($currencyCode != 'USD') {\n // ,$this->input->post('currency_cron_id')\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n\t\t\t\t\t\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n // echo $this->input->post('total_price');exit();\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n }\n }\n }", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryCity = '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "public function creditCardPayment()\n {\n }", "public function actionPaynow()\n\t{ \n\t // Duration is for subscription\n\t\t$duration = Yii::app()->request->getParam(\"duration\", \"0\");\n\t\t// subscription or pre-authorization\n\t\t$type = Yii::app()->request->getParam(\"type\", \"0\");\n\t\t \n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t \n\t\t$invoiceModel = new Invoices;\n\t $payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t// Sandbox\n\t\tGoCardless::$environment = 'sandbox';\n\t\t\n\t\t// Config vars\n\t\t$account_details = array(\n\t\t 'app_id' => 'HXC009A5B8B2AX6A0C6HY4950B0JXM1Y8HEGZB9Q6CD51TDG1RR34BTG6N6H1PVK',\n\t\t 'app_secret' => 'V7MTFFF67K4SEH0AWWTHEEXWRKK7JQ4MJ0QWTZ3EP0YMG65XG9S1TCA77R2PMDYC',\n\t\t 'merchant_id' => '07N2GAPV0D',\n\t\t 'access_token' => '0T6JYNA5B1S6H2DWWA6SJ43CBTG7QVMSZR79Z1ENTWZWK59Z8616H5GWBHDDTX02'\n\t\t);\n\t\t\n\t\t// Fail nicely if no account details set\n\t\tif ( ! $account_details['app_id'] && ! $account_details['app_secret']) {\n\t\t echo '<p>First sign up to <a href=\"http://gocardless.com\">GoCardless</a> and\n\t\tcopy your sandbox API credentials from the \\'Developer\\' tab into the top of\n\t\tthis script.</p>';\n\t\t exit();\n\t\t}\n\t\t\n\t\t// Initialize GoCardless\n\t\tGoCardless::set_account_details($account_details);\n\t\t\n\t\tif (isset($_GET['resource_id']) && isset($_GET['resource_type'])) {\n\t\t // Get vars found so let's try confirming payment\n\t\t\n\t\t $confirm_params = array(\n\t\t\t'resource_id' => $_GET['resource_id'],\n\t\t\t'resource_type' => $_GET['resource_type'],\n\t\t\t'resource_uri' => $_GET['resource_uri'],\n\t\t\t'signature' => $_GET['signature']\n\t\t );\n\t\t \n\t\t // State is optional\n\t\t if (isset($_GET['state'])) {\n\t\t\t$confirm_params['state'] = $_GET['state'];\n\t\t }\n\t\t\n\t\t $confirmed_resource = GoCardless::confirm_resource($confirm_params);\n\t \n\t\t if( isset($confirmed_resource->id)) { // Successfull\n\t\t \n\t\t\t$invoiceId = $_SESSION['invoice_id']; \n\t\t \n\t\t\t// Set to paid\n\t\t $invoiceModel->updateGocardlessPayment( $confirmed_resource, $_SESSION['invoice_id']); \n\t\t\t$this->sendInvoice( $invoiceId );\n \t\t\t$this->render(\"paynow\");\n\t\t\t unset($_SESSION['invoice_id']);\n\t\t }\n\t\t else {\n\t\t \t$this->redirect(array(\"invoice/index/\".$_SESSION['invoice_id']));\n\t\t \t\n\t\t }exit;\n\t\t}\n\t\t\n /*************** *****************\n\t\t Payments Arrays \n\t\t *********************************/\t\n\t\t\t// Onetime Payment\n\t\t\tif($duration == 0) \n\t\t\t{\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'amount' => $payment[0]['payment_amount'],\n\t\t\t\t 'name' => 'Invoice Payment'\n\t\t\t\t \n\t\t\t\t);\n\t\t\t\t\n\t\t\t $payment_url = GoCardless::new_bill_url($payment_details);\n\t\t\t}\n\t\t\t//Need a subscription\n\t\t\telseif($duration > 0 && $type == 'subscription') \n\t\t\t{\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'amount' => $payment[0]['payment_amount'],\n\t\t\t\t 'interval_length' => $duration, \n\t\t\t\t 'interval_unit' => 'month',\n\t\t\t\t 'name' => 'Monthly Subscription',\n\t\t\t\t);\n\t\t\t\t$payment_url = GoCardless::new_subscription_url($payment_details);\n\t\t\t}\n\t\t\t//Need a Pre Authorization\n\t\t\telseif($duration > 0 && $type == 'authorization') \n\t\t\t{\n\t\t\t\t# - Amount Taken from Customer\n\t\t\t\t$authorization_amount = Yii::app()->request->getParam('amount','0');\n\t\t\t\tif($authorization_amount >= $payment[0]['payment_amount'])\n\t\t\t\t\t$amount = $authorization_amount;\n\t\t\t\telse\n\t\t\t\t\t$amount = $payment[0]['payment_amount'];\n\t\t\t\t\t\n\t\t\t\t$payment_details = array(\n\t\t\t\t 'max_amount' => $amount,\n\t\t\t\t 'interval_length' => $duration, \n\t\t\t\t 'interval_unit' => 'month',\n\t\t\t\t 'name' => 'Pre-Authorization',\n\t\t\t\t);\n\t\t\t\t$payment_url = GoCardless::new_pre_authorization_url($payment_details);\n\t\t\t}\t\n\t\t\t\t# - Redirecting it to Payment Gateway - GoCardless\n\t\t\t\t$this->redirect( $payment_url );\n\t\t}\n\t\t\n\t}", "public function paymentMtnIranAction(){\n \n $chapId = 23045;\n $buildId = 71259;\n $appId = 39528;\n $mobileNo = '989381994779'; \n $appName = 'Nexva Test App';\n $price = 0.01;\n \n //$client = new nusoap_client('http://92.42.55.91:8310/AmountChargingService/services/AmountCharging', false);\n $client = new nusoap_client('http://92.42.55.109:8310/AmountChargingService/services/AmountCharging', false);\n $client->soap_defencoding = 'UTF-8';\n $client->decode_utf8 = false;\n\n $timeStamp = date(\"Ymd\").date(\"His\");\n $spId = '001808';\n //$pass = 'e6434ef249df55c7a21a0b45758a39bb';\n //$spPass = md5($spId.$pass.$timeStamp);\n \n $currencyUserModel = new Api_Model_CurrencyUsers(); \n $currencyDetails = $currencyUserModel->getCurrencyDetailsByChap($chapId);\n $currencyRate = $currencyDetails['rate'];\n $currencyCode = $currencyDetails['code'];\n $amount = ceil($currencyRate * $price);\n\n $paymentTimeStamp = date('Y-m-d H:i:s');\n $paymentTransId = strtotime(\"now\");\n //$this->_paymentId\n \n $msg = '<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:v2=\"http://www.huawei.com.cn/schema/common/v2_1\" xmlns:loc=\"http://www.csapi.org/schema/parlayx/payment/amount_charging/v2_1/local\"> \n <soapenv:Header> \n <v2:RequestSOAPHeader> \n <v2:spId>'.$spId.'</v2:spId> \n <v2:spPassword></v2:spPassword> \n <v2:serviceId>0018082000002380</v2:serviceId> \n <v2:timeStamp></v2:timeStamp> \n <v2:OA>'.$mobileNo.'</v2:OA> \n <v2:FA>'.$mobileNo.'</v2:FA> \n <v2:token/> \n <v2:namedParameters>\n <v2:item>\n <v2:key>contentId</v2:key>\n <v2:value>'.$appId.'</v2:value>\n </v2:item>\n <v2:item>\n <v2:key>country</v2:key>\n <v2:value>'.$paymentTransId.'</v2:value>\n </v2:item>\n </v2:namedParameters>\n </v2:RequestSOAPHeader> \n </soapenv:Header> \n <soapenv:Body> \n <loc:chargeAmount> \n <loc:endUserIdentifier>tel:'.$mobileNo.'</loc:endUserIdentifier> \n <loc:charge> \n <description>charging information</description> \n <currency>IRR</currency> \n <amount>'.$amount.'</amount> \n <code>10080</code> \n </loc:charge> \n <loc:referenceCode>'.$timeStamp.'</loc:referenceCode> \n </loc:chargeAmount> \n </soapenv:Body> \n</soapenv:Envelope>\n';\n\n $result = $client->send($msg, '');\n\n Zend_Debug::dump($result); \n echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';\n echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';\n echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';\n \n die();\n \n }", "function _prePayment( $data )\n {\n\t\t// prepare the payment form\n $vars = new JObject();\n \n $vars->ssl_merchant_id = $this->params->get('ssl_merchant_id', '');\n $vars->ssl_user_id = $this->params->get('ssl_user_id', '');\n $vars->ssl_pin = $this->params->get('ssl_pin', '');\n $vars->test_mode = $this->params->get('test_mode', '0');\n\t\t$vars->merchant_demo_mode = $this->params->get('merchant_demo_mode', '0');\n\t\t$vars->inline_creditcard_form = $this->params->get('inline_creditcard_form', '0');\n \n\t\t$vars->ssl_customer_code = JFactory::getUser()->id;\n $vars->ssl_invoice_number = $data['orderpayment_id'];\n $vars->ssl_description = JText::_('Order Number: ').$data['order_id'];\n \n // Billing Info\n $vars->first_name = $data['orderinfo']->billing_first_name;\n $vars->last_name = $data['orderinfo']->billing_last_name;\n $vars->email = $data['orderinfo']->user_email;\n $vars->address_1 = $data['orderinfo']->billing_address_1;\n $vars->address_2 = $data['orderinfo']->billing_address_2;\n $vars->city = $data['orderinfo']->billing_city;\n $vars->country = $data['orderinfo']->billing_country_name;\n $vars->state = $data['orderinfo']->billing_zone_name;\n $vars->zip \t\t= $data['orderinfo']->billing_postal_code;\n \n $vars->amount = @$data['order_total'];\n\n\t\tif ($vars->merchant_demo_mode == 1)\n\t\t{\n\t\t\t$vars->payment_url = \"https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$vars->payment_url = \"https://www.myvirtualmerchant.com/VirtualMerchant/process.do\";\n\t\t}\n\n\t\tif ( $vars->inline_creditcard_form == 0)\n\t\t{\n\t\t\t$vars->receipt_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->failed_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$html = $this->_getLayout('prepayment', $vars);\n\t\t}\n\t\telseif ( $vars->inline_creditcard_form == 1)\n\t\t{\n\t\t\t$vars->action_url = JURI::root().\"index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element;\n\t\t\t$vars->order_id\t = $data['order_id'];\n\t\t\t$html = $this->_getLayout('paymentcreditcard', $vars);\n\t\t}\n\n return $html;\n }", "function receipt_page( $order ) {\n\n\t\t\techo '<p>'. __( 'Thank you for your order, please click the button below to pay with eSewa.', 'esewa-payment-gateway-for-woocommerce' ) . '</p>';\n\t\t\techo $this->generate_esewa_form( $order );\n\n\t\t}", "function _postPayment($data) {\r\n\t\t// Process the payment\r\n\t\t$app = JFactory::getApplication ();\r\n\t\t$vars = new JObject ();\r\n\t\t$html = '';\r\n\t\t$order_id = $_POST[\"order_id\"];\r\n\t\t\r\n\t\t/* APC Code */\r\nif ($_POST[\"order_id\"] != \"\"){\r\n// Payment confirmation from http post \r\nini_set(\"SMTP\",\"mail.nochex.com\" ); \r\n$header = \"From: [email protected]\";\r\n\r\n$your_email = $_POST[\"from_email\"]; // your merchant account email address\r\n \r\n// uncomment below to force a DECLINED response \r\n//$_POST['order_id'] = \"1\"; \r\n\r\n$url = \"https://secure.nochex.com/apc/apc.aspx\";\r\n$postvars = http_build_query($_POST);\r\n\r\n$ch = curl_init ();\r\ncurl_setopt ($ch, CURLOPT_URL, $url);\r\ncurl_setopt ($ch, CURLOPT_POST, true); \r\ncurl_setopt ($ch, CURLOPT_POSTFIELDS, $postvars);\r\ncurl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);\r\ncurl_setopt ($ch, CURLOPT_TIMEOUT, 60);\r\n//curl_setopt ($ch, CURLOPT_SSLVERSION, 0);\r\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\r\ncurl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n$response = curl_exec ($ch);\r\ncurl_close ($ch);\r\n\r\n// stores the response from the Nochex server \r\n$debug = \"IP -> \" . $_SERVER['REMOTE_ADDR'] .\"\\r\\n\\r\\nPOST DATA:\\r\\n\"; \r\nforeach($_POST as $Index => $Value) \r\n$debug .= \"$Index -> $Value\\r\\n\"; \r\n$debug .= \"\\r\\nRESPONSE:\\r\\n$response\";\r\n// Retrieves the order_id and save it as a variable which can be used in the update query to find a particular record in a database or datatable.\t\r\n\t $order_ID = $_POST['order_id']; \r\n// An email to check the order_ID\r\n\t$order = F0FTable::getInstance ( 'Order', 'J2StoreTable' )->getClone ();\r\n\t\tif ($order->load ( array (\r\n\t\t\t\t'order_id' => $order_id\r\n\t\t) )) {\r\n\t\t\r\n\t$order->transaction_id = $_POST[\"transaction_id\"];\r\n\t$order->transaction_status = $response;\r\n\t\t\t\t\t\r\nif (!strstr($response, \"AUTHORISED\")) { // searches response to see if AUTHORISED is present if it isn’t a failure message is displayed\r\n $msg = \"APC was not AUTHORISED.\\r\\n\\r\\n$debug\"; // displays debug message\t\r\n\t\r\n\t$order->transaction_details = $msg . \", and this was a \" . $_POST[\"status\"] . \" transaction\";\r\n\t$order_state_id = $this->params->get ( 'payment_status', 4 );\r\n\t$order->update_status ( $order_state_id, true );\t\t\r\n\t\r\n} else { \r\n\t$msg = \"APC was AUTHORISED\";\r\n\r\n\t$order->transaction_details = $msg . \", and this was a \" . $_POST[\"status\"] . \" transaction\";\r\n\t\r\n\t$order_state_id = $this->params->get ( 'payment_status', 4 );\r\n\t$order->update_status ( $order_state_id, true );\t\t\r\n\t\r\n\t$order->reduce_order_stock();\r\n\t$order->payment_complete();\r\n\t$order->empty_cart();\r\n\t}\r\n}\r\n}else{\r\n\r\n$html = \"<div style=\\\"padding:20px;box-shadow:1px 1px 1px #666;border:1px solid #666;margin:20px;\\\"><i class=\\\"icon-star\\\" style=\\\"color:gold;float:right\\\"></i><h3>Congratulation's</h3><p>Your order: \" . $data['order_id'] . \" has been successful</p></div>\";\r\n\r\nreturn $html;\r\n\t \r\n\t}\r\n}", "public function handlePayment() {\n $producto = [];\n $producto['items'] = [\n [\n 'name' => 'Pedido',\n 'price' => Cart::getTotal(),\n 'desc' => 'Compra cliente',\n 'qty' => 1\n ]\n ];\n $producto['invoice_id'] = 1;\n $producto['invoice_description'] = \"Compra cliente\";\n $producto['return_url'] = route('success.payment');\n $producto['cancel_url'] = route('cancel.payment');\n $producto['total'] = Cart::getTotal();\n $provider = new ExpressCheckout;\n $res = $provider->setExpressCheckout($producto);\n $res = $provider->setExpressCheckout($producto, true);\n return redirect($res['paypal_link']);\n }", "public function payout()\n\t{\n\t}", "public function getCustomOptionsOfProduct(Varien_Event_Observer $observer)\n{\n $invoice = $observer->getEvent()->getInvoice();\n$invoidData = $invoice->getData();\n//Mage::log($invoidData);\n$orderId = $invoidData['order_id'];\n$cid = $invoidData['customer_id'];\n$order1 = Mage::getModel('sales/order')->load($orderId);\n $Incrementid = $order1->getIncrementId();\n//Mage::log( $Incrementid.\"Order Id\"); \n\n// Assign Field To Inset Into CreditInfo Table\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); // Current TimeStamp\n\n$arr['c_id'] = $cid;//Customer Id\n$arr['store_view'] = Mage::app()->getStore()->getName(); //Storeview\n$arr['state'] = 1; //State Of Transaction\n$arr['order_id'] = $Incrementid; //OrderId\n$arr['action'] = \"Crdits\"; //Action\n$arr['customer_notification_status'] = 'Notified'; //Email Sending Status\n$arr['action_date'] = $nowdate; //Current TimeStamp\n$arr['website1'] = \"Main Website\"; //Website\n\nforeach ($invoice->getAllItems() as $item) {\n\n//Mage::log($item->getQty().\"Item Quntity\");\n\n$orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n$data = $orderItem->getData();\n$arr['action_credits'] = $data[0]['credits'] * $item->getQty();\n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$cid)->addFieldToFilter('website1','Main Website')->getLastItem();\n\n$totalcredits = $collection->getTotalCredits();\n$arr['total_credits'] = $arr['action_credits'] + $totalcredits;\n$arr['custom_msg'] = \"By User:For Purchage The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n$arr['item_id'] = $item->getOrderItemId();\n$table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n$table1->setData($arr);\ntry{\n if($arr['action_credits'] > 0)\n $table1->save();\n\n}catch(Exception $e){\n Mage::log($e);\n }\n\n}//end Foreach\n\n\n\n}", "function add_payment_pr($data){\n\t\tif($this->check_money($data['Clientpayment']['amount'])){\n\t\t\t\t$this->do_pr_invoice($data);\n\t\t}\n\t}", "function billing_userpanel_payment_invoiceCreate(){\n\tif(!$uid = $_SESSION['uid']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$cost = intval($_REQUEST['cost'])){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(!$method = $_REQUEST['method']){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else if(substr($method, 0, 6)=='manual'){\n\t\treturn billing_userpanel_payment_offline();\n\t} else if(!function_exists('billing_userpanel_payment_'.$method)){\n\t\te(__LINE__.\" : \".__FILE__);\n\t} else {\n\t\t$order_id = $_REQUEST['order_id'];\n\t\tif($order_id){\n\t\t\tif(!$rs = dbq(\" SELECT COUNT(*) FROM `billing_invoice` WHERE `order_id`='$order_id' \")){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else if(dbn($rs)==0){\n\t\t\t\t;// its new, we need to insert it\n\t\t\t} else if(!$rw = dbf($rs)){\n\t\t\t\te(\"billing_userpanel_payment_invoiceCreate - \".__LINE__);\n\t\t\t} else {\n\t\t\t\t$invoiceId = $rw['id'];\n\t\t\t}\n\t\t}\n\t\tif($invoiceId){\n\t\t\t;// it already inserted\n\t\t} else if(!dbq(\" INSERT INTO `billing_invoice` (`uid`,`order_id`,`cost`,`method`) VALUES ('$uid','$order_id','$cost','$method') \")){\n\t\t\te(__LINE__.\" : \".__FILE__.\" \".dbe());\n\t\t} else {\n\t\t\t$invoiceId = dbi();\n\t\t}\n\t\tcall_user_func('billing_userpanel_payment_'.$method, $invoiceId);\n\t}\n}", "function receipt_page( $order_id ) {\n global $woocommerce;\n $pluginName = 'bin_promo';\n require_once(dirname(__FILE__) . '/payment-page.php'); \n\n }", "public function _postPayment( $data )\n {\n // Process the payment\n $vars = new JObject();\n\n $app =JFactory::getApplication();\n $paction = JRequest::getVar( 'paction' );\n\n switch ($paction)\n {\n case \"display_message\":\n $session = JFactory::getSession();\n $session->set('j2store_cart', array());\n $vars->message = JText::_($this->params->get('onafterpayment', ''));\n $html = $this->_getLayout('message', $vars);\n $html .= $this->_displayArticle();\n\n break;\n case \"success_payment\":\n \n // Check User loged in\n $user = JFactory::getUser();\n if($user->id > 0){\n $jinput = JFactory::getApplication()->input;\n include(\"lib/nusoap.php\");\n $url = $this->_getPaysbuyUrl(true);\n $client = new nusoap_client($url, true);\n\n // Get this post from Paysbuy\n $inv = $jinput->post->get('apCode', 0);\n $params = array(\n \"psbID\"=>$this->params->get('psbid',''),\n \"biz\"=>$this->params->get('username',''),\n \"secureCode\"=>$this->params->get('secureCode',''),\n \"invoice\"=>$inv,\n \"flag\"=>\"\"\n );\n\n $result = $client->call(\n 'getTransactionByInvoiceCheckPost',\n array('parameters' => $params),\n 'http://tempuri.org/',\n 'http://tempuri.org/getTransactionByInvoiceCheckPost',\n false,\n true\n );\n\n $result = $result[\"getTransactionByInvoiceCheckPostResult\"];\n $info = $result[\"getTransactionByInvoiceReturn\"];\n\n JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_j2store/tables');\n $tOrder = JTable::getInstance('Orders', 'Table');\n $tOrder->load($inv);\n $order_id = intval($tOrder->id);\n\n // Check $inv from Paysbuy and owner orderinfo\n if($info['result']===\"00\" && !is_null($tOrder->id) && $tOrder->user_id==$user->id){\n \n // Update Status from Paysbuy\n $tOrder->order_state = \"Confirmed\";\n $tOrder->order_state_id = 1;\n $tOrder->store();\n }\n\n }\n\n break;\n \n default:\n $vars->message = JText::_( 'J2STORE_SAGEPAY_MESSAGE_INVALID_ACTION' );\n $html = $this->_getLayout('message', $vars);\n break;\n }\n\n return $html;\n }", "public function actionPayment() {\n\t if(!Yii::app()->session['isLogin'])\n\t {\n\t $this->redirect(\"index.php?r=users/registration\");\n\t }\n\t $quoteId = $_GET['quotes_id'];\n $model = Quotes::model()->findByPk($quoteId);\n if($model->payment_status==\"pending\")\n {\n $store_id = $this->storeID;\n\n $storeData = $this->helper->getStoreData($store_id);\n\n if($storeData[\"merchant_id\"]==\"\" || $storeData[\"public_key\"]==\"\" || (($storeData[\"private_key\"]==\"\" || $storeData[\"clientside_key\"]==\"\") && $storeData[\"payment_gateway\"]==\"braintree\") )\n\n $this->render('error',array('message'=>\"A problem found on Merchant Account Setup\"));\n\n\n else\n\n {\n Yii::import('ext.BraintreeApi.models.BraintreeCCForm');\n $payment = new BraintreeCCForm('charge',$storeData[\"merchant_id\"],$storeData[\"public_key\"],$storeData[\"private_key\"],$storeData[\"clientside_key\"]); //also option for 'customer', 'address', and 'creditcard'\n\n //Yii::app()->params[\"braintree\"][\"merchant_id\"] = $storeData[\"merchant_id\"];\n\n if(isset($_POST['BraintreeCCForm']))\n {\n if($storeData[\"payment_gateway\"]!=\"braintree\")\n {\n if($payment->validate())\n {\n $rest= $this->processAuthorize($storeData[\"merchant_id\"],$storeData[\"public_key\"]);\n if($rest==1)\n {\n $model->payment_status=\"partial\";\n $model->save();\n $this->render('success');\n return;\n }\n }\n }\n\n else {\n\n\n\n $payment->setAttributes($_POST['BraintreeCCForm']);\n //$payment->customerId = Yii::app()->session['id']; //needed for 'address' and 'creditcard' scenarios\n if($payment->validate()) {\n $result = $payment->send();\n if($result) {\n $model->payment_status=\"partial\";\n $model->save();\n $this->render('success');\n return;\n }\n\n }\n\n }\n }\n $method = $storeData[\"payment_gateway\"]==\"braintree\"?\"Braintree.net\":\"Authorized.net\";\n\n\n $customerInfo = Users::model()->findByPk(Yii::app()->session['id']);\n //var_dump($expression)\n $name= explode(\" \", $customerInfo->full_name);\n $payment->customer_email = $customerInfo->user_email;\n $payment->customer_firstName = $name[0];\n $payment->customer_lastName = $name[1];\n $payment->amount = number_format($model->upfront_payment,2);\n $payment->orderId = $name[0].\"-\".$model->id.\"-\".date('d-m-y h:i:s');\n $this->render('payment',array('model'=>$model,'payment'=>$payment,'method'=>$method,'customer'=>$customerInfo));\n }\n }\n else\n $this->redirect('index.php?r=index');\n }", "public function _prePayment( $data )\n {\n // prepare the payment form\n $vars = new JObject();\n\n $params = JComponentHelper::getParams('com_j2store');\n $currency_code = $params->get('currency_code');\n $curr_type = \"764\";\n $lang = \"t\";\n\n // Convert to thai Baht before send to Paysbuy\n if($currency_code===\"USD\"){\n $xml = JFactory::getXML( 'http://www2.bot.or.th/RSS/fxrates/fxrate-usd.xml' );\n $pre_usd = (float)$xml->item->children('cb', true)->value;\n $data['orderpayment_amount'] = $data['orderpayment_amount']*$pre_usd;\n }\n\n switch ($data['paytype']) {\n case 'cash':\n $paytype = \"cs=true\";\n break;\n \n case 'credit':\n $paytype = \"c=true\";\n break;\n\n case 'bank':\n $paytype = \"ob=true\";\n break;\n\n case 'paysbuy':\n default:\n $paytype = \"psb=true\";\n break;\n }\n\n $vars->form_url = $this->_getPaysbuyUrl().\"?\".$paytype.\"&lang=$lang\";\n $vars->username = $this->params->get('username','');\n $vars->inv = $data['orderpayment_id'];\n $vars->itm = $data['order_id'];\n $vars->amt = $data['orderpayment_amount'];\n $vars->curr_type = $curr_type;\n\n //Change to your URL\n $vars->resp_front_url = JURI::root().\"index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element.\"&paction=success_payment\";\n $vars->resp_back_url = JURI::root().\"index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=\".$this->_element.\"&paction=success_payment\";\n\n //lets check the values submitted\n $html = $this->_getLayout('prepayment', $vars);\n return $html;\n }", "public function payment(){\n\t\tcheckValidProduct($this->uri->segment(3));\n\n\t\t/* Unset Session Gift Code Not Login */\n\t\t$this->session->unset_userdata('gift_code_not_login');\n\n\t\t$data['product'] = $this->query->get('pmj_product',array(\"where\"=>array(\"id_product\"=>$this->uri->segment(3))));\n \t$data['member'] = $this->query->getMemberData(getSessionUser());\n\n \t/* Harga Product */\n\t\t$data['Amount'] = getAmount($this->uri->segment(3));\n\t\t\n \t/* For Payment */\n \t$source = $this->payment['MechantKey'].$this->payment['MerchantCode'].$this->payment['RefNo'].$data['Amount'].$this->payment['Currency'];\n\t\t$data['Signature'] = ipay88_sgn($source);\n\n\t\t$this->load->view('product/payment',$data,$this->payment);\n\t}", "public function confirmPayment(){\n $response = $this->client->queryTransaction(Input::get('AccessCode'));\n $transactionResponse = $response->Transactions[0];\n\n if ($transactionResponse->TransactionStatus) {\n //echo 'Payment successful! ID: '.$transactionResponse->TransactionID;\n /*\n echo $transactionResponse->Options[0]['Value'].' <br/>';\n echo $transactionResponse->Options[1]['Value'].' <br/>';\n echo $transactionResponse->Options[2]['Value'];\n */\n $transaction = new IcePayTransaction();\n $transaction->user_id = Auth::user()->id;\n $transaction->tid = $transactionResponse->TransactionID; //transaction id or transaction bordereaux\n $transaction->sender_email = Auth::user()->email;//$payer['email']; //sender's email\n $transaction->receiver_email = $transactionResponse->Options[1]['Value']; //receiver's email or number\n $transaction->type = 'EWAY_'.$transactionResponse->Options[0]['Value'];\n $transaction->status = 'pending';//$transaction_json['related_resources'][0]['sale']['state'];\n $transaction->amount = $transactionResponse->TotalAmount / 100; //total amount deducted and transferred\n $transaction->currency = $transactionResponse->Options[2]['Value'];\n $transaction->save();\n \n $email = Auth::user()->email;//$payer['email'];\n $username = Auth::user()->username;\n \n Mail::send(['html'=>'emails.auth.transactions'], array('tdate' => date('Y-m-d H:i:s'),\n 'tid' => $transactionResponse->TransactionID,\n 'sender_email'=>Auth::user()->email,\n 'sender_number'=>Auth::user()->number,\n 'receiver_email'=>$transaction->receiver_email,\n 'receiver_number'=>$transaction->receiver_email,\n 'status'=>'PENDING',\n 'amount'=> ($transaction->amount - $transactionResponse->Options[3]['Value'] ) .' '.$transaction->currency,\n 'charge'=>$transactionResponse->Options[3]['Value'].' '.$transaction->currency,\n 'total'=>$transaction->amount . ' '.$transaction->currency,\n 'mode'=>$transaction->type)\n , function($message) use ($email, $username){\n\t\t \t\t\t$message->to(array($email,'[email protected]','[email protected]', '[email protected]'), $username)->subject('Transaction Receipt');\n\t\t\t \t});\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertMessage', 'EWAY Transaction Successful');\n \n } else {\n $errors = str_split($transactionResponse->ResponseMessage); //previously splitte the string at the ', ' points\n foreach ($errors as $error) {\n $errmsg .= \"Payment failed: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n }\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', $errmsg);\n }\n }", "public function void_invoice() \n {\n \n $tenant_id = $this->tenant_id;\n\n $logged_in_user_id = $this->user->user_id;\n $invoice_id = $this->input->post('invoice_id');\n $pymnt_due_id = $this->input->post('pymnt_due_id');\n \n $status = $this->classtraineemodel->void_invoice($tenant_id, $logged_in_user_id,$invoice_id, $pymnt_due_id);\n if ($status) \n {\n \n $this->session->set_flashdata(\"success\", \"Successfully invoice is voided '\" . $invoice_id . \"'\");\n } \n else \n {\n $this->session->set_flashdata(\"error\", \"We were not able to voide invoice. Please try again later.\");\n }\n \n redirect(\"accounting/generate_invoice\");\n }", "public function payInvoice(){\n $data = axios();\n if( ($data['payTotal'] > 0) && $data['payInvoice'] != 0):\n $response = $this->credits->addPayInvoice($data);\n echo json_encode($response); \n endif; \n }", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "function pay() {\n if($this->active_invoice->isLoaded()) {\n\n if($this->request->isSubmitted()) {\n try {\n $payment_data = $this->request->post('payment');\n $payment_gateway_id = $this->request->post('payment_gateway_id');\n\n $payment_data['payment_gateway_id'] = $payment_gateway_id;\n\n $payer_email = $payment_data['payer_email'];\n if($payer_email && is_valid_email($payer_email)) {\n $payer = Users::findByEmail($payer_email);\n if(!$payer instanceof User) {\n $payer = new AnonymousUser($payer_email, $payer_email);\n } //if\n } //if\n\n if(!$payer instanceof IUser) {\n throw new Error('Please enter valid Email address');\n } //if\n\n $this->response->assign(array(\n 'payment_data'\t=> $payment_data,\n ));\n\n $cc_number = trim($payment_data['credit_card_number']);\n if($cc_number) {\n $response = is_valid_cc($cc_number);\n if($response !== true) {\n throw new Error($response);\n }//if\n }//if\n\n $payment_data['amount'] = str_replace(\",\",\"\",$payment_data['amount']);\n\n if(!is_numeric($payment_data['amount'])) {\n throw new Error('Total amount must be numeric value');\n }//if\n\n //check if this payment can proceed\n $this->active_invoice->payments()->canMarkAsPaid($payment_data['amount']);\n\n DB::beginWork('Creating new payment @ ' . __CLASS__);\n\n if($payment_gateway_id && $payment_gateway_id > 0) {\n $active_payment_gateway = PaymentGateways::findById($payment_gateway_id);\n if(!$active_payment_gateway instanceof PaymentGateway) {\n $this->response->notFound();\n }//if\n } else {\n throw new Error('Please select preferred payment option');\n }//if\n\n //if this method exists, please check is all necessery extension loaded\n if(method_exists($active_payment_gateway, 'checkEnvironment')) {\n $active_payment_gateway->checkEnvironment();\n }//if\n\n $active_payment = $active_payment_gateway->makePayment($payment_data, $this->active_invoice->getCurrency(), $this->active_invoice);\n\n if(!$active_payment->getIsError() && $active_payment instanceof Payment) {\n\n $active_payment->setIsPublic(true);\n $active_payment->setCreatedBy($payer);\n $active_payment->setParent($this->active_invoice);\n $active_payment->setAttributes($payment_data);\n $active_payment->setStatus(Payment::STATUS_PAID);\n $active_payment->setCurrencyId($this->active_invoice->getCurrency()->getId());\n\n //if we do express checkout\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $active_payment->setStatus(Payment::STATUS_PENDING);\n $active_payment->setReason(Payment::REASON_OTHER);\n $active_payment->setReasonText(lang('Waiting response from paypal express checkout'));\n } //if\n\n $active_payment->save();\n\n //TO-Do check this\n $this->active_invoice->payments()->changeStatus($payer, $active_payment, $payment_data);\n $this->active_invoice->activityLogs()->logPayment($payer);\n\n // Notify if not gagged\n if(!($active_payment instanceof PaypalExpressCheckoutPayment) && !$this->active_invoice->payments()->isGagged()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToFinancialManagers();\n }//if\n\n if($payer instanceof IUser && !$payer->isFinancialManager()) {\n AngieApplication::notifications()\n ->notifyAbout(PAYMENTS_FRAMEWORK . '/new_payment_to_payer', $this->active_invoice)\n ->setPayment($active_payment)\n ->sendToUsers($payer);\n }//if\n\n $this->active_invoice->payments()->paymentMade($active_payment);\n\n DB::commit('Payment created @ ' . __CLASS__);\n if($active_payment instanceof PaypalExpressCheckoutPayment) {\n $this->response->redirectToUrl($active_payment->getRedirectUrl());\n } //if\n } else {\n throw new Error($active_payment->getErrorMessage());\n } //if\n\n $this->response->assign(array(\n 'active_object'\t=> $this->active_invoice,\n ));\n } catch (Exception $e) {\n DB::rollback('Failed to make payment @ ' . __CLASS__);\n $this->response->assign('errors', $e);\n }//try\n } //if\n } else {\n $this->response->notFound();\n } // if\n }", "public function processApiInvoice($invoice)\n {\n if($this->_logging){\n Mage::log('In processApiInvoice (Postpayment)', null, $this->_logfile);\n }\n $order = $invoice->getOrder();\n // Request model, data model, product line model, total line model\n $v2RqstMdl = new Tritacv2_Model_InvoiceRequestV2Model();\n $v2DataMdl = new Tritacv2_Model_InvoicePdfDataModel();\n $v2ProdMdlArray = $this->getProductLines($order);\n $v2TtlMdlArray = $this->getOrderTotals($order);\n $shopName = Mage::app()->getStore()->getFrontendName();\n $v2DataMdl->setShopName($shopName);\n $v2DataMdl->setDescription('');\n $v2DataMdl->setProductLines($v2ProdMdlArray);\n $v2DataMdl->setTotalLines($v2TtlMdlArray);\n // finally fill request model:\n $v2RqstMdl->setTransactionNumber($invoice->getTransactionId());\n $v2RqstMdl->setInvoiceNumber($invoice->getIncrementId());\n $objDateTime = new DateTime('NOW');\n $v2RqstMdl->setInvoiceDate($objDateTime);\n $v2RqstMdl->setInvoiceAmount(Mage::helper('capayable')->convertToCents($invoice->getGrandTotal()));\n $v2RqstMdl->setInvoiceDescription(Mage::helper('capayable')->__('Order').' '.$order->getIncrementId());\n $v2RqstMdl->setInvoicePdfSubmitType('INCLUDED_DATA');\n $v2RqstMdl->setCultureCode('nl-NL');\n $v2RqstMdl->setInvoicePdfData($v2DataMdl);\n try {\n $publicKey = Mage::getStoreConfig('payment/capayable/public_key');\n $apiConfig = new Tritacv2_Configuration();\n $apiConfig->setApiKey('apikey', $publicKey); // test key 'f2d2a2aee085bfcde02d3b50e30a7394efcd49e5'\n //$apiConfig->setHost('https://capayable-api-acc.tritac.com');\n if($this->_logging) {\n Mage::log('In processApiInvoice (Postpayment) dit is url ' . $this->_url, null, $this->_logfile);\n }\n $apiConfig->setHost($this->_url);\n $apiClient = new Tritacv2_ApiClient($apiConfig);\n $invoiceApi = new Tritacv2_Api_InvoiceApi($apiClient);\n $result = $invoiceApi->invoiceV2Post($v2RqstMdl);\n if($this->_logging) {\n Mage::log('In checkCredit (Postpayment) result : ', null, $this->_logfile);\n Mage::log($result, null, $this->_logfile);\n }\n if($result->getIsAccepted() == true || $result->getIsAccepted() == 1) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n Mage::log('Exception when calling creditCheckApi->creditCheckV2Post: '. $e->getMessage(), null, $this->_logfile);\n }\n\n //return $response['IsAccepted'];\n }", "function process_button() {\r\n global $db, $order, $currencies, $currency;\r\n\r\n $this->totalsum = $order->info['total'];\r\n\r\n // save the session stuff permanently in case Nochex loses the session\r\n $db->Execute(\"delete from \" . TABLE_NOCHEX_SESSION . \" where session_id = '\" . session_id() . \"'\");\r\n\r\n $sql = \"insert into \" . TABLE_NOCHEX_SESSION . \" (session_id, saved_session, expiry) values (\r\n '\" . session_id() . \"',\r\n '\" . base64_encode(serialize($_SESSION)) . \"',\r\n '\" . (time() + (1*60*60*24*2)) . \"')\";\r\n\r\n $db->Execute($sql);\r\n\r\n\r\n $my_currency = \"GBP\";\r\n $telephone = preg_replace('/\\D/', '', $order->customer['telephone']);\r\n\t $billing_address = array();\r\n\t if(strlen($order->customer['street_address'])>0) $billing_address[] = $order->customer['street_address'];\r\n\t if(strlen($order->customer['suburb'])>0) $billing_address[] = $order->customer['suburb'];\r\n\t if(strlen($order->customer['city'])>0) $billing_address[] = $order->customer['city'];\r\n\t if(strlen($order->customer['state'])>0) $billing_address[] = $order->customer['state'];\r\n\r\n $payment_fields = array();\r\n switch(MODULE_PAYMENT_NOCHEX_ACCOUNT_TYPE) {\r\n case \"Seller\":\r\n\t\t $payment_fields[] = zen_draw_hidden_field('merchant_id', MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS);\r\n $payment_fields[] = zen_draw_hidden_field('order_id', $nochex_order_id);\r\n\t\t $payment_fields[] = zen_draw_hidden_field('description', MODULE_PAYMENT_NOCHEX_PURCHASE_DECRIPTION_TITLE);\r\n $payment_fields[] = zen_draw_hidden_field('success_url', zen_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=nochex_apc', 'SSL'));\r\n $payment_fields[] = zen_draw_hidden_field('cancel_url', zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\r\n $payment_fields[] = zen_draw_hidden_field('callback_url', zen_href_link('nochex_apc_handler.php', '', 'SSL',false,false,true));\r\n $payment_fields[] = zen_draw_hidden_field('optional_1', zen_session_name() . '=' . zen_session_id() );\r\n\t\t $payment_fields[] = zen_draw_hidden_field('billing_fullname', $order->customer['firstname'].\" \".$order->customer['lastname']);\r\n $payment_fields[] = zen_draw_hidden_field('billing_address', implode(\"\\r\\n\", $billing_address));\r\n $payment_fields[] = zen_draw_hidden_field('billing_postcode', $order->customer['postcode']);\r\n $payment_fields[] = zen_draw_hidden_field('customer_phone_number', $telephone);\r\n $payment_fields[] = zen_draw_hidden_field('email_address', $order->customer['email_address']);\r\n $payment_fields[] = zen_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)));\r\n $payment_fields[] = zen_draw_hidden_field('postage', number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)));\r\n if(MODULE_PAYMENT_NOCHEX_TESTING==\"Test\") {\r\n\t\t\t $payment_fields[] = zen_draw_hidden_field('test_transaction', '100');\r\n\t\t \t$payment_fields[] = zen_draw_hidden_field('test_success_url', zen_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=nochex_apc', 'SSL'));\r\n\t\t }\r\n break;\r\n\t case \"Merchant\":\r\n if(strlen(MODULE_PAYMENT_NOCHEX_MERCHANT_ID)>0){\r\n $merchant_id = MODULE_PAYMENT_NOCHEX_MERCHANT_ID;\r\n }else{\r\n $merchant_id = MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS;\r\n }\r\n $payment_fields[] = zen_draw_hidden_field('merchant_id', $merchant_id);\r\n $payment_fields[] = zen_draw_hidden_field('order_id', $nochex_order_id);\r\n $payment_fields[] = zen_draw_hidden_field('success_url', zen_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=nochex_apc', 'SSL'));\r\n $payment_fields[] = zen_draw_hidden_field('test_success_url', zen_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=nochex_apc', 'SSL'));\r\n $payment_fields[] = zen_draw_hidden_field('cancel_url', zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\r\n $payment_fields[] = zen_draw_hidden_field('callback_url', zen_href_link('nochex_apc_handler.php', '', 'SSL',false,false,true));\r\n $payment_fields[] = zen_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)));\r\n $payment_fields[] = zen_draw_hidden_field('postage', number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)));\r\n $payment_fields[] = zen_draw_hidden_field('optional_1', zen_session_name() . '=' . zen_session_id() );\r\n $payment_fields[] = zen_draw_hidden_field('billing_fullname', $order->customer['firstname'].\" \".$order->customer['lastname']);\r\n $payment_fields[] = zen_draw_hidden_field('billing_address', implode(\"\\r\\n\", $billing_address));\r\n $payment_fields[] = zen_draw_hidden_field('billing_postcode', $order->customer['postcode']);\r\n $payment_fields[] = zen_draw_hidden_field('customer_phone_number', $telephone);\r\n $payment_fields[] = zen_draw_hidden_field('email_address', $order->customer['email_address']);\r\n if(MODULE_PAYMENT_NOCHEX_TESTING==\"Test\"){\r\n $payment_fields[] = zen_draw_hidden_field('test_transaction', '100');\r\n }\r\n break;\r\n }\r\n\r\n return \"\\r\\n\".implode(\"\\r\\n\", $payment_fields).\"\\r\\n\";\r\n }", "function make_subscription_button($product,$item_name,$purchase_id,$amount,$length,$length_units,$currency)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\t\t$ipn_url=$this->get_ipn_url();\n\t\treturn do_template('ECOM_SUBSCRIPTION_BUTTON_VIA_PAYPAL',array('PRODUCT'=>$product,'ITEM_NAME'=>$item_name,'LENGTH'=>strval($length),'LENGTH_UNITS'=>$length_units,'PURCHASE_ID'=>$purchase_id,'AMOUNT'=>float_to_raw_string($amount),'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url));\n\t}", "public function notifyPayment()\n {\n }", "public function paymentAction()\r\n {\r\n if($this->Request()->getParam('confimOffer',false)) {\r\n return $this->redirect(array(\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'finish'\r\n ));\r\n }\r\n\r\n try{\r\n $agbChecked = $this->Request()->getParam('sAGB', false);\r\n $offerCheckAGB = Shopware()->Plugins()->Backend()->sKUZOOffer()->Config()->offerCheckAGB;\r\n if(!$agbChecked && (isset($offerCheckAGB) && !empty($offerCheckAGB))) {\r\n return $this->forward('offers');\r\n }\r\n\r\n $this->prepareBasket();\r\n if (empty($this->session['sOrderVariables'])) {\r\n return $this->forward('offers');\r\n }\r\n\r\n $offerId = $this->Request()->getParam('offerId');\r\n Shopware()->Session()->offerId = $offerId;\r\n\r\n if (empty($this->View()->sPayment['embediframe'])\r\n && empty($this->View()->sPayment['action'])) {\r\n $this->redirect(array(\r\n 'controller' => 'checkout',\r\n 'action' => 'finish',\r\n 'sAGB' => 1,\r\n 'offerAcception' => 1\r\n ));\r\n\r\n } else {\r\n $this->redirect(array(\r\n 'controller' => 'checkout',\r\n 'action' => 'payment',\r\n 'sAGB' => 1\r\n ));\r\n }\r\n\r\n } catch (Exception $e) {\r\n $order = Shopware()->Modules()->Order();\r\n $order->sDeleteTemporaryOrder();\r\n $this->sDeleteBasketOrder();\r\n throw new Enlight_Exception(\"Error making Order:\" . $e->getMessage(), 0, $e);\r\n }\r\n\r\n }", "function take_sale_payment($param1 = '' , $param2 = '')\n\t{\n\t\tif ($this->session->userdata('admin_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login');\n\t\t$page_data['invoice_id'] = $param1;\n\t\t$page_data['page_name'] = 'take_sale_payment';\n\t\t$page_data['page_title'] = translate('take_payment');\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function receipt_page( $order_id ) {\n global $woocommerce;\n $pluginName = 'fullpayment';\n // Separated as Shared PHP included by multiple class\n require_once(dirname(__FILE__) . '/payment-page.php'); \n\n }", "function remitaGetReceipt(){\n\n // redirect(base_url() . 'index.php?login', 'refresh');\n\t\t$this->session->set_userdata('putme_login', 1);\n\n\t\t\n\n\t\t$page_data['page_name'] = 'remitaGetReceipt';\n\n $page_data['page_title'] = get_phrase('Payment Confirmation');\n\n $this->load->view('backend/putm', $page_data);\n\n\t}", "function _prePayment( $data )\r\n {\r\n // prepare the payment form\r\n \r\n $app = JFactory::getApplication();\r\n $session = JFactory::getSession();\r\n \r\n// Gather Order Ids, amount, and variables \r\n\r\n $order_id = $data['order_id'];\r\n $orderpayment_id = $data['orderpayment_id'];\r\n $amount = $data['orderpayment_amount'];\r\n \r\n $merchant_id = $this->params->get(\"merchant_id\");\r\n $test_mode = $this->params->get(\"sandbox\");\r\n $xmlCollection = $this->params->get(\"xmlcollection\");\r\n\r\n// Check Test Mode has been enabled by the Merchant\r\nif ($test_mode == 1){\r\n\t$test_transaction = \"100\";\r\n}else{\r\n\t$test_transaction = \"\";\r\n}\r\n \r\n\t\tF0FTable::addIncludePath ( JPATH_ADMINISTRATOR . '/components/com_j2store/tables' );\r\n\t\t$order = F0FTable::getInstance ( 'OrderInfo', 'J2StoreTable' );\r\n\t\r\n// Get Product Details from the Shopping Cart\r\n\t\t$cart = F0FTable::getInstance('Cart', 'J2StoreTable')->getClone();\r\n\t\t\r\n\t\t\t\t$cartitem_model = F0FModel::getTmpInstance('Cartitems', 'J2StoreModel');\r\n\t\t\t\t$cartitem_model->setState('filter_cart', $data['orderpayment_id']);\r\n\t\t\t\t$items = $cartitem_model->getList();\r\n\t\t\t\t\r\n$products = array_unique($items, SORT_REGULAR);\r\n$xmlcollect = \"<items>\";\r\nforeach($products as &$item) {\r\n\t\r\n\t$description = \"Product ID: \" . $item->product_id . \", Product Name: \" . $item->sku . \", Product Quantity: \" . number_format($item->product_qty,0) . \", Product Price: \". number_format($item->price,2);\r\n\t$xmlcollect .= \"<item><id>\".$item->product_id.\"</id><name>\".$item->sku.\"</name><description>\".$item->sku.\"</description><quantity>\".number_format($item->product_qty,0).\"</quantity><price>\".number_format($item->price,2).\"</price></item>\";\r\n}\r\n$xmlcollect .= \"</items>\";\r\n\r\n// Check XML collection has been enabled by the Merchant\r\nif ($xmlCollection ==1){\r\n\r\n$description = \"Order created for: \" . $order_id;\r\n\r\n}else{\r\n\r\n$xmlcollect = \"\";\r\n\r\n}\r\n\r\n// Billing Address Details\r\n$billing_fullname = $order->billing_first_name . \", \" . $order->billing_last_name;\r\n$billing_address = $order->billing_address_1 . \", \" . $order->billing_address_2;\r\n$billing_city = $order->billing_city;\r\n$billing_postcode = $order->billing_zip;\r\n\r\n$delivery_fullname = $order->shipping_first_name . \", \" . $order->shipping_last_name;\r\n$delivery_address = $order->shipping_address_1 . \", \" . $order->shipping_address_2;\r\n$delivery_city = $order->shipping_city;\r\n$delivery_postcode = $order->shipping_zip;\r\n\r\n// Phone Number\r\n$customer_phone_number = $order->billing_phone_1;\r\n\r\n// Email Address\r\n$email_address = str_replace(\"{\",\"\",$order->all_billing);\r\n$email_address = str_replace(\"}\",\"\",$email_address);\r\n$email_address = str_replace(\":\",\"\",$email_address);\r\n$email_address = str_replace(\",\",\"\",$email_address);\r\n$email_address = str_replace('\"','',$email_address);\r\n$email_address = str_replace(\"emaillabelJ2STORE_EMAILvalue\",'',$email_address);\r\n\r\n$callback_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n$success_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n$cancel_url = JROUTE::_(JURI::root() . 'index.php?option=com_j2store&view=carts&orderpayment_type=payment_nochex&paction=display&id='.$order_id); \r\n\r\n$html = \"<form action=\\\"https://secure.nochex.com/default.aspx\\\" method=\\\"post\\\" name=\\\"nochexForm\\\">\r\n <input type=\\\"hidden\\\" name=\\\"order_id\\\" value=\\\"\".$order_id.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"merchant_id\\\" value=\\\"\".$merchant_id.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"amount\\\" value=\\\"\".$amount.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"description\\\" value=\\\"\".$description.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"xml_item_collection\\\" value=\\\"\".$xmlcollect.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_fullname\\\" value=\\\"\".$billing_fullname.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_address\\\" value=\\\"\".$billing_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_city\\\" value=\\\"\".$billing_city.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"billing_postcode\\\" value=\\\"\".$billing_postcode.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_fullname\\\" value=\\\"\".$delivery_fullname.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_address\\\" value=\\\"\".$delivery_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_city\\\" value=\\\"\".$delivery_city.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"delivery_postcode\\\" value=\\\"\".$delivery_postcode.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"customer_phone_number\\\" value=\\\"\".$customer_phone_number.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"email_address\\\" value=\\\"\".$email_address.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"callback_url\\\" value=\\\"\".$callback_url.\"\\\"> \r\n <input type=\\\"hidden\\\" name=\\\"test_success_url\\\" value=\\\"\". $success_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"success_url\\\" value=\\\"\". $success_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"cancel_url\\\" value=\\\"\". $cancel_url.\"\\\" > \r\n <input type=\\\"hidden\\\" name=\\\"test_transaction\\\" value=\\\"\" .$test_transaction.\"\\\"> \r\n <input type=\\\"submit\\\" class=\\\"j2store_cart_button btn btn-primary\\\" value=\\\"Make a Payment\\\" /> \r\n</form>\";\r\n\r\n return $html;\r\n }", "public function buy()\n\t{\n\t\t$data['aktif']\t= 'prospektus';\n\t\t$this->template->load('template','prospektus/V_buy', $data);\n\t}", "public function index()\n {\n $invoice = new CheckoutInvoice();\n $invoice->addItem(\"Chaussures Croco\", 3, 10000, 30000, \"Chaussures faites en peau de crocrodile authentique qui chasse la pauvreté\");\n $ticker = Rendez_vous::where('user_id', '=', Auth::guard('web')->user()->id)->where('status','=',1 )->where('date_medecin', '>=' ,Carbon::today())->first();\n // dd($ticker->medecin->prix);\n $invoice->setTotalAmount($ticker->medecin->prix);\n $invoice->setCallbackUrl(\"http://fathomless-escarpment-76115.herokuapp.com\");\n \n\n\n if($invoice->create()) {\n $ticker = Rendez_vous::where('user_id', '=', Auth::guard('web')->user()->id)->where('status','=',1 )->where('date_medecin', '>=' ,Carbon::today())->first();\n $ticker->prix = $ticker->medecin->prix;\n $ticker->save();\n return redirect(url($invoice->getInvoiceUrl()));\n }else{\n dd($invoice->response_text);\n }\n }", "private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "function init_process_payment() {\r\n global $woocommerce;\r\n\r\n\t if((isset($_GET['ng_netgiroSignature']) && $_GET['ng_netgiroSignature'])\r\n\t\t && $_GET['ng_orderid'] && $_GET['ng_transactionid'] ) {\r\n \r\n\t\tif ( function_exists( 'wc_get_order' ) ) {\r\n\t\t\t$order = wc_get_order( $_GET['ng_orderid'] );\r\n\t\t} else {\r\n\t\t\t$order = new WC_Order( $_GET['ng_orderid'] );\r\n\t\t} \r\n\t\t\r\n\t\t$str = $this->secretkey . $_GET['ng_orderid'];\r\n $hash = hash('sha256', $str);\r\n if($hash==$_GET['ng_signature']) {\r\n $order -> payment_complete();\r\n $order -> add_order_note('Netgíró greiðsla tókst<br/>Tilvísunarnúmer frá Netgíró: '.$_REQUEST['ng_invoiceNumber']); \r\n $woocommerce->cart->empty_cart();\r\n wp_redirect($this->get_return_url( $order ));\r\n exit;\r\n } else {\r\n // Set order status to failed\r\n $order -> update_status('failed');\r\n $order -> add_order_note('Netgiro payment failed. Woocommerce order id: ' . $_GET['ng_orderid'] . ' and Netgiro reference no.: ' . $_REQUEST['ng_invoiceNumber'] . ' does relate to signature: ' . $_GET['ng_signature']); \r\n\t\t \r\n\t\t wc_add_notice(\"Ekki tókst að staðfesta Netgíró greiðslu! Vinsamlega hafðu samband við verslun og athugað stöðuna á pöntun þinni nr. \" . $_GET['ng_orderid'], 'error');\r\n\t\t wp_redirect($this->get_return_url( $order ));\r\n\t\t exit;\r\n }\r\n }\r\n }", "function getfaircoin_trigger_purchase_receipt( $payment_id ) {\r\n remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1 );\r\n\t// Make sure we don't send a purchase receipt while editing a payment\r\n\tif ( isset( $_POST['edd-action'] ) && 'edit_payment' == $_POST['edd-action'] )\r\n\t\treturn;\r\n\r\n $gateway = edd_get_payment_gateway( $payment_id );\r\n if( $gateway == 'paypal'){\r\n // Send email with secure download link\r\n edd_email_purchase_receipt( $payment_id );\r\n } else {\r\n return;\r\n }\r\n}", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "function cfc_edd_purchase_form_before_submit() { ?>\n\t<p><?php _e('Click on the button below to make your donation', 'cfctranslation'); ?>\t</p>\n<?php }", "function handleSinglePayment(&$input, &$ids, &$objects) {\r\n $contribution =& $objects['contribution'];\r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaction();\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n $this->completeTransaction($input,$ids,$objects,$transaction,false);// false= not recurring\r\n $output = '<div id=\"logo\"><h1>Thank you</h1><p>Your payment was successful.</p><p>Please <a href=\"' . $ids[\"thankyoupage\"] . '\">click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n $this->cancelled($objects,$transaction);\r\n $output = '<h1>Transaction Cancelled</h1><p>Your payment was cancelled or rejected.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else {\r\n CRM_Core_Error::debug_log_message(\"Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n $output = '<h1>Error</h1><p>There was an error while processing your payment.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n return false;\r\n }\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }", "public function joinPaymentInfo();", "public function add_pay_form()\n\t{\n\t\tif ($this->checkLogin('A') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\telse {\n\t\t\t$this->data['heading'] = 'Add admin payment';\n\t\t\t\n\t\t\t$sid = $this->uri->segment(4,0);\n\t\t\t$guestid = $this->uri->segment(5,0);\n\t\t\t\n\t\t\t$getGuestEmail=$this->review_model->get_all_details(USERS,array('id'=>$guestid));\n\t\t\t$theEmail_is=$getGuestEmail->row()->email;\t\t\t\n\t\t\t$hostEmailQry = $this->review_model->get_commission_track_id($sid);\n\t\t\t$product_id = $hostEmailQry->row()->prd_id;\n\t\t\t$hostEmail = $hostEmailQry->row()->host_email;\n\t\t\t\t\n\t\t\t$this->data['hostEmail'] = $hostEmail;\t\t\t\n\t\t\t$this->data['bookid'] = $sid;\n\t\t\t\n\t\t\t$rental_booking_details= $this->review_model->get_unpaid_commission_tracking($hostEmail,$sid);\t\t\t\n\t\t\t$payableAmount = 0;\t\t\t\n\t\t\t$admin_currencyCode=$this->session->userdata('fc_session_admin_currencyCode');\n\t\t\t\n\t\t\tif(count($rental_booking_details) != 0)\n\t\t\t{ \n\t\t\t\tforeach($rental_booking_details as $rentals)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t//echo $rentals['user_currencycode'].'|'.$rentals['currency_cron_id'].'<br>';\n\t\t\t\t\t$currencyPerUnitSeller=$rentals['currencyPerUnitSeller'];\n\t\t\t\t\t//echo $currencyPerUnitSeller;\n\t\t\t\t\tif($rentals['currency_cron_id']=='' || $rentals['currency_cron_id']==0) { $currencyCronId='';} else { $currencyCronId=$rentals['currency_cron_id']; }\n\t\t\t\t\tif ($rentals['cancel_percentage']!='100')\n\t\t\t\t\t{\t \n\t\t\t\t\t\t//echo $rentals['user_currencycode'].'|'.$admin_currencyCode;\t\t//For moderate and Flexible\n\t\t\t\t\t\tif($rentals['user_currencycode']!=$admin_currencyCode)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!empty($currencyPerUnitSeller))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rentals['subTotal']=changeCurrency($rentals['user_currencycode'],$admin_currencyCode,$rentals['subtotal'],$currencyCronId);\n\t\t\t\t\t\t\t\t\t//customised_currency_conversion($currencyPerUnitSeller,$rentals['subtotal']);\n\t\t\t\t\t\t\t\t\t$rentals['secdep']=changeCurrency($rentals['user_currencycode'],$admin_currencyCode,$rentals['secDeposit'],$currencyCronId);\n\t\t\t\t\t\t\t\t\t//customised_currency_conversion($currencyPerUnitSeller,$rentals['secDeposit']);\n\t\t\t\t\t\t\t\t\t$cancel_amount_toHost = $rentals['subTotal']/100 * $rentals['cancel_percentage'];\n\t\t\t\t\t\t\t\t\t$cancel_amount=$rentals['subTotal']-$cancel_amount_toHost; //to guest\n\t\t\t\t\t\t\t\t\t$cancel_amountWithSecDeposit=$cancel_amount+$rentals['secdep']; //to guest\n\t\t\t\t\t\t\t\t\t$re_payable= $cancel_amountWithSecDeposit;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$re_payable=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cancel_amount_toHost = $rentals['subTotal']/100 * $rentals['cancel_percentage'];\n\t\t\t\t\t\t\t\t$cancel_amount=$rentals['subTotal']-$cancel_amount_toHost; //to guest\n\t\t\t\t\t\t\t\t$cancel_amountWithSecDeposit=$cancel_amount+$rentals['secDeposit'];\n\t\t\t\t\t\t\t\t$re_payable= $cancel_amountWithSecDeposit;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{ \n\t\t\t\t\n\t\t\t\t//If Strict Means only Sec Deposit to Guest\n\t\t\t\t\t\t\tif($rentals['user_currencycode']!=$admin_currencyCode)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!empty($currencyPerUnitSeller))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t $strict_amount=changeCurrency($rentals['user_currencycode'],$admin_currencyCode,$rentals['secDeposit']);//customised_currency_conversion($currencyPerUnitSeller,$rentals['secDeposit']);\n\t\t\t\t\t\t\t\t\t$re_payable= $strict_amount; \t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$re_payable=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$strict_amount = $rentals['secDeposit'];\n\t\t\t\t\t\t\t\t$re_payable = $strict_amount; \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t$payableAmount = $re_payable; \n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t\n\t\t\t$this->data['payableAmount'] = $payableAmount;\n\t\t\t$this->data['GuestEmail'] = $theEmail_is;\n\t\t\t$this->load->view('admin/dispute/add_admin_payment',$this->data);\n\t\t}\n\t}", "function receipt_page( $order ) {\n\n $result = $this->process_payment($order);\n echo $this->build_gateway_form( $result );\n }", "public function pos_invoice(){\n\t\t\n\t\tredirect('dashboard_pharmacist/invoice/Cinvoice');\n\t\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$content = $CI->linvoice->pos_invoice_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "function invoice($param1 = '', $param2 = '', $param3 = '')\n {\n \n if ($param1 == 'create') {\n \n $data['student_id'] = $this->input->post('student_id');\n $data['title'] = $this->input->post('title');\n $data['description'] = $this->input->post('description');\n $data['amount'] = $this->input->post('amount');\n $data['amount_paid'] = $this->input->post('amount_paid');\n $data['due'] = $data['amount'] - $data['amount_paid'];\n $data['status'] = $this->input->post('status');\n $data['creation_timestamp'] = date(\"d-m-Y\", strtotime($this->input->post('date')));\n \n $this->db->insert('invoice', $data);\n $invoice_id = $this->db->insert_id();\n\n $data2['invoice_id'] = $invoice_id;\n $data2['student_id'] = $this->input->post('student_id');\n $data2['title'] = $this->input->post('title');\n $data2['description'] = $this->input->post('description');\n $data2['payment_type'] = 'Fee';\n $data2['method'] = $this->input->post('method');\n $data2['amount'] = $this->input->post('amount_paid');\n $data2['timestamp'] = date(\"d-m-Y\", strtotime($this->input->post('date')));\n \n $this->db->insert('payment' , $data2);\n\n // $this->session->set_flashdata('flash_message' , get_phrase('data_added_successfully'));\n echo \"addeed\";\n redirect(base_url() . 'admin/invoice', 'refresh');\n }\n $page_data['page'] = 'Admin/payment';\n // $page_data['page_title'] = get_phrase('manage_invoice/payment');\n $this->db->order_by('creation_timestamp', 'desc');\n $page_data['invoices'] = $this->db->get('invoice')->result_array();\n $this->load->view('common/template', $page_data);\n }", "function PaymentWallet()\n {\n //echo '<pre>';print_r($_POST);\n //echo $this->input->post('total_price');exit;\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $loginUserId = $this->checkLogin('U');\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n $currency_code = $this->input->post('currencycode');\n $response = 'yes';\n {\n //echo '<pre>';print_r($response);die;\n if ($response != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $seller = $this->checkout_model->get_all_details(USERS, array('id' => $product->row()->user_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\n }\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n //echo $user_booked->num_rows();\n if ($user_booked->num_rows() == 0) {\n $booked_data_Q = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'dealCodeNumber' => $randomId));\n $totalAmount = $booked_data_Q->row()->total;\n $currencyCode = $booked_data_Q->row()->currency_code;\n //Commission percent\n // $book_commission_query = 'SELECT * FROM ' . COMMISSION . ' WHERE seo_tag = \"guest_invite_accept\" AND status=\"Active\"';\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n //echo $this->db->last_query();\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n //echo $book_commission->row()->commission_percentage.'--'.$referal_commission;\n //Commission amount currency conversion\n if ($currencyCode != 'USD') {\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n //referred user existing data\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n /* referal user commission payment ends */\n //echo $this->db->last_query();exit;\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $currency_code);\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n //redirect('order/failure/'.$response->response_reason_text);\n }\n }\n }", "private function _generateInvoice()\n {\n $order = $this->_getOrder();\n if ($order->canInvoice()) {\n $invoice = $order->prepareInvoice();\n\n $invoice->register();\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n \n $invoice->pay()->save();\n\n $order->save();\n\n $invoice->sendEmail(\n (boolean) Mage::getStoreConfig(\n 'payment/paymentnetwork_pnsofortueberweisung/send_mail', \n Mage::app()->getStore()->getStoreId()\n ), ''\n );\n }\n }", "private function processPayment($data){\n $p_cust_id_cliente = env('EPAYCO_P_CUST_ID_CLIENTE');\n $p_key = env('EPAYCO_P_KEY');\n $x_ref_payco = $data->x_ref_payco;\n $x_transaction_id = $data->x_transaction_id;\n $x_amount = $data->x_amount;\n $x_currency_code = $data->x_currency_code;\n $x_signature = $data->x_signature;\n $signature = hash('sha256', $p_cust_id_cliente . '^' . $p_key . '^' . $x_ref_payco . '^' . $x_transaction_id . '^' . $x_amount . '^' . $x_currency_code);\n $x_response = $data->x_response;\n $x_response_reason_text = $data->x_response_reason_text;\n $x_id_invoice = $data->x_id_invoice;\n $x_autorizacion = $data->x_approval_code;\n\n //Validamos la firma\n if ($x_signature != $signature) {\n die(\"Firma no valida\");\n }\n\n $this->saveTransaction($data);\n NotificationController::notify('delivery', $data->x_extra3, $x_amount,$data->x_extra5,\"0\");\n\n return response()->json([\n 'success' => true,\n 'message' => 'transacción procesada'\n ],200);\n\n }", "function buy($id,$amount,$user_id,$g_name){\n\t\t$returnURL =base_url($this->data['theme'] .'/buy_service/paypal_success/'); //payment success url\n\t\t$cancelURL = base_url($this->data['theme'] .'/buy_service/paypal_cancel'); //payment cancel url\n\t\t$notifyURL = base_url().'user/buy_service/ipn'; //ipn url\n\t\t//get particular product data\n\t\t//$product = $this->product->getRows($id);\n\t\t$userID = $user_id; //current user id\n\t\t$name =$g_name;\n\t\t $this->paypal_lib->add_field('return', $returnURL);\n\t\t $this->paypal_lib->add_field('cancel_return', $cancelURL);\n\t\t $this->paypal_lib->add_field('notify_url', $notifyURL);\n\t\t $this->paypal_lib->add_field('item_name', $name);\n\t\t $this->paypal_lib->add_field('custom', $userID);\n\t $this->paypal_lib->add_field('item_number', $id);\n\t\t $this->paypal_lib->add_field('amount', $amount);\t\t\n\t\t//$this->paypal_lib->image($logo);\n\n\t\t\n\t\t$this->paypal_lib->paypal_auto_form();\n\t}", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "function XSAInvoicingCreditdirect($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t// *********************************************** //\n // ********************************************** //\n // ******** No dejar echo en la funcion *********//\n // ******** Declarar Variables a usar ******** //\n // ******** Afecta al punto de venta ********* //\n // ****************************************** //\n // ***************************************** //\n \n\t//inicializo la variable $imprimepublico\n\t$imprimepublico=0;\t\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie.$folio;\n\t$serieelect=$serie;\n\t$folioelect=$folio;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t$detallerecibos = \"\";\n\t// consulto datos de la factura\n\t$SQLInvoice = \"SELECT\n\t\t\t\treplace(debtortransmovs.origtrandate,'-','/') as origtrandate,\n\t\t\t\tSUM(abs(debtortransmovs.ovamount)) AS ovamount,\n\t\t\t\tSUM(abs(debtortransmovs.ovgst)) AS ovgst,\n\t\t\t\tdebtortransmovs.currcode,\n\t\t\t\tdebtortransmovs.rate as cambio,\n\t\t\t\tdebtortransmovs.order_,\n\t\t\t\treplace(debtortransmovs.trandate,'-','/') as trandate,\n\t\t\t\tdebtortransmovs.debtorno,\n\t\t\t\tIF(relacion_factoraje.iddebtortrans IS NOT NULL, suppliers.taxid,custbranch.taxid) as rfc,\n\t\t\t\tIF(relacion_factoraje.iddebtortrans IS NOT NULL, suppliers.suppname,debtorsmaster.name) as name,\n\t\t\t\tdebtorsmaster.address1,\n\t\t\t\tdebtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,\n\t\t\t\tdebtorsmaster.address4,\n\t\t\t\tdebtorsmaster.address5,\n\t\t\t\tdebtortransmovs.branchcode,\n\t\t\t\tcustbranch.braddress1,\n\t\t\t\tcustbranch.braddress2,\n\t\t\t\tcustbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,\n\t\t\t\tcustbranch.braddress5,\n\t\t\t\tcustbranch.braddress6,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.specialinstructions,\n\t\t\t\tcustbranch.brpostaddr1,\n\t\t\t\tcustbranch.brpostaddr2,\n\t\t\t\tcustbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,\n\t\t\t\tcustbranch.brpostaddr5,\n\t\t\t\tcustbranch.brpostaddr6,\n\t\t\t\tcustpais as brpostaddr7,\n\t\t\t\twww_users.realname,\n\t\t\t\tdebtortransmovs.transno,\n\t\t\t\tdebtortrans.reference,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\t\tIFNULL(debtortrans.nocuenta,IFNULL(custbranch.nocuenta,'')) as nocuenta,\n\t\t\t\tdebtortrans.observf,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as codesat,\n\t\t\t\tdebtortrans.id,\n\t\t\t\tdebtortrans.invtext,\n\t\t\t\tcustbranch.custpais\n\t\t\tFROM debtortransmovs\n\t\t\t\tINNER JOIN debtortrans ON debtortrans.type = debtortransmovs.type AND debtortrans.transno = debtortransmovs.transno\n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tLEFT JOIN relacion_factoraje ON relacion_factoraje.iddebtortrans = debtortrans.id\n\t\t\t\tLEFT JOIN suppliers ON suppliers.supplierid = relacion_factoraje.supplierid\n\t\t\t\t,debtorsmaster,custbranch, www_users\n\t\t\tWHERE debtortransmovs.type=$TypeInvoice\n\t\t\t\tAND debtortransmovs.transno=$InvoiceNo\n\t\t\t\tAND debtortransmovs.tagref=$tag\n\t\t\t\tAND debtortransmovs.debtorno=debtorsmaster.debtorno\n\t\t\t\tAND debtortransmovs.debtorno=custbranch.debtorno\n\t\t\t\tAND debtortransmovs.branchcode=custbranch.branchcode\n\t\t\t\tAND www_users.userid = debtortransmovs.userid\n\t\t\tGROUP BY debtortransmovs.transno\";\n\n\n\t\t\t// echo \"<br> <pre>\".$SQLInvoice;\n\n\n\t$Result=DB_query($SQLInvoice,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t{\n\t\t\t$myrow = DB_fetch_array($Result);\n\t\t\t// fecha emision\n\t\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t\t$UserRegister=\"\";//$myrow['UserRegister'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t\n\t\t\t// subtotal\n\t\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t\t$nombre=$myrow['name'];\n\n\t\t\t\n\t\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\t\tif ((strlen($rfccliente)<12) OR (strlen($rfccliente)>=14)){\n\t\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t\t$nombre=\"Publico en General\";\n\t\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t\t$imprimepublico=1;\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t\t// total factura\n\t\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\t\t\t$charelectronic=$charelectronic.'|'.abs($total);\n\t\t\t// total de iva\n\t\t\t$iva=number_format($myrow['ovgst'],2,'.','');\n\t\t\t// transladado\n\t\t\t$charelectronic=$charelectronic.'|'.abs($iva);\n\t\t\t// retenido\n\t\t\t$ivaret=0;\n\t\t\t$charelectronic=$charelectronic.'|'.abs($ivaret);\n\t\t\t//descuento\n\t\t\t//$descuento=number_format(0,2,'.','');\n\t\t\t$descuento='0.00';\n\t\t\t$charelectronic=$charelectronic.'|'.($descuento);\n\t\t\t//motivo descuento\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t\t// tipo de moneda\n\t\t\t$moneda=$myrow['currcode'];\n\t\t\t// CANTIDAD CON LETRAS\n\t\t\t$totaletras=abs($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\tif (count($separa) == 1) {\n $separa[1] = 0;\n }\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\t$montoctvs1 = $separa[0];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs1=$montoctvs1+1;\n\t\t\t}\n\t\t\t$montoletra=Numbers_Words::toWords($montoctvs1,'es');\n\t\t\t$totaletras=number_format($totaletras,2);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs2=0;\n\t\t\t}\n\t\t\t$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\t\tif ($moneda=='MXN'){\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t\t// tipo moneda\n\t\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t\t// tipo de cambio\n\t\t\t$rate=number_format($myrow['cambio'],4,'.','');\n\t\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t\t// numero de orden para referencia\n\t\t\t$ordenref=$myrow['order_'];\n\t\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t\t// observaciones 1: vendedores\n\t\t\t$vendedor=$myrow['realname'];\n\t\t\t$observaciones1='Vendedor: '.' '.$vendedor;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t\t\n // observaciones 2\n\t\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t\t FROM legalbusinessunit l, tags t\n\t\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t\t\n $Result= DB_query($SQL,$db);\n \n\t\t\tif (DB_num_rows($Result)==1) {\n\t\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t\t$comments=trim($myrowtags['comments']);\n\t\t\t}\n\t\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\n\t\t\t$metodoPago = trim($myrow['codesat']);\n\t\t\n\t\t\tif($metodoPago == \"\") {\n\t\t\t\t$metodoPago = \"99\";\n\t\t\t}\n\n\t\t\t/*\n\t\t\t$metodopago = $myrow['paymentname'];\n\t\t\tif ($metodopago==\"\") {\n\t\t\t\t$metodopago = \"No Identificado\";\n\t\t\t}\n\t\t\t*/\n\n\t\t\t$nocuenta = $myrow['nocuenta'];\n\t\t\tif ($nocuenta==\"\") {\n\t\t\t\t$nocuenta = \"No Identificado\";\n\t\t\t}\n\n\t\t\t// observaciones 3\n\t\t\t$observaciones3='Id Nota :'.$InvoiceNo;//' '.$comments .' usr:'.$UserRegister;\n\t\t\t$TypeInvoice.\"\n\t\t\tAND debtortransmovs.transno=\" . $InvoiceNo . \"\n\t\t\tAND debtortransmovs.tagref=\" . $tag .\n\n\t\t\t$observaciones3 = $observaciones3 . $detallerecibos . \"; \" ;// \"Este comprobante es complementario a los expedidos en la fecha y folios descritos en cada partida detallada arriba\";\n\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones3 . $detallerecibos;\n\n\t\t\t//SE AGREGA NUEVO CAMPO INFORMACION EXTRA\n\t\t\t$charelectronic=$charelectronic . '|' . '';\n\n\t\t\t// datos de la forma de pago\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\t\n\t\t\t$terminospago=\"Pago en una sola exhibicion\";\n\t\t\tif(strlen($myrow['observf'])>0){\n\t\t\t\t$terminospago=$myrow['observf'];\n\t\t\t}\n\n\t\t\t//echo 'terminos:'.$terminospago.' obs:'.$myrow['observf'].'<br><br>';\n\t\t\t// $Tipopago=$Tipopago.' '.$terminospago;\n\t\t\t$Tipopago=$terminospago;\n\t\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t\t// condiciones de pago\n\t\t\t$charelectronic=$charelectronic.'|---';\n\t\t\t// metodo de pago\n\t\t\t//$metodopago='Varios';\n\t\t\t$charelectronic=$charelectronic.'|'.$metodoPago;\n\t\t\t// fecha vencimiento\n\t\t\t$fechavence=$myrow['trandate'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t\t// observaciones 4\n\t\t\t$observaciones4=$nocuenta;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\n\t\t\t//<CFDI:Relacionados> Se solicita subirlo a MG\n\t\t\t$queryCFDI=\"\"; \n\t\t\t$c_TipoRelacion=\"\";\n\t\t\t$pagare_fact=\"\";\n\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\tif($TypeInvoice == 13){\n\t\t\t\t\t$c_TipoRelacion=\"01\";\n\t\t\t\t}\n if($TypeInvoice == 200){\n $c_TipoRelacion=\"08\";\n }\n\n\t\t\t\t$queryCFDI=\"SELECT DISTINCT if (tiporelacion_relacion IS NULL, '\".$c_TipoRelacion.\"',tiporelacion_relacion ) as c_TipoRelacion,debtortrans.uuid,debtortrans.type,debtortrans.id, substring(debtortrans.cadena, 3, 3) as version\n\t\t\t\t\t\t\tFROM notesorders_invoice \n\t\t\t\t\t\t\tLEFT JOIN debtortrans on notesorders_invoice.transid_relacion = debtortrans.id\n\t\t\t\t\t\t\tWHERE notesorders_invoice.transid = '\".$myrow['id'].\"'\";\n\t\t\t\t$resultCFDI=DB_query($queryCFDI,$db);\n\t\t\t\tif($_SESSION['UserID'] == 'desarrollo'){\n echo \"Relacion:\".$queryCFDI;\n }\n\n\t\t\t\tif($TypeInvoice == '200'){\n \t// para sustitucion\n \t/*$sql = \"SELECT '04' as c_TipoRelacion ,UUID AS uuid, id FROM log_cancelacion_sustitucion WHERE id ='\".$myrow['id'].\"'; \";\n\n \t//echo \"<br> SQL Relacion: \".$sql;\n \t$resultadoSus = DB_query($sql,$db);\n \tif(DB_num_rows($resultadoSus)>0){\n \t\t$resultCFDI = $resultadoSus;\n \t}*/\n\n \t$strSQLUUID = \" SELECT '04' as c_TipoRelacion ,UUID AS uuid FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n\t\t $charelectronicdetuuid= '';\n\t\t //echo \"<br>UUID: \".$strSQLUUID;\n\t\t $resultSQLUUID=DB_query($strSQLUUID,$db);\n\t\t if(DB_num_rows($resultSQLUUID)>0){\n\t\t \t$resultCFDI = $resultSQLUUID;\n\t\t /*while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n\t\t $charelectroniuid = '|' . chr(13) . chr(10) . '012';\n\t\t //$charelectronicdetuuid = \"\";\n\t\t // $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n\t\t $charelectronicdetuuid = $charelectronicdetuuid . '|' .$charelectroniuid . '|04|' . $myrowUUID['UUID'];\n\t\t \n\t\t }*/\n\n\t\t }else{\n\t\t $strSQLUUID= \"SELECT log_complemento_sustitucion.folio, log_complemento_sustitucion.type, \n\t\t log_complemento_sustitucion.uuid, log_complemento_sustitucion.transno, '04' as c_TipoRelacion\n\t\t FROM log_complemento_sustitucion \n\t\t INNER JOIN debtortrans ON log_complemento_sustitucion.sustitucion_from = debtortrans.id\n\t\t WHERE debtortrans.transno='\".$InvoiceNo.\"' AND debtortrans.type ='\".$TypeInvoice.\"'\";\n\n\t\t $resultSQLUUID=DB_query($strSQLUUID,$db);\n\t\t if(DB_num_rows($resultSQLUUID) >0){\n\t\t \t$resultCFDI = $resultSQLUUID;\n\t\t /*while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n\t\t $charelectroniuid = '|' . chr(13) . chr(10) . '012';\n\t\t //$charelectronicdetuuid = \"\";\n\t\t // $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n\t\t $charelectronicdetuuid = $charelectronicdetuuid . '|' .$charelectroniuid . '|04|' . $myrowUUID['uuid']; \n\n\n\t\t }*/\n\t\t }\n\n\t\t }\n\n \n }\n\t\t\t\tif($_SESSION['UserID'] == 'desarrollo'){\n //echo \"string1:\".$queryCFDI;\n }\n\t\t\t\twhile ($myrowCFDI = DB_fetch_array($resultCFDI)) {\n\n\t\t\t\t\tif($myrowCFDI['type'] =='70'){\n\t\t\t\t\t\t$pagare_fact.=\"'\".$myrowCFDI['id'] .\"',\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif( $myrowCFDI['c_TipoRelacion'] == '08' AND $myrowCFDI['version'] == '3.3'){\n\t\t\t\t\t\t\t$myrowCFDI['c_TipoRelacion'] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'012';\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['c_TipoRelacion'];\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['uuid'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n if($TypeInvoice == 200){\n $c_TipoRelacionCP=\"08\";\n }else{\n $c_TipoRelacionCP=\"01\"; \n }\n\n\t\t\t\tif($pagare_fact!=\"\"){\n\t\t\t\t\t$pagare_fact=$pagare_fact . \"'-3'\";\n\n\t\t\t\t\t$queryCFDI=\"SELECT '\".$c_TipoRelacionCP.\"' as c_TipoRelacion,debtortrans.uuid , substring(debtortrans.cadena, 3, 3) as version\n\t\t\t\t\t\t\t\tFROM debtortrans \n\t\t\t\t\t\t\t\tINNER JOIN custallocns ON custallocns.transid_allocto = debtortrans.id\n\t\t\t\t\t\t\t\tWHERE custallocns.transid_allocfrom IN (\".$pagare_fact.\")\n\t\t\t\t\t\t\t\tGROUP BY debtortrans.uuid;\";\n if($_SESSION['UserID'] == 'desarrollo'){\n echo \"stringPAgo: \".$queryCFDI;\n }\n $resultCFDI=DB_query($queryCFDI,$db);\n \n\t\t\t\t\t\n\t\t\t\t\twhile ($myrowCFDI = DB_fetch_array($resultCFDI)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $myrowCFDI['c_TipoRelacion'] == '08' AND $myrowCFDI['version'] == '3.3'){\n\t\t\t\t\t\t\t$myrowCFDI['c_TipoRelacion'] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'012';\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['c_TipoRelacion'];\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['uuid'];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//</CFDI:Relacionados>\n\n\t\t\t// datos del cliente\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t\t$branch=$myrow['debtorno'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t\t}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t{\n\t\t\t$calle=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$calle=$myrow['address1'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$colonia=$myrow['address2'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$municipio=$myrow['address3'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$edo=$myrow['address4'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$cp=$myrow['address5'];\n\t\t\t}\n\t\t}\n\t\t{\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\t// datos del custbranch\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t\t$branch=$myrow['branchcode'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t//$rfc=$myrow['rfc'];\n\t\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$nombre=$myrow['name'];\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t\t}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t\t$calle=$myrow['braddress1'];\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=$myrow['braddress6'];\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=$myrow['braddress2'];\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=$myrow['braddress3'];\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=$myrow['braddress4'];\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t}\n\t}\n\t\n\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//colonia\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['custpais'];//pais\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\n\t$SQLInvoice = \"SELECT\n\treplace(debtortransmovs.origtrandate,'-','/') as origtrandate,\n\tSUM(abs(debtortransmovs.ovamount)) AS ovamount,\n\tSUM(abs(debtortransmovs.ovgst)) AS ovgst,\n\tRound(abs(debtortransmovs.ovgst) / abs(debtortransmovs.ovamount), 2) as porcentaje,\n\tdebtortransmovs.currcode,\n\tdebtortransmovs.rate as cambio,\n\tdebtortransmovs.order_,\n\treplace(debtortransmovs.trandate,'-','/') as trandate,\n\tdebtortransmovs.debtorno,\n\tcustbranch.taxid as rfc,\n\tdebtorsmaster.name,\n\tdebtorsmaster.address1,\n\tdebtorsmaster.address2,\n\tdebtorsmaster.address3,\n\tdebtorsmaster.address4,\n\tdebtorsmaster.address5,\n\tdebtortransmovs.branchcode,\n\tcustbranch.braddress1,\n\tcustbranch.braddress2,\n\tcustbranch.braddress3,\n\tcustbranch.braddress4,\n\tcustbranch.braddress5,\n\tcustbranch.braddress6,\n\tcustbranch.brnumint,\n\tcustbranch.brnumext,\n\tcustbranch.specialinstructions,\n\tcustbranch.brpostaddr1,\n\tcustbranch.brpostaddr2,\n\tcustbranch.brpostaddr3,\n\tcustbranch.brpostaddr4,\n\tcustbranch.brpostaddr5,\n\tcustbranch.brpostaddr6,\n\tcustpais as brpostaddr7,\n\twww_users.realname,\n\tdebtortransmovs.transno,\n\tdebtortrans.reference,\n\tcustbranch.phoneno as telofi,\n\tdebtortrans.paymentname,\n\tIFNULL(debtortrans.nocuenta,IFNULL(custbranch.nocuenta,'')) as nocuenta,\n\tdebtortrans.observf,\n\tIFNULL(paymentmethods.codesat,'') as codesat,\n\tdebtortrans.id,\n\tdebtortrans.invtext,\n\tcustbranch.custpais\n\tFROM debtortransmovs\n\tINNER JOIN debtortrans ON debtortrans.type = debtortransmovs.type AND debtortrans.transno = debtortransmovs.transno\n\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t,debtorsmaster,custbranch, www_users\n\tWHERE debtortransmovs.type=$TypeInvoice\n\tAND debtortransmovs.transno=$InvoiceNo\n\tAND debtortransmovs.tagref=$tag\n\tAND debtortransmovs.debtorno=debtorsmaster.debtorno\n\tAND debtortransmovs.debtorno=custbranch.debtorno\n\tAND debtortransmovs.branchcode=custbranch.branchcode\n\tAND www_users.userid = debtortransmovs.userid\n\tGROUP BY Round(abs(debtortransmovs.ovgst) / abs(debtortransmovs.ovamount), 2)\";\n\t// Consulta agrupada por porcentaje de impuestos\n\t$Result=DB_query($SQLInvoice,$db);\n\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\twhile($myrow = DB_fetch_array($Result)) {\n\t\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t\n\t\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\t$stockid='Nota '.$myrow['transno'];\n\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$myrow['transno'];\n\t\t$cantidad = 1;\n\t\t$stockcantidad=number_format($cantidad,4,'.','');\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t$stockdescrip=$myrow['reference'] .' '. $myrow['invtext'];\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip;\n\t\t$stockprecio=number_format(abs($myrow['ovamount']),2,'.','');\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t$stockneto=number_format(abs($myrow['ovamount']),2,'.','');\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t$stockunits= '';\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t$stockcat='NC';\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t$ordencompra='';\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t//DESCUENTO 1\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t\t//DESCUENTO 2\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t\t//DESCUENTO 3\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t\t//SUBTOTAL\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . number_format(abs($myrow['ovamount']),2,'.','');\n\t\t\n\t\t$taxrate = 0;\n\t\t$taxratetotal = 0;\n\t\tif ($imprimepublico==0){\n\t\t\t$impuesto=\"IVA\";\n\n\t\t\t//Agregar Atributos del 3.3\n\t\t\t//*************************\n\t\t\t$c_Impuestos=\"002\";\n\t\t\t$c_TipoFactor=\"Tasa\";\n\t\t\t//*************************\n\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t$totalcred=(abs($myrow['ovgst'])/abs($myrow['ovamount']));\n\n\t\t\t//$totalcred=$totalcred-1;\n\t\t\t$taxrate=number_format($totalcred*100,6,'.','');\n\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t$taxratetotal=number_format(abs($myrow['ovgst']),6,'.','');\n\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal.'|'.$c_Impuestos.'|'.$c_TipoFactor;\n\t\t}\n\n\t\t//ADUANA\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . $taxrate; // 14 - Se agregan datos para impuestos notas de credito\n\t\t//NUMERO DE ADUANA\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . $taxratetotal; // 15 - Se agregan datos para impuestos notas de credito\n\t\t//FECHA DE INGRESO A ADUANA\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . $myrow['porcentaje']; // 16 - porcentaje de impuestos\n\t}\n\n\t// ivas retenidos\n\t//$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\t$charelectronictaxsret = \"\";\n\tif ($charelectronictaxs != \"\"){\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t}else{\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t}\n\n}", "function invoice($param1 = '', $param2 = '', $param3 = '', $param4 = '') {\r\n if ($this->session->userdata('accountant_login') != 1)\r\n redirect(base_url(), 'refresh');\r\n\r\n if ($param1 == 'create') {\r\n \r\n $class_id = $this->input->post('class_id');\r\n $student_id = $this->input->post('student_id');\r\n \r\n $this->db->select('*')->from('invoice')->where('class_id', $class_id);\r\n $this->db->where('student_id', $student_id);\r\n $invoice_data = $this->db->get()->result_array();\r\n \r\n $num_rows = count($invoice_data);\r\n \r\n if($num_rows > 0){\r\n $next_payment_data = array();\r\n foreach ( $_POST as $key => $value )\r\n {\r\n $next_payment_data[$key] = $this->input->post($key);\r\n }\r\n $next_payment_data['creation_date'] = date('Y-m-d', strtotime($this->input->post('creation_date')));\r\n $next_payment_data['creation_timestamp'] = strtotime($this->input->post('creation_date'));\r\n\r\n unset($next_payment_data['class_id_select']);\r\n \r\n $this->db->insert('invoice', $next_payment_data);\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n \r\n }else {\r\n $data = array();\r\n foreach ( $_POST as $key => $value )\r\n {\r\n $data[$key] = $this->input->post($key);\r\n }\r\n $data['creation_date'] = date('Y-m-d', strtotime($this->input->post('creation_date')));\r\n $data['creation_timestamp'] = strtotime($this->input->post('creation_date'));\r\n\r\n unset($data['class_id_select']);\r\n \r\n $this->db->insert('invoice', $data);\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n } \r\n }\r\n if ($param1 == 'do_update') {\r\n $data['student_id'] = $this->input->post('student_id');\r\n $data['class_id'] = $this->input->post('class_id');\r\n $data['title'] = $this->input->post('title');\r\n $data['description'] = $this->input->post('description');\r\n $data['monthly_fees'] = $this->input->post('monthly_fees');\r\n $data['admission_fees'] = $this->input->post('admission_fees');\r\n $data['dev_fees'] = $this->input->post('dev_fees');\r\n $data['session_fee_1st_installment'] = $this->input->post('session_fee_1st_installment');\r\n $data['session_fee_2nd_installment'] = $this->input->post('session_fee_2nd_installment');\r\n $data['sports_fees'] = $this->input->post('sports_fees');\r\n $data['lib_fees'] = $this->input->post('lib_fees');\r\n $data['cultural_program'] = $this->input->post('cultural_program');\r\n $data['invoice_book'] = $this->input->post('invoice_book');\r\n $data['receipt_books'] = $this->input->post('receipt_books');\r\n $data['exam_fee'] = $this->input->post('exam_fee');\r\n $data['registration_fee'] = $this->input->post('registration_fee');\r\n $data['poor_fund'] = $this->input->post('poor_fund');\r\n $data['lab_charge'] = $this->input->post('lab_charge');\r\n $data['electricity_charge'] = $this->input->post('electricity_charge');\r\n $data['total_bill'] = $this->input->post('total_bill');\r\n $data['deposit'] = $this->input->post('deposit');\r\n $data['due'] = $this->input->post('due');\r\n $data['overdue'] = $this->input->post('overdue');\r\n $data['Fine'] = $this->input->post('Fine');\r\n $data['absence_fine'] = $this->input->post('absence_fine');\r\n $data['late_fine'] = $this->input->post('late_fine');\r\n $data['bad_behavior'] = $this->input->post('bad_behavior');\r\n $data['status'] = $this->input->post('status');\r\n $data['creation_timestamp'] = strtotime($this->input->post('date'));\r\n\r\n $this->db->where('invoice_id', $param2);\r\n $this->db->update('invoice', $data);\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n } else if ($param1 == 'edit') {\r\n $page_data['edit_data'] = $this->db->get_where('invoice', array(\r\n 'invoice_id' => $param2\r\n ))->result_array();\r\n }\r\n if ($param1 == 'delete') \r\n\t\t{\r\n\t\t\t\r\n\t\t\t$this->db->delete('invoice',array('invoice_id'=>$param2));\r\n\t\t\t$this->db->delete('invoice_details',array('invoice_id'=>$param2));\r\n redirect(base_url() . 'index.php?admin/invoice', 'refresh');\r\n\t\t return;\r\n }\r\n \r\n if($this->uri->segment(3) == \"loadfee_by_class\") \r\n\t\t{\r\n $class_id = $this->uri->segment(4);\r\n $student_id = $this->uri->segment(5);\r\n \r\n $invoice_data = $this->db->select('*')->from('invoice')->where('class_id', $class_id)->where('student_id', $student_id)->get()->result_array();\r\n $num_rows = count($invoice_data);\r\n \r\n if($num_rows > 0){ \r\n foreach($invoice_data as $prev_invoice_info){ }\r\n \r\n $next_payment_data['total_bill_next'] = $prev_invoice_info['due']; \r\n echo json_encode ($next_payment_data);\r\n die;\r\n \r\n }else { \r\n $this->db->select('*')->from('fees_name')->join('fees_setup', 'fees_setup.fees_name_id = fees_name.fees_name_id');\r\n $fee_data = $this->db->where('fees_setup.class_id', $this->uri->segment(4))->get()->result_array();\r\n\r\n echo json_encode ($fee_data);\r\n die;\r\n }\r\n }\r\n \r\n $page_data['page_name'] = 'invoice';\r\n $page_data['page_title'] = get_phrase('Fees Payment');\r\n $this->db->order_by('invoice_id', 'asc');\r\n $page_data['invoices'] = $this->db->get('invoice')->result_array();\r\n //$page_data['invoices'] = $this->crud_model->get_all_invoice();\r\n $this->load->view('index', $page_data);\r\n }", "public function gopayAction()\n {\n \t$uid = $this->uid;\n $buy_type = $_GET;\n $buy_type = array_keys($buy_type);\n\n //$buy_type\n //[\"callback\\/apipay\",\"btnOrder1\",\"uid\"]\n $buy_type = str_replace('btnOrder', '', $buy_type[1]);\n\n //check buy_type\n $price = 0;\n\n\t\t//加码\n\t\t$nowTime = time();\n\t\t$changeStartTime = strtotime('2012-01-18 00:00:01');\n\t\t$changeEndTime = strtotime('2012-01-26 23:59:59');\n\n\t\tif (($nowTime >= $changeStartTime) && ($nowTime <= $changeEndTime)) {\n\t\t\t$changestatus = 1;\n\t\t} else {\n\t\t\t$changestatus = 2;\n\t\t}\n\n //以分为单位\n\t\tif ($changestatus == 1) {\n\t\t\t$payment = $this->_aryPayDay;\n\t\t} else {\n\t\t\t$payment = $this->_aryPay;\n\t\t}\n\n $gold = 0;\n $itemName = '';\n foreach ($payment as $item) {\n if ($buy_type == $item['id']) {\n $price = $item['price'];\n $gold = $item['gold'];\n $itemName = $item['name'];\n break;\n }\n }\n\n if ($price <= 0 || empty($buy_type) || empty($itemName)) {\n exit;\n }\n\n $rowUser = Hapyfish2_Platform_Bll_User::getUser($uid);\n $orderId = Hapyfish2_Island_Bll_Payment::createPayOrderId($rowUser['puid']);\n $buyer_time = time();\n //call api\n $params = array();\n $params['format'] = 'json';\n $params['item_id'] = $buy_type;\n $params['item_version_id'] = 2;\n $params['total_price'] = $price;\n \t \t/*if ($uid == 10650884) {\n \t$params['total_price'] = 1;\n }*/\n $params['item_name'] = $itemName;\n $params['item_version_name'] = '宝石';\n $params['page_ret_url'] = HOST . '/callback/paydone?';\n $params['proxy_code'] = 'HAPPYFISH';\n $params['outer_order_id'] = $orderId;\n $params['buyer_time'] = $buyer_time;\n $params['description'] = '';\n $params['alipay_id'] = '374052723';//'2088302111803535';\n $rest = Taobao_Rest::getInstance();\n $rest->setUser($puid, $this->info['session_key']);\n $data = $rest->jianghu_getVasIsvUrl($params);\n if (empty($data) || !is_array($data) || !isset($data['vas_isv_url_get_response']['vas_isv_url'])) {\n info_log('101' ,'tb2payfailed');\n \techo '<html><body>request timeout,please try again later.</body></html>';\n exit;\n }\n \t\t$dataUrl = $data['vas_isv_url_get_response']['vas_isv_url'];\n try {\n\t if (isset($dataUrl['aplipay_isv_address'])) {\n\t\t //create pay order\n\t\t $amount = (int)($price/100);\n\t\t $tradeNo = $dataUrl['order_id'];\n\t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n return $this->_redirect($dataUrl['aplipay_isv_address']);\n }\n info_log('102' ,'tb2payfailed');\n\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n \t\techo \"<html><body>$msg</body></html>\";\n\t exit;\n\t\t }\n\t else {\n\t \tif (1 == $dataUrl['status']) {\n \t \t//create pay order\n \t\t $amount = (int)($price/100);\n \t\t $tradeNo = $dataUrl['order_id'];\n \t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n $order = Hapyfish2_Island_Bll_Payment::getOrder($uid, $orderId);\n if ($order['status'] == 1) {\n return $this->_redirect('/pay/payfinish');\n }\n $payRst = Hapyfish2_Island_Bll_Payment::completeOrder($uid, $order);\n if ($payRst == 0) {\n $log = Hapyfish2_Util_Log::getInstance();\n\t\t $log->report('tb2paydone', array($orderId, $amount, $tradeNo, $uid, 1));\n return $this->_redirect('/pay/payfinish');\n }\n else {\n info_log('103' ,'tb2payfailed');\n }\n }\n else {\n info_log('102' ,'tb2payfailed');\n }\n\t\t\t //$msg = $dataUrl['message'];\n\t\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\techo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t \telse {\n\t \t //info_log('104:'.json_encode($dataUrl) ,'tb2payfailed');\n\t \t info_log('104:'.json_encode($data) ,'tb2payfailed');\n\t \t\t$msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\treturn $this->_redirect('http://pay.taobao.com/account/pay_for_account.htm');\n\t \t\t//echo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t }\n } catch (Exception $e) {\n echo '-100';\n exit;\n }\n\n info_log('105' ,'tb2payfailed');\n\t\techo \"<html><body>Please retry.</body></html>\";\n\t\texit;\n }" ]
[ "0.7074798", "0.69716245", "0.6953508", "0.6927367", "0.6864362", "0.686375", "0.6775821", "0.6765582", "0.67508626", "0.66855174", "0.6669066", "0.66640747", "0.6660063", "0.6627125", "0.66026175", "0.6540855", "0.65299714", "0.6528708", "0.65048635", "0.6504281", "0.64864504", "0.6477012", "0.6469424", "0.64494985", "0.64370686", "0.6404805", "0.6403086", "0.63877034", "0.638454", "0.6376265", "0.6372986", "0.63726264", "0.6368096", "0.6366628", "0.63658255", "0.6365333", "0.63569915", "0.63558155", "0.6336288", "0.63356584", "0.6330271", "0.6310089", "0.63056266", "0.63013345", "0.62959385", "0.62914413", "0.62900984", "0.6288185", "0.6280584", "0.62776685", "0.6256094", "0.62471545", "0.6243809", "0.624262", "0.62404984", "0.6239451", "0.6236443", "0.6231709", "0.62277925", "0.6218526", "0.62088436", "0.6208128", "0.6208008", "0.62052447", "0.6202296", "0.62000304", "0.61876154", "0.61870825", "0.6181917", "0.6181438", "0.61776066", "0.6177322", "0.61768824", "0.6172925", "0.61722493", "0.61671627", "0.61661184", "0.6165365", "0.6151084", "0.6142407", "0.6141753", "0.6141375", "0.6138558", "0.6125839", "0.6123362", "0.6118964", "0.6114613", "0.61101073", "0.61062163", "0.60993725", "0.6093669", "0.609251", "0.60874844", "0.6086512", "0.6083408", "0.6078409", "0.6077053", "0.6074402", "0.6067497", "0.6063756", "0.6062358" ]
0.0
-1
Display a listing of the resource.
public function index() { return response()->json(Product::paginate(20), 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('descripcion',$this->descripcion,true); $criteria->compare('tipo',$this->tipo); $criteria->compare('capital',$this->capital); $criteria->compare('created_at',$this->created_at,true); $criteria->compare('updated_at',$this->updated_at,true); return new CActiveDataProvider(get_class($this), array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function findAll()\n {\n return $this->model->all();\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function findBy(array $filters);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getSearch();", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.5979308", "0.5970091", "0.59315383", "0.5928182", "0.59239197", "0.5891605", "0.588925", "0.5849558", "0.58478904", "0.58265656", "0.5818011", "0.5813345", "0.5808009", "0.5790819", "0.57766616", "0.57694167", "0.5765023", "0.57642305", "0.57522315", "0.5740738", "0.5738047", "0.5727545", "0.5724201", "0.5723084", "0.57225823", "0.5721401", "0.5718913", "0.5714439", "0.5712011", "0.5707315", "0.5694636", "0.5680138", "0.56711453", "0.5670484", "0.56703377", "0.56703377", "0.56703377", "0.5669673", "0.56673825", "0.56659126", "0.5656451", "0.5651109", "0.56498116", "0.564325", "0.5635642", "0.5633513", "0.56310356", "0.56235486", "0.56176996", "0.5612909", "0.560956", "0.5595046", "0.5579938", "0.557241", "0.5556209", "0.5550101", "0.55487776", "0.5547998", "0.5547349", "0.5535324", "0.5534813", "0.55342954", "0.55319065", "0.5525128", "0.55199116", "0.5518253", "0.55144674", "0.5509604", "0.55057275", "0.550087", "0.550019", "0.54966915", "0.54966915", "0.54966915", "0.54954666", "0.54937917", "0.5492664", "0.5492298", "0.5490264", "0.5489261", "0.54850507" ]
0.0
-1
Lists all FacturaGastos models.
public function actionIndex() { $this->layout ="main-admin"; Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text'; Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos'; Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos'; Yii::$app->view->params['subTitulo2Administrador'] = ''; Yii::$app->view->params['linkAdministrador'] = ''; $model = FacturaGastos::find()->all(); return $this->render('index', ['model' => $model,]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $gastos = Gasto::all();\n $categorias = Categoria::all();\n return view('gastos.index', compact('gastos', 'categorias'));\n }", "public function index()\n {\n $marcas = Modelo::with(['marca'])->orderBy('descripcion', 'asc')->get();\n return $marcas;\n }", "public function index()\n {\n //\n return Grupos::all();\n }", "public function index()\n {\n $mascotas = Mascota::all();\n return $this->showAll($mascotas);\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppWebBundle:Catalogo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public function index()\n {\n return GrupoResource::collection(Grupo::paginate());\n }", "public function index()\n {\n return Entity::all();\n }", "public function index()\n {\n // return view('cinema::index');\n return $this->model->all();\n }", "public function index()\n {\n //\n return ExamenesClinicos::all();\n }", "public function index()\n {\n return Caminhoneiros::get();\n }", "public function actionAll()\n {\n $model = new Masters();\n\n $comments = $model->getCommentsAll();\n $services = $model->getServices();\n $foto = $model->getFoto();\n $pagination = $model->getPagination(Yii::$app->params['mastersOnPage']);\n $masters = $model->getMastersPagination();\n\n return $this->render('index', [\n 'model' => $model,\n 'masters' => $masters,\n 'comments' => $comments,\n 'services' => $services,\n 'foto' => $foto,\n 'pagination' => $pagination,\n 'mastersOnPage' => Yii::$app->params['mastersOnPage'],\n 'pathToRoot' => Yii::$app->params->pathToRoot\n ]);\n }", "public function index()\n {\n return Contatos::orderBy('id', 'DESC')->get();\n }", "public function index()\n {\n return Procliente::all();\n }", "public static function index()\n {\n return Comida::all();\n }", "public function index()\n {\n return Asistencia::all();\n }", "public function index()\n {\n return OrdenTrabajo::all();\n\n }", "public function index()\n {\n return Filmes::all();\n }", "public function index()\n {\n return Reparticao::all();\n }", "public function showAll()\n {\n $objects = $this->repo->showAll();\n return view('admin.showAll', compact('objects') );\n }", "public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }", "public function index()\n {\n $operacion = Operacion::all();\n return $this->showAll($operacion);\n }", "public function actionIndex()\n {\n $searchModel = new GeSeguimientoGestionBuscar();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return $this->showList(ObjectMuseum::where('deleted','=',ObjectMuseum::ACTIVE)->get());\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n //\n return Paciente::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HffBlogBundle:Comentarios')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return $this->model->all();\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public function index()\n {\n return Producto::all();\n \n }", "public function index()\n {\n return Model::all();\n }", "public function index()\n {\n return $this->tipoServico->with('categorias','categorias.servicos')->orderBy('id','DESC')->get();\n }", "public function index() {\n $this->Marca->recursive = 0;\n return $this->Marca->find('all', array('conditions' => array('publicado' => true)));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('casamunozempresaBundle:Sucursal')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n //retornar todos los registros\n return Directorio::all();\n }", "public function index()\n {\n $object = Model::all();\n return view('cursos.index', compact('object'));\n }", "public function index()\n {\n return $this->repository->all();\n }", "public function index()\n {\n return $this->repository->all();\n }", "public function index()\n {\n return [\n 'categories' => Category::getRepository()->allWithBrands(),\n 'brands' => Brand::getRepository()->findAll(),\n 'types' => Type::getRepository()->findAll()\n ];\n }", "public function index()\n {\n $comissoes = Comissao::paginate(10);\n return $comissoes;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clasificaciontgs = $em->getRepository('UdecAppBundle:Clasificaciontg')->findAll();\n\n return $this->render('clasificaciontg/index.html.twig', array(\n 'clasificaciontgs' => $clasificaciontgs,\n ));\n }", "public function index()\n {\n // Entrega las Comunas, Provincias y Regiones\n\n $comunas= ComunasModel::all();\n\n return $this->showAll($comunas);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('FnxAdminBundle:Categoria')->findAll();\n\n return array('entities' => $entities);\n }", "public function index()\n {\n return TurnoOrdenTrabajo::all();\n\n }", "public function index(){\n return $this->model->all();\n }", "public function index(){\n\n\t\t$model = new CursoModel();\n \n \n\t\t$data['cursos'] = $model->orderBy('id', 'DESC')->findAll();\n\n\t\treturn $this->respond($data);\n }", "public function index()\n {\n $cursos = Curso::paginate(5);\n // $cursos = Curso::all();\n return view('curso.listacurso',compact('cursos'));\n }", "public function index()\n {\n return \\App\\Movie::all();\n }", "public function index()\n {\n return alunos::all();\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('escuelaBundle:finanzasCategoria')->findAll();\n\n return $this->render('escuelaBundle:finanzasCategoria:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MinsalsifdaBundle:SifdaEquipoTrabajo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index() {\n\t\treturn $this->repository->all();\n\t}", "public function index()\n {\n Log::info(\"Produtos listados\");\n $produtos = Produto::paginate(10);\n return ProdutoResource::collection($produtos);\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CpmJovenesBundle:Tema')->findAllQuery();\n \n return $this->paginate($entities);\n \n }", "public function index()\n {\n $contatos = FaleConosco::orderByDesc('created_at')->paginate();\n\n return view('admin.fale-conosco.index', compact('contatos'));\n }", "public function index()\n {\n return venta::all();\n }", "public function listAll()\n\t{\n\t\t$sql = new Conexao;\n\n\t\treturn $sql->select(\"SELECT * FROM tb_criarapuracao\");\n\t}", "public function index()\n {\n return Planodetrabalho::all();\n }", "public function index()\n {\n return $this->operadoras->all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('TroulitePathfinderBundle:ClassDefinition')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $armasMedicos = $em->getRepository('AppBundle:ArmasMedico')->findAll();\n\n return $this->render('armasmedico/index.html.twig', array(\n 'armasMedicos' => $armasMedicos,\n ));\n }", "public function index()\n {\n return TamanhoCollection::collection(Tamanho::all());\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fraturas = $em->getRepository('AppBundle:Fratura')->findAll();\n\n return $this->render('fratura/index.html.twig', array(\n 'fraturas' => $fraturas,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $froFacTransferencias = $em->getRepository('JHWEBFinancieroBundle:FroFacTransferencia')->findAll();\n\n return $this->render('frofactransferencia/index.html.twig', array(\n 'froFacTransferencias' => $froFacTransferencias,\n ));\n }", "public function index()\n {\n $conductores =Conductor::all();\n\n return $this->showAll($conductores);\n }", "public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }", "public function actionIndex()\n {\n $searchModel = new BloqueosSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BaseBundle:Feriado')->findAll();\n\n return $this->render('BaseBundle:Feriado:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tipoanuncios = $em->getRepository('AppBundle:Tipoanuncio')->findAll();\n\n return $this->render('tipoanuncio/index.html.twig', array(\n 'tipoanuncios' => $tipoanuncios,\n ));\n }", "public function index()\n {\n return Conviction::all();\n }", "public function index()\n\t{\n\t\t$marcas = $this->marca->all();\n\t\treturn $marcas;\n\t}", "public function index()\n {\n if (Auth::check())\n {\n $gastos = DB::table('tbl_gastos')\n ->select(\n 'tbl_gastos.id_gasto AS id',\n 'tbl_gastos.fecha AS fecha',\n 'tbl_gastos.descripcion AS descripcion',\n 'tbl_gastos.total AS total',\n 'tbl_gastos.estado AS estado')\n ->get();\n\n return response()->json($gastos);\n }\n }", "public function actionIndex()\n {\n $searchModel = new DetallecarritoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return Repository::all();\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('GaleriasBundle:Galeria')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }", "public function index()\n {\n return Kolekcija::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DgwebBundle:Categoriaport')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n $searchModel = new TblSupervisoresSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination->pageSize = 30;\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $ecoCardiogramaTransesofagicos = $em->getRepository('AppBundle:EcoCardiogramaTransesofagico')->findAll();\n\n return $this->render('ecocardiogramatransesofagico/index.html.twig', array(\n 'ecoCardiogramaTransesofagicos' => $ecoCardiogramaTransesofagicos,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MrsBlogBundle:Cidades')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DGPlusbelleBundle:SesionVentaTratamiento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $datosFactura = FacturacionCurso::All();\n return view('facturacionCursos.index', compact('datosFactura'));\n }", "public function index()\n {\n $tipocambios = TipoCambio::with('monedade','monedaa')->orderBy('fecha_registro','DESC')->where('activo',true)->get();\n return $tipocambios; \n }", "public function index()\n {\n return MonitoreoResource::collection(Monitoreo::all());\n //return MonitoreoResource::collection(Conexione::orderBy('ipe_id', 'asc')->get());\n }", "public function index()\n {\n return view('servicos.list', ['servicos' => Servico::paginate(10),\n 'produtos' => Produto::all(),\n 'clientes' => Cliente::all(),\n ]);\n }", "public function index()\n {\n $cursos = Curso::orderBy('Año', 'DESC')->get();\n return $cursos;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $centros = $em->getRepository('AppBundle:Centro')->findAll();\n\n return $this->render('centro/index.html.twig', array(\n 'centros' => $centros,\n ));\n }", "public function actionIndex()\n {\n $model = new Financeiro();\n $searchModel = new FinanceiroSearch(['tipo' => 1]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $helpers = $this->get(\"app.helpers\");\n $em = $this->getDoctrine()->getManager();\n $casos = $em->getRepository('AppBundle:Caso')->findBy(\n array('estado' => 1)\n );\n $response = array(\n 'status' => 'success',\n 'code' => 200,\n 'msj' => \"listado casos\", \n 'data'=> $casos,\n );\n \n return $helpers->json($response);\n }", "public function index()\n {\n //\n return DetalleProporcionPaciente::all();\n }", "public function indexAction() {\n\t$em = $this->getDoctrine()->getManager();\n\n\t$entities = $em->getRepository('MagypRendicionDeCajaBundle:Comprobante')->findAll();\n\n\treturn array(\n\t 'entities' => $entities,\n\t);\n }", "public function index()\n {\n $facturas=factura::all();\n return view('factura.index',compact('facturas'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $motscles = $em->getRepository('ProjetBundle:Motscles')->findAll();\n\n return $this->render('motscles/index.html.twig', array(\n 'motscles' => $motscles,\n ));\n }", "public function index_all()\n {\n //\n \n \n \n $factureStylimmos = Facture::whereIn('type',['stylimmo','avoir','pack_pub','carte_visite','communication','autre','forfait_entree','cci'])->latest()->get(); \n \n \n \n return view ('facture.index_all',compact('factureStylimmos'));\n }", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();", "public function getAll();" ]
[ "0.65620553", "0.65114594", "0.64883614", "0.63687855", "0.62949693", "0.62845105", "0.62660575", "0.62530845", "0.6251443", "0.624623", "0.62306815", "0.6215271", "0.62066203", "0.6205709", "0.6192928", "0.61851233", "0.61793065", "0.6178854", "0.6175863", "0.6166393", "0.6153624", "0.61515164", "0.6148412", "0.61357003", "0.6127208", "0.6120736", "0.6114063", "0.6112112", "0.61006105", "0.6096984", "0.6094662", "0.6094613", "0.6089428", "0.6085626", "0.6078557", "0.6075669", "0.6059484", "0.6059484", "0.60566854", "0.60548717", "0.60495263", "0.6045714", "0.6042981", "0.603419", "0.60265666", "0.60099626", "0.6003", "0.59978956", "0.5986796", "0.5983941", "0.5972287", "0.59684885", "0.5967943", "0.5967698", "0.59619594", "0.5960783", "0.59559727", "0.59549785", "0.5952718", "0.5952445", "0.5950304", "0.5946455", "0.5939411", "0.59379286", "0.592661", "0.59160084", "0.5910299", "0.5910082", "0.5900596", "0.5897654", "0.58860695", "0.58808863", "0.5861129", "0.58578575", "0.58510804", "0.58484477", "0.58459395", "0.5844438", "0.5836619", "0.58350044", "0.58337337", "0.5833037", "0.5831534", "0.5817524", "0.58125734", "0.5812443", "0.58104664", "0.58077806", "0.5805364", "0.5801308", "0.57978994", "0.57960224", "0.5794195", "0.5793412", "0.5789723", "0.57882607", "0.57882607", "0.57882607", "0.57882607", "0.57882607", "0.57882607" ]
0.0
-1
Displays a single FacturaGastos model.
public function actionView($id) { if (\Yii::$app->user->can('administrador')) { $this->layout ="main-admin"; Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text'; Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos'; Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos'; Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Factura de Gastos'; Yii::$app->view->params['linkAdministrador'] = 'index'; } else if (\Yii::$app->user->can('usuario')){ $this->layout ="main-usuario"; Yii::$app->view->params['iconoAdministrador'] = 'fa fa-home'; Yii::$app->view->params['tituloAdministrador'] = 'Apartamentos'; Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Apartamentos'; Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Apartamento'; Yii::$app->view->params['linkAdministrador'] = 'apartamentos/index'; } $model2 = FacturaGastosItems::find()->where(['factura_gastos_id_factura_gastos' => $id])->all(); return $this->render('view', [ 'model' => $this->findModel($id), 'model2' => $model2 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Factura $factura)\n {\n //\n }", "public function show(factura $factura)\n {\n //\n }", "public function index_fournisseur()\n {\n \n $factureFournisseurs = Facture::where('type','fournisseur')->latest()->get();\n \n // dd($factureFournisseurs);\n \n return view ('facture.index_fournisseur',compact(['factureFournisseurs']));\n\n \n }", "public function index()\n {\n $gastos = Gasto::all();\n $categorias = Categoria::all();\n return view('gastos.index', compact('gastos', 'categorias'));\n }", "public function index() // MUESTRA UNA VISTA SIMPLE DE FACTURACION\n {\n //\n return view('administracion.facturacion');\n }", "public function index()\n {\n $object = Model::all();\n return view('cursos.index', compact('object'));\n }", "public function index()\n {\n $facturas=factura::all();\n return view('factura.index',compact('facturas'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fraturas = $em->getRepository('AppBundle:Fratura')->findAll();\n\n return $this->render('fratura/index.html.twig', array(\n 'fraturas' => $fraturas,\n ));\n }", "public function show(Gasto $gasto)\n {\n return view('gasto.show',compact('gasto'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $froFacTransferencias = $em->getRepository('JHWEBFinancieroBundle:FroFacTransferencia')->findAll();\n\n return $this->render('frofactransferencia/index.html.twig', array(\n 'froFacTransferencias' => $froFacTransferencias,\n ));\n }", "public function show()\n {\n //\n $productos = Productos::get();\n return view ('productos.show') -> with('productos', $productos);\n }", "public function show(Colectivo $colectivo)\n {\n //\n }", "public function show()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'show',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/show', $data);\n }", "public function show(Seguro $seguro)\n {\n //\n }", "public function show($id)\n\t{\t\t\n\t\t$contrato = Contrato::select('contratos.id as id')\n\t\t->join('facturas', 'contratos.id', '=', 'facturas.id_contrato')\n\t\t\t->groupBy('contratos.id')\n\t\t\t->where('facturas.id', '=', $id)\n\t\t\t->get();\n\t\t\n\t\t$factura = Factura::select('num_factura as no','estantes.num_estante as estante','cajas.num_caja as caja','carpetas.num_carpeta as carpeta','empresa_factura as empresa','detalle_factura as detalle','pdf_factura as pdf','valor_factura as valor','facturas.id_contrato as id')\n\t\t\t->join('folios', 'facturas.id', '=', 'folios.id_factura')\n\t\t\t->join('carpetas', 'folios.id_carpeta', '=', 'carpetas.id')\n\t\t\t->join('cajas', 'carpetas.id_caja', '=', 'cajas.id')\n\t\t\t->join('estantes', 'cajas.id_estante', '=', 'estantes.id')\n\t\t\t->where('facturas.id', '=',$id)\n\t\t\t->groupby('facturas.id')\n\t\t\t->take(1)\n\t\t\t->get();\t\t\t\n\t\t\n\t\treturn view('contrato.facturainformacion',compact('factura','contrato'));\n\t}", "public function index()\n {\n $datosFactura = FacturacionCurso::All();\n return view('facturacionCursos.index', compact('datosFactura'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('escuelaBundle:finanzasCategoria')->findAll();\n\n return $this->render('escuelaBundle:finanzasCategoria:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n $facturas= Factura_Ingreso::all();\n return view('factura_ingreso.index',['facturas'=>$facturas]);\n }", "public function index()\n {\n $datos=Gasto::all();\n $suma=Gasto::sum('monto_g');\n return view('gasto.index',compact('datos', 'suma'));\n }", "public function index()\n {\n return view('facturas.index');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $factures = $em->getRepository('BackendBundle:Facture')->findAll();\n\n return $this->render('facture/index.html.twig', array(\n 'factures' => $factures,\n ));\n }", "public function actionIndex()\n {\n $this->layout =\"main-admin\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text';\n Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos';\n Yii::$app->view->params['subTitulo2Administrador'] = '';\n Yii::$app->view->params['linkAdministrador'] = '';\n $model = FacturaGastos::find()->all();\n return $this->render('index', ['model' => $model,]);\n }", "public function show(Cobro $cobro)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $feuils = $em->getRepository('WorldCupRussiaBundle:Feuil')->findAll();\n\n return $this->render('feuil/index.html.twig', array(\n 'feuils' => $feuils,\n ));\n }", "public function show($tipo_producto)\n {\n \n }", "public function show(Curso $curso)\n {\n // Gate::authorize('haveaccess', 'curso.show');\n \n //llama al nivel que esta relacionado con el modelo curso\n \n return \\view('Cursos.showc',['curso'=>$curso,]);\n \n }", "public function show(Produto $produto)\n {\n //\n }", "public function show(Carrinho $carrinho)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BaseBundle:Feriado')->findAll();\n\n return $this->render('BaseBundle:Feriado:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function show(Comentario $comentario)\n {\n //\n }", "public function show(Comentario $comentario)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GestionFraisBundle:Visiteur')->findAll();\n\n return $this->render('GestionFraisBundle:Visiteur:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function show(Modelo $modelo)\n {\n //\n }", "public function show(Modelo $modelo)\n {\n //\n }", "public function index()\n {\n //\n //return view('factura.index',compact('parqueos'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $groupes = $em->getRepository('PlanBundle:Groupe')->findAll();\n\n return $this->render('@Plan/groupe/index.html.twig', array(\n 'groupes' => $groupes,\n ));\n }", "public function actionView($id)\n {\n $dispositivos = PrefacturaDispositivoFijoElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n //$count_fijo = $dispositivos->count();\n // $pag_fijos = new Pagination([\n // 'defaultPageSize'=>10,\n // 'totalCount' => $dispositivos->count()\n // ]);\n // $disp_fijos = $dispositivos\n // ->offset($pag_fijos->offset)\n // ->limit($pag_fijos->limit)\n // ->all();\n\n $modelo=new PrefacturaDispositivoFijoElectronico();\n $variables=PrefacturaDispositivoVariableElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n $monitoreos=PrefacturaMonitoreo::find()->where('id_prefactura_electronica='.$id)->all();\n\n\n if (isset($_POST['fecha_factura'])) {\n $model =PrefacturaElectronica::find()->where('id='.$id)->one();\n $model->setAttribute('numero_factura', $_POST['num_factura']);\n $model->setAttribute('fecha_factura', $_POST['fecha_factura']);\n\n $model->save();\n\n return $this->redirect(['view', 'id' => $id ]);\n }\n\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dispositivos' => $dispositivos/*$disp_fijos*/,\n 'pag_fijos'=>$pag_fijos,\n 'modelo'=>$modelo,\n 'variables'=>$variables,\n 'monitoreos'=>$monitoreos\n ]);\n }", "public function show(FacturaItem $facturaItem)\n {\n //\n }", "public function show($id)\n {\n return view(\"gasto.gastofijo.show\",[\"gasto\"=>Gatofijo::findOrfail($id)]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tipoanuncios = $em->getRepository('AppBundle:Tipoanuncio')->findAll();\n\n return $this->render('tipoanuncio/index.html.twig', array(\n 'tipoanuncios' => $tipoanuncios,\n ));\n }", "public function index()\n {\n $fornecedor= fornecedor::get();\n return view('mostrar/fornecedor', compact('fornecedor'));\n }", "public function index()\n {\n // load a models\n $this->loadModel(\"Nouveaute\");\n $nouveautes = Nouveaute::find_all();\n $nouveaute_id = Nouveaute::find_by_id(1);\n\n // echo $nouveaute_id->image;\n\n // foreach ($nouveautes as $nouveaute) :\n // echo $nouveaute->image;\n // echo $nouveaute->filename;\n // echo $nouveaute->description;\n // endforeach; \n\n // load views\n require APP . 'view/_templates/head.php';\n require APP . 'view/_templates/header.php';\n require APP . 'view/invite/index.php';\n require APP . 'view/_templates/footer.php';\n }", "public function show(Efectivo $efectivo)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fitas = $em->getRepository('MRSBackupBundle:Fita')\n ->findBy(array(),array('unidade' => 'ASC',\n 'barCode' => 'ASC'));\n\n return $this->render('fita/index.html.twig', array(\n 'fitas' => $fitas,\n ));\n }", "public function show(Cargos $cargos)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fichas = $em->getRepository('CardioBundle:Ficha')->findAll();\n\n return $this->render('ficha/index.html.twig', array(\n 'fichas' => $fichas,\n ));\n }", "public function show(Curso $curso){\n\n return view('cursos.show',['id' => $curso]);\n }", "public function show(Fuentes $fuentes)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $groupes = $em->getRepository('AppBundle:Groupe')->findAll(array(), array('nom' => 'ASC'));\n\n return $this->render('@App/groupe/tableau.html.twig', array(\n 'groupes' => $groupes,\n ));\n }", "public function index(Request $request)\n {\n\n $facturas = Factura::name($request->get('name'))->nombre($request->get('proveedor'))->OrderBy('id_factura', 'Desc')->paginate(8);\n\n\n return view('admin.factura.index')->with('facturas', $facturas);\n\n }", "public function index()\n {\n \t$cargos\t\t= $this->Cargo->all();\n \treturn view('site.gestao.index-cargo', compact('cargos'));\n }", "public function index()\n {\n $Proveedores=proveedore::All();\n $Materiales=materiaPrima::All();\n $tipoUsuario =DB::select(\"select tipoUser from categoria_users,users where categoria_users.id=users.idCategoria\n and users.id=\".Auth::user()->id.\"\");\n $numFact =DB::select(\"select max(id) as id from factura_compras\");\n return view('AdminTaller.Facturacion.FacturaCompra',compact('Materiales','Proveedores','tipoUsuario','numFact'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $armasMedicos = $em->getRepository('AppBundle:ArmasMedico')->findAll();\n\n return $this->render('armasmedico/index.html.twig', array(\n 'armasMedicos' => $armasMedicos,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $ecoCardiogramaTransesofagicos = $em->getRepository('AppBundle:EcoCardiogramaTransesofagico')->findAll();\n\n return $this->render('ecocardiogramatransesofagico/index.html.twig', array(\n 'ecoCardiogramaTransesofagicos' => $ecoCardiogramaTransesofagicos,\n ));\n }", "public function actionView($id)\n {\n \t$searchModel = new PostulanteSearch();\n \t$searchModel->id_convocatoria=$id;\n \t$dataProvider = $searchModel->search(null);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n \t\t'searchModel' => $searchModel,\n \t\t'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new DetallecarritoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show($id)\n {\n $curso=Model::find($id);\n return view('cursos.show', compact('curso') );\n }", "public function showFactura($id)\n {\n //\n $usuario = DB::table('users')\n ->select('*')\n ->where('id', Auth::id())\n ->get();\n\n $reserva = DB::table('reservas')\n ->select('*')\n ->where('id_reservas', $id)\n ->get();\n\n $parqueo = DB::table('parqueos')\n ->select('*')\n ->where('id_parqueos', $reserva[0]->id_parqueos)\n ->get();\n\n return view('factura.index',compact('usuario','reserva','parqueo'));\n }", "public function index()\n {\n $astroturfs = $this->astroturfRepository->all();\n return view('admin.astroturf.index', compact('astroturfs'));\n }", "public function index()\n {\n $orcamento = Orcamento::all();\n return view('orcamentos', compact('orcamento'));\n \n }", "public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }", "public function show($consignaciones)\n {\n //\n }", "public function mostrar()\n {\n $marcas = Marca::all();\n // Las devuelve a la vista Marca\n return view('marca', compact('marcas'));\n }", "public function index()\n {\n $title = \"Familias\";\n $familias = Familia::orderBy('orden')->get();\n return view('adm.familia.index',compact('title','familias'));\n }", "public function actionInicio() {\n $searchModel = new FacturaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $cant = Factura::find()->count();\n $texto = ($cant > 0) ? \"Agregar\" : \"Crear\";\n return $this->render('inicio', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'textoBoton' => $texto,]);\n }", "public function index()\n {\n $contatos = FaleConosco::orderByDesc('created_at')->paginate();\n\n return view('admin.fale-conosco.index', compact('contatos'));\n }", "public function index() {\n\n $produto = Produto::all();\n return view('site.produtos', ['produto' => $produto]);\n }", "public function index()\n\t{\n\t\t$ubicaciones = DB::table('ubicacion')->select('ubicacion','ubicacion_pk')->get();\n\t\t$cuentas = DB::table('cuenta')->get();\n\t\t$modelos = DB::table('bien')->get();\n\t\t$clases = DB::table('clase')->get();\n\t\t$marcas = DB::table('marca')->get();\n\t\treturn view('ingreso.ingreso')->with('ubicaciones',$ubicaciones)->with('cuentas',$cuentas)->with('modelos',$modelos)\n\t\t->with('clases',$clases)->with('marcas',$marcas);\n\t\n\t}", "public function index()\n {\n $Refacciones = Refaccion::all();\n\n return view(\"muestraCatalogo\")->with(compact('Refacciones'));\n }", "public function show()\n {\n return view('componentes.motorista.core');\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $actualite = $em->getRepository('MyAppEspritBundle:Actualite')->findAll();\n\n return $this->render('MyAppEspritBundle:Actualite:show.html.twig', array(\n 'actualite' => $actualite,\n ));\n }", "public function index()\n {\n //\n $data = new DocumentoCabecera;\n\n //dd($data);\n\n return view('admin.venta.index')->with(compact('data'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $centros = $em->getRepository('AppBundle:Centro')->findAll();\n\n return $this->render('centro/index.html.twig', array(\n 'centros' => $centros,\n ));\n }", "public function show(Grupo $grupo)\n {\n //\n }", "public function show(Grupo $grupo)\n {\n //\n }", "public function show(Comida $comida)\n {\n //\n }", "public function index()\n {\n //$categoriaCartas=CategoriaCarta::all();\n return view('CartaEscola');\n }", "public function index()\n {\n $facturas = Factura::with(['cliente'])->get();\n return view('ventas.index',\n [\n 'facturas' => $facturas,\n ]);\n }", "public function display(){\n $bien = \\App\\Annonce_bien::orderBy('created_at')->get();\n return view('annonces.index', compact('bien'));\n }", "public function index()\n {\n $obras = Obra::with('fotoObra')\n ->where('status', 1)\n ->get();\n\n return view('admin.galeria.index', compact('obras'));\n }", "public function index() {\n $contratos = Contrato::all();\n return view('admin.contratos.main')->with('contratos', $contratos);\n }", "public function index()\n {\n $produto=$this->objProduto->all();\n return view('produtos', compact('produto'));\n }", "public function actionIndex()\n {\n $listaClaseActive = Grupaelevi::find()->all();\n $dataProvider = new ActiveDataProvider([\n 'query' => Ora::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'listaClaseActive'=>$listaClaseActive,\n ]);\n }", "function ordmarca() {\n $coche=new coches_model();\n\n //Uso metodo del modelo de coches\n $datos=$coche->ordmarca();\n $titulo = \"Listado de Coches ordenado\";\n\n //Cargar vista\n $this->view(\"coches_listado.phtml\",array(\n \"datos\" => $datos,\n \"Listado de Personas\" => $titulo\n ));\n //require_once(\"views/coches_listado.phtml\"); }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $factures = $em->getRepository('DonationBundle:facture')->findAll();\n\n return $this->render('facture/index.html.twig', array(\n 'factures' => $factures,\n ));\n }", "public function show(GradoAcademicoTitulo $gradoAcademicoTitulo)\n {\n //\n }", "public function index()\n\t{\n\t\t// get all the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::all();\n\n\t\t$this->layout->content = View::make('fbf_presenca.index')->with('fbf_presenca', $fbf_presenca);\n\t}", "public function index()\n\t{\n\t\t$this->load->model('subgroepen_model');\n\t\t\n\t\t// Haal de subgroepen op, geordend op categorie\n\t\t$aSubgroepenOpCategorie = $this->subgroepen_model->get();\n\t\t\n\t\t// Laad de pagina\n\t\t\n\t\t$this->pagina->header();\n\t\t$this->load->view('verbanden',array('aSubgroepenOpCategorie'=>$aSubgroepenOpCategorie));\n\t\t$this->pagina->footer();\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AlmaBundle:TipoCamera')->findAll();\n\n return $this->render('AlmaBundle:TipoCamera:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n $fotos = DB::table('imagenes')->join('propiedades','propiedades.codigo','=','imagenes.codigo')->get();\n $mispropiedades = DB::table('propiedades')->select('propiedades.id','propiedades.codigo','propiedades.titulo_propiedad','comunas.nombre as comuna','regiones.nombre as region','propiedades.nro_banos','propiedades.nro_habitaciones','propiedades.nro_estacionamientos','propiedades.valor_uf')\n ->leftJoin('comunas','propiedades.comunas_id','=','comunas.id')\n ->leftJoin('regiones','comunas.region_id','=','regiones.id')\n ->where('estado_publicacion','=','aceptada')\n ->get();\n\n return view('catalogo.catalogo', compact('mispropiedades', 'fotos'));\n }", "public function show(Grupos $grupos)\n {\n //\n }", "public function show(Grupos $grupos)\n {\n //\n }", "public function show(CrudEvolution $crudevolution)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clasificaciontgs = $em->getRepository('UdecAppBundle:Clasificaciontg')->findAll();\n\n return $this->render('clasificaciontg/index.html.twig', array(\n 'clasificaciontgs' => $clasificaciontgs,\n ));\n }", "public function index()\n {\n //$this->view->carregarEquipe = $this->loadPainelgroups()[0]->nmGrup;\n //$this->view->pontos = $this->loadPainelgroups();\n //$this->view->painelFilaAdd = $this->global->proceduremodel(\" SELECT DISTINCT fkpergunta FROM `004_fila`\");\n return $this->renderView('/controlador/index', 'layout');\n }", "public function index()\n {\n $fournitures = Fourniture::with('classe')->get();\n if(!Auth::user()->hasRole('parent')){\n return view('fournitures.indextab', compact('fournitures'));\n }\n return view('fournitures.index', compact('fournitures'));\n }", "public function index()\n {\n $modelStaff = new TfStaff();\n $modelCountry = new TfCountry();\n $dataCountry = TfCountry::where('action', 1)->orderBy('name', 'ASC')->select('*')->paginate(30);\n return view('manage.content.system.country.list', compact('modelStaff', 'modelCountry','dataCountry'),\n [\n 'accessObject' => 'content'\n ]);\n }", "public function index(){\n\t\tif(Session::get(\"autenticado\")){\n\t\t\t\n\t\t\tSession::accesoEstricto([\"1\"]);\n\n\t\t\t$model = new Carrera();\n\n\n\t\t\t$this->_view->titulo = \"Listado de Carreras\";\n\n\t\t\t$this->_view->render(\"index\", 'carrera',[\n\t\t\t\t\"model\"=>$model\n\t\t\t]);\n\t\t}else{\n\n\t\t\t$this->redirect(\"site/index\");\n\t\t}\n\t}", "public function index()\n {\n //$productos = Producto::with('categoria')->get('id');\n $productos = Producto::all();\n return view('Producto.index', compact('productos'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $cargaisons = $em->getRepository('AppBundle:Cargaison')->findAll();\n\n return $this->render('cargaison/index.html.twig', array(\n 'cargaisons' => $cargaisons,\n ));\n }", "public function show(Conferencia $conferencia)\n {\n //\n }" ]
[ "0.7155239", "0.6946366", "0.66761625", "0.6670682", "0.6613277", "0.6588718", "0.6531369", "0.6515076", "0.6495129", "0.6482706", "0.64645356", "0.64480144", "0.6437653", "0.63932997", "0.63667", "0.63610435", "0.6359344", "0.63481677", "0.6343388", "0.6319327", "0.62957495", "0.6288807", "0.62802905", "0.62730366", "0.62715393", "0.6270299", "0.62648", "0.62597334", "0.62568104", "0.6251906", "0.6251906", "0.6239177", "0.623472", "0.623472", "0.62327546", "0.623101", "0.6226806", "0.621216", "0.6204956", "0.62033355", "0.6200139", "0.6198483", "0.619669", "0.6194216", "0.6193446", "0.61919314", "0.6184414", "0.6182827", "0.61817056", "0.6179811", "0.6171777", "0.61704123", "0.61514115", "0.614991", "0.61471736", "0.6139917", "0.61375487", "0.613624", "0.61342025", "0.6129832", "0.61285055", "0.6127008", "0.61220956", "0.6121931", "0.61164325", "0.61144984", "0.6112835", "0.60984516", "0.6095116", "0.60929316", "0.60891753", "0.6084732", "0.6076418", "0.6073436", "0.6073436", "0.607298", "0.6071612", "0.6068081", "0.60676306", "0.6065933", "0.6065174", "0.60626006", "0.60507494", "0.60488623", "0.6048524", "0.6045976", "0.60447645", "0.6044015", "0.60438013", "0.60433525", "0.6042303", "0.6042303", "0.6041245", "0.60405576", "0.6038142", "0.6037801", "0.60358673", "0.60349524", "0.60348916", "0.60340536", "0.60337305" ]
0.0
-1
Creates a new FacturaGastos model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $this->layout ="main-admin"; Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text'; Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos'; Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos'; Yii::$app->view->params['subTitulo2Administrador'] = 'Nueva Factura de Gastos'; Yii::$app->view->params['linkAdministrador'] = 'index'; $model = new FacturaGastos; $modelItems = [new FacturaGastosItems]; if ($model->load(Yii::$app->request->post())) { $modelItems = Model::createMultiple(FacturaGastosItems::classname()); Model::loadMultiple($modelItems, Yii::$app->request->post()); // validate all models $valid = $model->validate(); $valid = Model::validateMultiple($modelItems) && $valid; if ($valid) { $model->estado = 1; $transaction = \Yii::$app->db->beginTransaction(); try { if ($flag = $model->save(false)) { foreach ($modelItems as $modelItem) { $modelItem->factura_gastos_id_factura_gastos = $model->id_factura_gastos; if (! ($flag = $modelItem->save(false))) { $transaction->rollBack(); break; } } } if ($flag) { $transaction->commit(); return $this->redirect(['view', 'id' => $model->id_factura_gastos]); } } catch (Exception $e) { $transaction->rollBack(); } } } return $this->render('create', [ 'model' => $model, 'modelItems' => (empty($modelItems)) ? [new Items] : $modelItems ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate() {\n $model = new NubeFactura;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['NubeFactura'])) {\n $model->attributes = $_POST['NubeFactura'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->IdFactura));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCrear() {\n $model = new Factura();\n $atributos_viejos = $model->attributes;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n StaticMembers::RegistrarTraza($model, $atributos_viejos, 'crear', $model->numero);\n Yii::$app->session->setFlash('success', 'Elemento creado correctamente', false);\n return $this->redirect(['inicio', 'id' => $model->id, 'id_devolucion' => $model->id_devolucion]);\n } else {\n return $this->render('crear', ['model' => $model,]);\n }\n }", "public function actionCreate()\n {\n if(\\Yii::$app->user->can('gerenciamento-cadastros-basicos')){\n $model = new Pessoa();\n $alerta = \"Pessoa já cadastrada\";\n \n \n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $validacpf = Pessoa::find()->where(['cpf' => $model->cpf])->one();\n if($validacpf == true){\n return $this->redirect(['create',\n 'model' => $model, 'alerta' => $alerta\n ]);\n }else{\n\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n }else{\n return $this->render('create', [\n 'model' => $model, \n ]);\n }\n }else {\n throw new \\yii\\web\\ForbiddenHttpException('Você não está autorizado a realizar essa ação.');\n }\n \n }", "public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n \n \n $familia = Familia_Olfativa::all();\n \n return \\view('Esencia_Perfume.create', \\compact('familia'));\n \n\n }", "public function actionCreate()\n {\n $model = new Comercios();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new ConfFa;\n $condicion = new CodicionPago;\n $bodega = new Bodega;\n $categoria = new Categoria;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ConfFa']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ConfFa'];\n if($_POST['ConfFa']['NIVEL_PRECIO'] == '')\n $model->NIVEL_PRECIO = NULL; \n \n if($model->save())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'condicion'=>$condicion,\n 'categoria'=>$categoria,\n 'bodega'=>$bodega,\n\t\t));\n\t}", "public function create()\n\t{\n $sociosCombo = $this->sociosRepo->getComboNroLegajo();\n $action = \"Crear\";\n $form_data = array('route' => array('prestamos.store'), 'method' => 'POST', 'id' => 'prestamoForm');\n\t\treturn View::make(\"prestamos.create\",compact(\"sociosCombo\",\"action\",\"form_data\"));\n\t}", "public function actionCreate()\n {\n $model = new Actividad();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(CreateFacturasRequest $request)\n {\n $input = $request->all(); \n $input ['id_nomi']=Auth::user()->id_nomi;\n $input ['fecha']=date('Y-m-d');\n $facturas = $this->facturasRepository->create($input);\n\n $Detalle = new FacturasDetalles;\n\n $Detalle ->id_fac=$facturas->id_fac; \n $Detalle ->id_prod=$input['descripcion'];\n $Detalle ->cantidad=$input['cantidad'];\n $Detalle ->descripcion=$input['descripcion'] ;\n $Detalle ->precio_unitario=$input['precio_unitario'] ;\n $Detalle ->destino=$input['destino'] ;\n\n $Detalle->save();\n\n\n Flash::success('Facturas saved successfully.');\n\n return redirect(route('facturas.edit',$facturas->id_fac));\n }", "public function create()\n {\n $categorias = Categoria::all();\n return view('gastos.create', compact('categorias'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new ARTICULOS;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ARTICULOS']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ARTICULOS'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n $request = \\Config\\Services::request(); \n $nombre = $request->getPostGet('nombre'); \n $datos = array(\n 'NombreCa' => $nombre\n ); \n $model = new CategoriasModel();\n $model->insert($datos); \n return redirect()->to(base_url('/categorias'));//Se vuelve a cargar el controlador\n }", "public function actionCreate()\n {\n $model = new ProvCompras();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $this->layout=\"main\";\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Convocatoria();\n $usuario = Yii::$app->user->identity;\n $id_usuario = $usuario->id_registro;\n // Filtra en base a las dependencias que abarca el gestor\n $colCarreras = Carrera::find()\n ->all();\n $carreras = ArrayHelper::map($colCarreras, \n 'id_carrera', \n 'nombre'); \n\n $query = CarreraDestinada::find()->joinWith('carrera');\n \n $dataProviderCarrerasDest = new ActiveDataProvider([\n 'query' => $query,]); \n\n if ($model->load(Yii::$app->request->post())) {\n \t$model->fecha_alta=date(\"d/m/Y\");\n $model->activo = true;\n \n \tif($model->save()){\n \t\treturn $this->redirect(['update', 'id' => $model->id_convocatoria]);\n \t\t} \n \t \n }\n \n return $this->render('create', [\n 'model' => $model,\n 'carreras' => $carreras,\n 'dataProviderCarrerasDest' => $dataProviderCarrerasDest\n ]);\n }", "public function actionCreate()\n {\n $model = new Ocorrencia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\r\n\t{\r\n\t\t//\r\n\r\n $form_data = array('route' => 'comercios.store', 'method' => 'POST');\r\n $action = 'Nuevo';\r\n\r\n return View::make(\"comercios.create\",compact(\"form_data\",\"action\"));\r\n\r\n\r\n\t}", "public function create()\n {\n return view('campamentos.fpagos.create');\n }", "public function create()\r\n {\r\n return view('backEnd.cotizaciones.create');\r\n }", "public function create()\n {\n return view(\"ubicaciones.create\");\n }", "public function create()\n {\n return view('admin.activosFijos.create');\n }", "public function create()\n {\n return view('gasto.create',[\n 'gasto' => new Gasto\n ]);\n }", "public function create()\n {\n //\n $gao = Guanggao::all();\n return view('admin.guanggao.create', ['gao'=>$gao] );\n \n }", "public function createAction() {\n $model = new Application_Model_Compromisso();\n //persisto os dados no banco\n $model->insert($this->_getAllParams());\n //redireciono para o index\n $this->_redirect('compromisso/index');\n }", "public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $data = DB::table('proveedors')->orderBy('nombre', 'asc')->lists('nombre','id');\n $insumo = DB::table('insumos')->orderBy('nombre', 'asc')->lists('nombre', 'id');\n\n return view('admin.factura.create', compact('data', 'insumo'));\n }", "public function create()\n {\n return view('registros.factura');\n }", "public function create()\n {\n $Clientes = DB::select(\"SELECT * FROM `personas`,clientes WHERE personas.cedula=clientes.cedula\");\n $FacturasVentas = facturaVenta::All();\n $DetallesServicios = \\App\\detalleServicio::All();\n $DetallesFacturasProducto = \\App\\detalle_facturas_productos::All();\n $Productos=producto::All();\n $numFact =DB::select(\"select max(id) as id from factura_compras\");\n $tipoUsuario =DB::select(\"select tipoUser from categoria_users,users where categoria_users.id=users.idCategoria\n and users.id=\".Auth::user()->id.\"\");\n return view('AdminTaller.Facturacion.FacturaVenta',compact('FacturasVentas','DetallesServicios','numFact','DetallesFacturasProductos','tipoUsuario','Clientes','Productos'));\n }", "public function store(CreateGastoRequest $request)\n { \n Gasto::create($request->validated()); \n $datos=Gasto::all();\n $suma=Gasto::sum('monto_g');\n return view('gasto.index',compact('datos', 'suma'));\n }", "public function create()\n {\n //funcion para mostrar vista crear\n return view(\"productos.create\");\n }", "public function actionCreate() {\n\t\t$model = new Proyecto;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this -> performAjaxValidation($model);\n\n\t\tif (isset($_POST['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\t$model -> Usuario_id = Yii::app() -> user -> id;\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('create', array('model' => $model, ));\n\t}", "public function actionCreate()\n\t{\n\n\t\t\t$catPuesto = new CatPuesto();\n\n // Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($catPuesto);\n\n\t\tif(isset($_POST['CatPuesto']))\n\t\t{\n\t\t\t$catPuesto->attributes=$_POST['CatPuesto'];\n\n\n $catPuesto->fecha_creacion = date('Y-m-d h:i:s');\n $catPuesto->persona_creacion = Yii::app()->user->id;\n $catPuesto->fecha_modificacion = date('Y-m-d h:i:s');\n $catPuesto->persona_modificacion = Yii::app()->user->id;\n $catPuesto->activo = 1;\n\n\n if($catPuesto->save())\n\t\t\t\t$this->redirect(array('index','id_cat_puesto'=>$catPuesto->id_cat_puesto));\n \t\t}\n\n\t\t$this->render('create',array(\n'catPuesto'=>$catPuesto,\n\t\t));\n\t}", "public function create()\n\t{\n\t// carga los registros almacenados en la base de datos para las correspondientes tablas a las\n\t\t// que hacen referencia los modelos\n\t\t$estantes = Estante::lists('num_estante','id');\n\t\t\n\t\t$ultimo_contrato = \\GID\\Contrato::select('id')->orderby('created_at','DESC')->take(1)->get();\n\t\t\t$id_contrato = $ultimo_contrato[0]->id;\n\t\t// llamado de las vistas del acta inicial\n\t\t//la funcion de la presente acta es agregar los detalles conjunto con el pdf\n\t\t// renderiza la vista y le envia los registros \n\t\treturn view('contrato.factura',compact('estantes','id_contrato'));\n\t}", "public function actionCreate() {\n $model = new Aviso;\n if (isset($_POST['Aviso'])) {\n $model->attributes = $_POST['Aviso'];\n #$nombre = $model->titulo;\n $fecha = Aviso::model()->getFechaRegistro();\n $model->fecha_publicacion = $fecha->readColumn(0);\n $adjuntos = $_FILES;\n $temp=$adjuntos['adjunto']['tmp_name'];\n if ($model->save()) {\n if (count($adjuntos['adjunto']['name']) > 0) { \n $this->guardarAdjuntos($adjuntos['adjunto']['name'], $model,$temp);\n }\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n //\n return view('visitas_fisicas.create');\n }", "public function create()\n {\n return view('catalogos.create');\n }", "public function actionCreate() {\n $model = new GestionStock;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionStock'])) {\n $model->attributes = $_POST['GestionStock'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new Produto();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n \n $model->file = UploadedFile::getInstance($model, 'file');\n\n\n if ($model->file == null) {\n } else {\n $model->atribuirImagem();\n }\n\n $model->save();\n\n Yii::$app->getSession()->setFlash('success', 'Produto criado com sucesso');\n return $this->redirect(['view', 'id' => $model->IDproduto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n return view(\"productos.create\");\n }", "public function create()\n {\n\n return view('backend.glasse.create');\n }", "public function create()\n {\n return view(\"produto.create\");\n }", "public function create()\n {\n $productos = Producto::where('cantidad', '>', 0)->get();\n $divisas = Divisa::all();\n \n return view('facturas.create', [\n 'productos' => $productos,\n 'divisas' => $divisas\n ]);\n }", "public function create()\n {\n \n $perfumista = Perfumista::all();\n $esencia = Esencia_Perfume::all();\n $familia = Familia_Olfativa::all();\n $productor = Productor::all();\n $ingrediente = Otros_Ingredientes::all();\n \n return \\view('Perfumes.create', \\compact('perfumista','productor','esencia','ingrediente','familia'));\n \n\n }", "public function create()\n {\n return view('societes.create');\n }", "public function actionCreate()\n {\n $model = new Categoria();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $btn_name = 'Registrar';\n $action = route('grupo_academico.store');\n $grupo_academico = new Grupo_academico();\n $grupo_academicos = Grupo_academico::all();\n $anios = Anio_academico::all();\n $grados = Grado::all();\n $seccions = Seccion::all();\n return view('grupo_academico.crear')->with(compact('action', 'grupo_academico', 'grupo_academicos', 'btn_name', 'anios', 'grados', 'seccions'));\n }", "public function create()\n { \n \n $empresas = Empresas::pluck(\"razon_social\",\"id_empr\");\n $clientes = ProveedoresClientes::pluck(\"razon_social\",\"id_procli\");\n $auxfac = DB::select(\"SELECT * FROM factura ORDER BY numfac DESC LIMIT 1\");\n $producto = Productos::pluck(\"nombre_descripcion\",\"id_prod\");\n\n if(empty($auxfac)){\n //$numfac = '001-001-000000001';\n $numfac=1;\n }else{\n $numfac=($auxfac[0]->numfac)+1;\n }\n\n return view('facturas.create')\n ->with('empresas',$empresas)\n ->with('clientes',$clientes) \n ->with('numfac',$numfac)\n ->with('producto',$producto)\n ;\n }", "public function actionCreate()\n {\n if (Yii::$app->user->isGuest) {\n return $this->redirect([\"site/login\"]); \n }\n if(Permiso::requerirRol('lider')){\n $this->layout='/main2';\n }elseif(Permiso::requerirRol('vendedor')){\n $this->layout='/main3';\n }\n $model = new Producto();\n\n \n if ($model->load(Yii::$app->request->post())){ \n \n $model->imagenproducto = UploadedFile::getInstance($model, 'imagen');\n if(isset($model->imagenproducto)){\n $imagen_nombre=rand(0,4000).'image_'.$model->idproveedor.'.'.$model->imagenproducto->extension;\n $imagen_dir='archivo/catalogo/'.$imagen_nombre;\n //print '<pre>';print_r ($model);print $imagen_nombre;print '</pre>';exit;\n $model->imagenproducto->saveAs($imagen_dir);\n $model->imagenproducto=$imagen_dir;\n }\n if($model->save(false)) {\n return $this->redirect(['view', 'id' => $model->idproducto]);\n }\n \n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Peticiones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Concursante();\n $model->load(Yii::$app->request->post());\n if ($model->findOne(['cedula' => $model->cedula]))\n {\n Yii::$app->session['msj'] = ['alert alert-danger', 'Su número de cédula ya está en nuestra base de datos. Gracias nuevamente por haberse registrado.'];\n } else if ($model->save())\n {\n Yii::$app->session['msj'] = ['alert alert-success', '¡Gracias por registrarse!'];\n }\n\n return $this->redirect(['/']);\n }", "public\n function actionCreate()\n {\n $model = new Phforum();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n\n $data =[\n\n 'title'=>$description='Ajouter un programme d\\'activité',\n 'description'=>$description,\n //'gpuser'=>$gpuser,\n //'departement'=>$departement,\n \n \n ];\n return view('groupes.create',$data);\n\n }", "public function create()\n {\n $generos = Genero::get();\n $familias = Familia::all();\n return view('genero.create', compact('generos','familias'));\n }", "public function create()\n {\n $categoria=['limpeza', 'alimento', 'frio', 'bebida'];\n return view('createProduto',compact('categoria'));\n }", "public function create(){\n $carros = CarroGolf::orderBy('tipo')->lists('tipo', 'id')->all();\n return view('carros.reserva.crear-reserva', compact('carros'));\n }", "public function actionCreate()\n {\n $model = new Cuenta();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Trivia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n $acceso_usuario = new SysAccesoUsuarioModel();\n if($acceso_usuario->getAccesoValido(6, Auth::user()->fkid_perfil)){\n $art_tiposarticulos = new ArtTipoArticuloModel();\n $tiposarticulos = $art_tiposarticulos->getTiposArticulos();\n $aprobaciones = ArtAprobacionModel::all();\n return view('tiposarticulos.create', compact('tiposarticulos', 'aprobaciones')); \n }\n else{\n return redirect('home');\n }\n }", "public function create()\n {\n return view('ubicaciones.create');\n }", "public function create()\n {\n $classes = Classe::get();\n $fournitures = Fourniture::with('classe')->get();\n return view('fournitures.create', compact('classes', 'fournitures'));\n }", "public function create()\n {\n //\n return view('cursos.create');\n }", "public function create()\n {\n $categorias=Categorias::all();\n\n return view('productos.create',compact('categorias')); \n }", "public function create()\n {\n // check for admin rights\n if(auth()->user()->id !== 1){\n // error message\n Session::flash('error', 'Onbevoegde toegang');\n return redirect('/home');\n }\n return view('occasions.create');\n }", "public function create()\n {\n $fabricantes = array();\n $pais = Pais::get();\n $gama = array();\n $modalidad = array();\n $catalogos = array();\n $fab_contactos = array();\n $fabricantes = array('pais'=>'',\n 'modalidad'=>'',\n 'activo'=>0,\n 'id_fabricante'=>0);\n\n $fabricantes = (object)$fabricantes;\n\n return view('fabricantes.create',compact('fabricantes','pais','gama','modalidad','catalogos','fab_contactos'));\n }", "public function create()\n\t{\n return view('productos.create');\n\t}", "public function create()\n {\n //\n return view('productos.create');\n }", "public function create()\n {\n //\n $classe = Classe::all();\n return view('/Hotels/create')->with(compact('classe'));\n\n }", "public function create($id_caso)\n{\n\t$id_caso = urldecode($id_caso);\n\n\n\t$datos['casos'] = $this->Casos->detalles($id_caso);\n\n\tif ($datos['casos'] == NULL || $datos['casos'] == '') \n\t{\n\t\tredirect('Inicio');\n\t}\n\n\t//Validar \n\t$datos['involucrados'] = $this->Involucrados->detallesCasos($id_caso);\n\tif (empty($datos['involucrados'])) \n\t{\n\t\t$this->session->set_flashdata('Alert','El caso no tiene involucrados para dar un fallo, debe de tener denunciante y contraventor.');\n\t\tredirect('Personas');\n\t}\n\n\t$datos['fallos'] = $this->Fallos->detalles($id_caso);\n\tif (empty($datos['fallos'])) \n\t{\n\t\t$contador_casos = 0;\n\t}\n\telse\n\t{\n\t\t$contador_casos = 1;\n\t}\n\n\tif ($datos['casos']->estado != 'ACTIVO') {\n\t\tredirect('Inicio');\n\t}\n\n\t$data = array(\n\t\t'id_caso' => $id_caso,\n\t\t'title' => 'Crear Fallo',\n\t\t'auth'=> $this->sesion,\n\t\t'alertas'=> $this->sesion,\n\t\t'old'=> $this->sesion,\n\t\t'contador_casos' => $contador_casos\n\t);\n\n\t// LLamado de la vista blade:\n\t$this->blade->view('pages/fallos/create', $data);\n}", "public function actionCreate()\n {\n if(\\Yii::$app->user->can('criarMarcacaoConsulta')) {\n $model = new MarcacaoConsulta();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->criarMarcacaoConsultaBack();\n return $this->redirect(['index', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n $model = new InfraestructuraEducativa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n return $this->render('create', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }", "public function actionCreate()\n {\n $model = new ClinicServices();\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->save()) {\n\n $model->upload();\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('cadastros.create');\n }", "public function create()\n {\n return view('comentario.create');\n }", "public function create()\n {\n $modelo = Modelo::find(Input::get('id_modelo'));\n\n // Si tiene una accion diferente para el envío del formulario\n $url_action = 'web';\n if ($modelo->url_form_create != '') {\n $url_action = $modelo->url_form_create.'?id='.Input::get('id').'&id_modelo='.Input::get('id_modelo');\n }\n\n $miga_pan = $this->get_miga_pan($modelo,'Crear nuevo');\n\n return view( 'pagina_web.secciones.create', compact('url_action', 'miga_pan') );\n }", "public function create()\n {\n //\n return view('fornecedores.create');\n\n }", "public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}", "public function create()\n {\n $categorias = Categoria::all('id','nombre');\n return view('Producto.create',compact('categorias'));\n }", "public function create()\n {\n return view('gas_consumo.create');\n }", "public function create()\n {\n $action = route('contrato.store');\n $contrato = new Contrato();\n return view('contrato.create')->with(compact('action','contrato'));\n }", "public function actionCreate()\r\n {\r\n $model = new Apresentacao();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function create()\n {\n return view(\"createProduto\");\n }", "public function create() {\n //mostramos el formulario para crear el producto\n $datos = array(\n \"categorias\" => \\App\\Categoria::all()\n );\n return view(\"admin.producto.create\", $datos);\n }", "public function create()\n {\n return view('gandolas.create',[\n\n 'gandolas'=> new gandola\n\n ]);\n }", "public function actionCreate()\n {\n $model = new Devolucion_salas_granel();\n $model->scenario = \"create_sobrante\";\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->validate() ){ \n $model->DE_SOBRAN = 1;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n //Se guarda encabezado Devolucion\n if ($model->save()){\n $this->guardar_renglones($model);\n }\n\n $this->generarPdf($model->DE_NRODEVOL);\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n \n }\n else{\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n \n } else {\n $model->DE_FECHA = date('Y-m-d');\n $model->DE_HORA = date('H:i:s');\n $model->DE_CODOPE = Yii::$app->user->identity->LE_NUMLEGA; //El usuario logueado\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $tipos = Tipo::all();\n $grupos = Grupo::all();\n $empresas = Empresa::all();\n\n return view('contatos.create', compact('tipos', 'grupos', 'empresas'));\n }", "public function create()\n { \n $estados = Estado::all();\n return view('Admin.category.create', compact('estados'));\n }", "public function create()\r\n {\r\n return view('backEnd.productos.create');\r\n }", "public function create()\n {\n\n return view('productos.create');\n\n \n }", "public function create()\n {\n //\n return view('asignatura.create');\n }", "public function create()\n {\n $categorias = Categoria::get();\n $marcas = Marca::get();\n $medidas = Medida::get();\n return view('productos.create',compact('categorias','marcas','medidas'));\n }", "public function create()\n {\n $categoria=Categoria::all();\n $marca=Marca::all();\n return view('website.backend.articulo.create',compact('categoria','marca'));\n }", "public function create()\n {\n //return view('estados.create');\n }", "public function actionCreate()\n {\n $model = new Talleres();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n // $this->load->view('index', $variaveis);\n \n $variaveis['titulo'] = 'Cadastro Usuários';\n\t\t$this->load->view('usuarios_cad', $variaveis);\n\t}", "public function actionCreate()\n {\n $this->enableCsrfValidation = false;\n $model = new FoodForm();\n //定义场景\n $model->setScenario(FoodForm::SCENARIOS_CREATE);\n if ($model->load(Yii::$app->request->post()) && $model->validate()) \n {\n if(!$model->create())\n\t\t\t{\n\t\t\t\tYii::$app->session->setFlash('warning', $model->_lastError);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $this->redirect(['food/view', 'id' => $model->id]);\n\t\t\t}\n }\n return $this->render('create', ['model' => $model]);\n }", "public function actionCreate()\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest) {\n\t\t\t\t$modelTopografi = new Topografi;\n\n\t\t\t\tif ($_POST) {\n\t\t\t\t\t$modelTopografi['datar']=$_POST['datar'];\n\t\t\t\t\t$modelTopografi['bergelombang']=$_POST['bergelombang'];\n\t\t\t\t\t$modelTopografi['curam']=$_POST['curam'];\n\t\t\t\t\t$modelTopografi['sgtcuram']=$_POST['sgtcuram'];\n\t\t\t\t\t$modelTopografi['tinggidpl']=$_POST['tinggidpl'];\n\t\t\t\t\t$modelTopografi->save();\n\t\t\t\t}\n\n\t\t\t\t$this->render('create');\n\t\t\t}\n\t\t}", "public function create()\n {\n $pessoas = Pessoa::all();\n $produtos = Produto::all();\n\n return view('novoleilao', compact('pessoas','produtos'));\n }" ]
[ "0.7604331", "0.75953764", "0.7133026", "0.6930636", "0.69163907", "0.69116074", "0.68748254", "0.68523735", "0.6807873", "0.6806843", "0.68055856", "0.6798586", "0.67981774", "0.67766273", "0.6754571", "0.67521226", "0.6749555", "0.67433655", "0.6735298", "0.6727496", "0.67132944", "0.67075795", "0.67034847", "0.6694345", "0.6687738", "0.6678704", "0.6656896", "0.6656786", "0.66556776", "0.66530454", "0.6638074", "0.6622864", "0.66216034", "0.66182846", "0.66145355", "0.6611067", "0.6609148", "0.6607714", "0.6599876", "0.65987283", "0.65942895", "0.65877527", "0.6579126", "0.65743816", "0.6573492", "0.6567748", "0.6558378", "0.65568054", "0.6554773", "0.65528136", "0.6550023", "0.65481645", "0.65476227", "0.65449804", "0.65429074", "0.6541178", "0.65386593", "0.65373975", "0.6536678", "0.6527158", "0.65198904", "0.6517039", "0.651525", "0.65143347", "0.6512767", "0.6504687", "0.64985913", "0.64979666", "0.6496062", "0.6494914", "0.6491374", "0.6490988", "0.6489515", "0.64854085", "0.6483589", "0.6479526", "0.6476803", "0.647416", "0.64733344", "0.64708", "0.6468626", "0.64685774", "0.6468047", "0.6463063", "0.6462831", "0.6462686", "0.6460301", "0.64602774", "0.64557004", "0.6455676", "0.6455483", "0.6453932", "0.645326", "0.6453231", "0.6451075", "0.6447611", "0.6446201", "0.6445057", "0.644425", "0.6442278" ]
0.6855749
7
Updates an existing FacturaGastos model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $this->layout ="main-admin"; $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id_factura_gastos]); } else { return $this->render('update', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['NubeFactura'])) {\n $model->attributes = $_POST['NubeFactura'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->IdFactura));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_detalle_factura]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n $condicion = new CodicionPago;\n $bodega = new Bodega;\n $categoria = new Categoria;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ConfFa']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ConfFa'];\n\t\t\tif($model->save()) {\n\t\t\t\t//$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t\t$this->redirect(array('update&id=1&men=S002'));\n } else {\n $this->redirect(array('update&id=1&men=E002'));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n 'condicion'=>$condicion,\n 'categoria'=>$categoria,\n 'bodega'=>$bodega,\n\t\t));\n\t}", "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, factura $factura)\n {\n $factura->fill($request->all());\n $factura->save();\n $facturas=factura::all();\n return redirect()->route('factura.index',[$factura])->with('status','Informacion Actualizada Correctamente');\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionComentarios'])) {\n $model->attributes = $_POST['GestionComentarios'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pagosconceptos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pagosconceptos'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin','id'=>$model->PACO_ID));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(Request $request, Factura $factura)\n {\n //\n }", "public function actionUpdate()\n {\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_tabla_presupuesto=$request->get('id_tabla_presupuesto');\n $id_postulacion = $request->get('id_postulacion');\n $model = $this->findModel($id_tabla_presupuesto);\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n\n if($buscaPostulacion != null && $model != null){ \n\n if ($model->load(Yii::$app->request->post())) {\n\n $cantidad = (float) preg_replace('/[^0-9.]/', '', $model->cantidad);\n $precioUni = (float) preg_replace('/[^0-9.]/', '', $model->precioUnitario);\n $total = $cantidad * $precioUni;\n $model->costoTotal = $total.'';\n \n if($model->save()){\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n }else{\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "public function actionUpdate()\n {\n $categoryOptions = DataHelper::getCategoryOptions();\n $statusMap = CmsCategory::getCategoryStatus();\n $model = $this->findModel($_GET['id']);\n if (Yii::$app->request->isPost) {\n $model->image_main_file = UploadedFile::getInstance($model, 'image_main_file');\n if (($file = $model->uploadImageMain())!=false) {\n UtilHelper::DeleteImg($model->image_main);\n $model->image_main = $file['src'];\n }\n $model->image_node_file = UploadedFile::getInstance($model, 'image_node_file');\n if (($file = $model->uploadImageNode())!=false) {\n UtilHelper::DeleteImg($model->image_node);\n $model->image_node = $file['src'];\n }\n $model->banner_file = UploadedFile::getInstance($model, 'banner_file');\n if (($file = $model->uploadBanner())!=false) {\n UtilHelper::DeleteImg($model->banner);\n $model->banner = $file['src'];\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n DataHelper::deleteCache();\n return $this->redirect(['index']);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n 'categoryOptions' => $categoryOptions,\n 'statusMap' => $statusMap,\n ]);\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) \r\n {\r\n return $this->redirect(['view', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n\r\n ]);\r\n }\r\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Cotizador'])) {\n $model->attributes = $_POST['Cotizador'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function update($id, UpdateFacturasRequest $request)\n {\n $input = $request->all();\n $auxfacturas = $this->facturasRepository->find($id); \n\n if( isset($input['iva']) ){\n $input['iva']=1;\n }else{\n $input['iva']=0;\n }\n\n $facturas = $this->facturasRepository->update($input, $id);\n if($input['cantidad']!=null && $input['precio_unitario']!=null){\n \n $Detalle = new FacturasDetalles;\n $Detalle ->id_fac=$id; \n $Detalle ->id_prod=$input['descripcion'];\n $Detalle ->cantidad=$input['cantidad'];\n $Detalle ->descripcion=$input['descripcion'] ;\n $Detalle ->precio_unitario=$input['precio_unitario'] ;\n $Detalle ->destino=$input['destino'] ;\n $Detalle->save();\n return redirect(route('facturas.edit',$id));\n } \n \n return redirect(route('facturas.index',$id));\n\n }", "public function update(GrastofijoFormRequest $request,$id)\n {\n $gasto=Gatofijo::findOrfail($id);\n $gasto->luz=$request->get('luz');\n $gasto->cable=$request->get('cable');\n $gasto->agua=$request->get('agua'); \n $gasto->hipoteca=$request->get('hipoteca'); \n $gasto->alquiler=$request->get('alquiler'); \n $gasto->otros=$request->get('otros'); \n $gasto->sub_total=$request->get('sub_total'); \n $gasto->update();\n return Redirect::to('gasto/gastofijo');\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function update()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_POST['id']);\n $tacgia->anh = $_POST['anh'];\n $tacgia->ten = $_POST['ten'];\n $tacgia->thongtin = $_POST['thongtin'];\n $tacgia->update();\n\n go_back();\n }", "public function update() {\n //Si no es adminitrador da un error.\n Login::checkAdmin(); \n \n //comprueba que llegue el formulario con los datos\n if (empty($_POST[T_UPDATE]))\n throw new Exception('No se recibieron datos');\n \n //podemos crear un nuevo coche o recuperar el de la BDD,\n // optamoss por crear uno nuevo para ahorrar una consulta.\n \n $coche= new Coche(); //coche nuevo\n \n $coche->id=intval($_POST['id']); //recuperar el id vía POST\n \n //recuperar el resto de campos\n $idmodelo=intval($_POST['idmodelo']); //recuperar el idmodelo vía POST\n $coche->idmodelo=$idmodelo;\n $coche->nombre=$_POST['nombre'];\n $coche->nserie=$_POST['nserie'];\n $coche->precio=floatval($_POST['precio']);\n \n //intenta realizar la actualización de datos\n if ($coche->actualizar()===false)\n throw new Exception(\"No se pudo actualizar $nave->nombre\");\n \n //redireccionamos a ModeloController::show($id);\n (new ModeloController())->show($idmodelo);\n \n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Aviso'])) {\n $model->attributes = $_POST['Aviso'];\n if ($model->save()) {\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pago']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pago'];\n\t\t\t$model->fechahoraregistro = date('Y-m-d H:i:s');\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(Request $request, $numero_factura)\n {\n $factura = Factura::find($numero_factura);\n $factura->fill($request->all());\n $factura->save();\n Flash::warning('La factura ha sido modificada');\n return redirect()->route('facturas.index');\n }", "public function update(CreateGastoRequest $request, Gasto $gasto)\n {\n $gasto->fill($request->validated());\n $gasto->save();\n $datos=Gasto::all();\n $suma=Gasto::sum('monto_g');\n return view('gasto.index',compact('datos', 'suma'));\n }", "public function actionUpdate($id)\n {\n $us = Usuarios::find()->where(['id' => Yii::$app->user->id])->one();\n if ($us->rol !== 'A' && $us->rol !== 'C' && $us->rol !== 'V') {\n return $this->goHome();\n }\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $sec = Secstocks::findOne(['uniforme_id' => $model->id]);\n if ($sec !== null) {\n if ($model->cantidad > $sec->ss) {\n $model->underss = false;\n }\n }\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->save() && $model->upload()) {\n if ($us->rol === 'V') {\n return $this->redirect(['index']);\n }\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Docingresados']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Docingresados'];\n\t\t\tif($model->save()) {\n\t\t\t //verificando si se slecciono la opcion de conservarlos valores \n\t\t\t\t\t\tif ($model->conservarvalor=='0' ) \n\t\t\t\t\t\t $this->Destruyesesiones();\n\t\t\t\t\t if (!empty($_GET['asDialog']))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Close the dialog, reset the iframe and update the grid\n\t\t\t\t\t\t\t\t\t\t\t\t\techo CHtml::script(\"window.parent.$('#cru-dialog1').dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t\t\t window.parent.$('#cru-frame1').attr('src','');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.parent.$.fn.yiiGridView.update('{$_GET['gridId']}');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tYii::app()->end();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t \n\t\t }\n\t\t}\n\t\t$this->layout = '//layouts/iframe';\n\t\t$this->render('update',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t\t\t));\n\t}", "public function actionUpdate($id) {\n\t\t$model = $this -> loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this -> performAjaxValidation($model);\n\n\t\tif (isset($_POST['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('update', array('model' => $model, ));\n\t}", "public function update(Request $request, $id)\n {\n $fpago=Pago::findOrFail($id);\n $fpago->forma=strtoupper($request->get('forma'));\n $fpago->descripcion=strtoupper($request->get('descripcion'));\n $fpago->update();\n Session::flash('message','Forma de pago actualizada');\n return redirect()->route('admin.fpagos.index');\n }", "public function actionUpdate($id)\n {\n if (Yii::$app->user->isGuest) {\n return $this->redirect([\"site/login\"]); \n }\n if(Permiso::requerirRol('lider')){\n $this->layout='/main2';\n }elseif(Permiso::requerirRol('vendedor')){\n $this->layout='/main3';\n }\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idproducto]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\t\n\t\t$this->titulo = 'Alterar Contato';\n\t\t$this->subTitulo = '';\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'update' );\n \n\t\t\treturn $this->redirect(['view', 'id' => $model->cod_contato]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['OperaPlanes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['OperaPlanes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n$this->layout='//layouts/column2';\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function update(){\n session_start();\n $id=$_SESSION['id_alumno'];\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n \n unset($_SESSION['id_alumno']);\n $this->model->update(['id'=>$id,'nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n \n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n\n // $this->index();\n\n // if ($this->model->update(['id'=>$id,'nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono])) {\n // $alumno = new Alumnos();\n // $alumno->id=$id;\n // $alumno->nombre=$nombre;\n // $alumno->apellido=$apellido;\n // $alumno->telefono=$telefono;\n // $this->view->alumno=$alumno;\n // $this->render();\n\n\n // }else{\n // $this->view->render('errors/index');\n // }\n // $url= constant('URL').\"alumno\";\n // header(\"Location: $url\");\n }", "public function update($id, AsistenciasC $asistenciasC, updateAsistenciasC $request)\n\t{\n\t\t$input = $request->all();\n\t\t$input['usu_mod_id']=Auth::user()->id;\n\t\t//update data\n\t\t$asistenciasC=$asistenciasC->find($id);\n\t\t$asistenciasC->update( $input );\n\n\t\treturn redirect()->route('asistenciasCs.index')->with('message', 'Registro Actualizado.');\n\t}", "public function update()\n\t{\n\t\tif($this->checkauth(9)['err']==1){\n\t\t\treturn $this->checkauth(9)['view'];\n\t\t}\n\t\t\n\t\t$gambar = \"\";\n\n\n\t\t$divisi = Divisi::where('id',Input::get('id'))->first();\n\t\t$divisi->nama = Input::get('nama');\n\n\t\tif(Input::hasFile('gambar') and Input::file('gambar')->isValid()){\n\t\t\t$gambar = date(\"YmdHis\")\n\t\t\t\t.uniqid()\n\t\t\t\t.\".\"\n\t\t\t\t.Input::file('gambar')->getClientOriginalExtension();\n\t\t\n\t\t\tInput::file('gambar')->move(storage_path().'/gambardivisi',$gambar);\n\t\t\n\t\t\t$divisi->gambar = $gambar;\n\t\t}\n\t\t\n\t\t$divisi->keterangan = Input::get('keterangan');\n\t\t$divisi->save();\n\n\n\t\treturn redirect(url('admin/divisi'));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ARTICULOS']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ARTICULOS'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }", "public function updatePizza(){\n\t\t$pizza = new PizzaModel();\n\t\t$pizza->update($_POST['id'], $_POST);\n\t\treturn redirect()->to('/pizza');\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id)\n {\n $data = Input::all();\n \n $promocion = Promociones::find($id);\n if(!is_null($promocion)){ \n $promocion->title = $data['title'];\n $promocion->discount = $data['discount'];\n $promocion->img = $data['img'];\n $promocion->price = $data['price'];\n $promocion->normalprice = $data['normalprice'];\n $promocion->save = $data['save'];\n $promocion->sold_amount = $data['sold_amount'];\n $promocion->location = $data['location'];\n $promocion->period = $data['period'];\n $promocion->info = $data['info'];\n $promocion->active = 1;\n $promocion->save();\n return redirect('/promocion'); \n }\n return redirect('/promocion');\n }", "function update()\n {\n $nim = $this->input->post('nim');\n $nama = $this->input->post('nama');\n $kota = $this->input->post('kota');\n $this->siswa_model->update($nim, $nama, $kota);\n redirect('siswa/page');\n }", "public function update(Request $request, Ubicacion $ubicacion)\n {\n $ubicacion->update($request->all());\n return redirect()->route('ubicacion.index')->with('success','Registro editado correctamente');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TDespachoCabecera']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TDespachoCabecera'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_despacho));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(){\n\t\t$this->autenticate();\n\t\t$id = $_POST['id'];\n\t\t$nombre = \"'\".$_POST['nombre'].\"'\";\n\t\t$fecha_nacimiento = \"'\".$_POST['fecha_nacimiento'].\"'\";\n\t\t$genero = \"'\".$_POST['genero'].\"'\";\n\t\t$tipo_sangre = \"'\".$_POST['tipo_sangre'].\"'\";\n\t\t$estado_civil = \"'\".$_POST['estado_civil'].\"'\";\n\t\t$peso = $_POST['peso'];\n\t\t$estatura = $_POST['estatura'];\n\t\t$provincia = \"'\".$_POST['provincia'].\"'\";\n\t\t$distrito = \"'\".$_POST['distrito'].\"'\";\n\t\t$corregimiento = \"'\".$_POST['corregimiento'].\"'\";\n\t\t$direccion = \"'\".$_POST['direccion'].\"'\";\n\t\t$telefono = \"'\".$_POST['telefono'].\"'\";\n\t\t$correo = \"'\".$_POST['correo'].\"'\";\n\t\t$sede = \"'\".$_POST['sede'].\"'\";\n\t\t$categoria = \"'\".$_POST['categoria'].\"'\";\n\t\t$departamento = \"'\".$_POST['departamento'].\"'\";\n\t\t$apartado_postal = \"'\".$_POST['apartado_postal'].\"'\";\n\t\t$cargo = \"'\".$_POST['cargo'].\"'\";\n\t\t$representante_gobierno = \"'\".$_POST['representante_gobierno'].\"'\";\n\t\t$unidad = \"'\".$_POST['unidad'].\"'\";\n\t\trequire_once(\"../app/models/administrativo.php\");\n\t\t$administrativo=new Administrativo();\n\t\t$administrativo->update($id,$nombre,$fecha_nacimiento,$genero,$tipo_sangre,$estado_civil,$peso,$estatura,$provincia,$distrito,$corregimiento,$direccion,$telefono,$correo,$sede,$categoria,$departamento,$apartado_postal,$cargo,$representante_gobierno,$unidad);\n\t\t$id = strval($id);\n\t\theader(\"Location: http://localhost:8000/administrativos/show/$id\");\n\t\texit;\n\t}", "public function update(Request $request)\n {\n $id = $request->id;\n CategoriaGasto::findOrFail($id)->update($request->all());\n return back()->with('alert-type', 'success')->with('status', 'Categoria editada con exito');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelSpecialita=ArrayHelper::map(SfidaSpecialita::find()\n ->orderby('sfs_specialita')\n ->asArray()\n ->all(), 'sfs_id', 'sfs_specialita');\n $modelTipologia=ArrayHelper::map(TipologiaMzt::find()\n ->orderby('tmz_tipologia')\n ->asArray()\n ->all(), 'tmz_id', 'tmz_tipologia');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->sfd_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelSpecialita' => $modelSpecialita,\n 'modelTipologia' => $modelTipologia,\n ]);\n }\n }", "public function update(Request $request)\n {\n $fornecedor= fornecedor::find($request->id);\n $fornecedor->NIF = $request['NIF'];\n $fornecedor->nomeCompleto = $request['nomeCompleto'];\n $fornecedor->nomeAbreviado = $request['nomeAbreviado'];\n $fornecedor->morada = $request['morada'];\n $fornecedor->email = $request['email'];\n $fornecedor->contacto = $request['contacto'];\n $fornecedor->observacoes = $request['observacoes'];\n $fornecedor->avaliacao = $request['avaliacao'];\n $fornecedor->visivel = $request['visivel'];\n $fornecedor ->save();\n \\Session::flash('success', 'O Fornecedor '. $fornecedor->nomeCompleto.' foi editado com sucesso');\n \n // escrever log \n return Redirect::to('/fornecedores');\n }", "public function actionUpdate($id)\n {\n $model=$this->loadModel($id);\n\n if (!$model->podeEditar()) {\n throw new CHttpException(409, 'Nota Fiscal não permite edição!');\n }\n\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n\n if (isset($_POST['NotaFiscal'])) {\n $model->attributes=$_POST['NotaFiscal'];\n if ($model->save()) {\n $this->redirect(array('view','id'=>$model->codnotafiscal));\n }\n }\n\n $this->render('update', array(\n 'model'=>$model,\n ));\n }", "public function update(Request $request, $tsca_cas)\n {\n $var = Esencia_Perfume::findOrFail($tsca_cas);\n $var->nombre = $request->nombre;\n $var->tipo = $request->tipo;\n $var->update();\n\n $familia = $request->get('esencia_familia');\n\n if ($familia) {\n for ($i=0; $i < count($familia); $i++) { \n $pp = new Esencia_Familia();\n $pp->id_esencia_perfume = $var->tsca_cas;\n $pp->id_familia = $familia[$i];\n $pp->save();\n \n } \n }\n return \\redirect('esencia')->with('success', 'Actualizado correctamente');\n }", "public function actionUpdate()\n\t{\n $id_livro = $_REQUEST['id_livro'];\n\n $model = emprestimo::model()->find('id_livro = :idLivro AND data_devolucao_efetiva is null', Array (':idLivro'=>$id_livro));\n\n\t\tif(isset($_POST['emprestimo']))\n\t\t{\n $emprestimo = $_POST['emprestimo'];\n $emprestimo['data_retirada'] = date('Y-m-d',strtotime(str_replace('/', '-', $emprestimo['data_retirada'])));\n $emprestimo['data_devolucao'] = date('Y-m-d',strtotime(str_replace('/', '-', $emprestimo['data_devolucao'])));\n\n $model->attributes=$emprestimo;\n \n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('/bibliotecas/livro/view','id'=>$model->id_livro));\n\t\t}\n\n $aluno = aluno::model()->findByPk($model->id_aluno);\n $livro = livro::model()->findByPk($model->id_livro);\n $biblioteca = biblioteca::model()->findByPk($livro->id_biblioteca);\n\n if(isset($model->data_devolucao_efetiva))\n $status = \"Finalizado\";\n elseif(!isset($model->data_devolucao_efetiva) && strtotime($model->data_devolucao) < strtotime(date('Y-m-d')))\n $status = \"Em Atraso\";\n else\n $status = \"Ativo\";\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model, 'aluno'=>$aluno,'livro'=>$livro,'biblioteca'=>$biblioteca,'status'=>$status,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n date_default_timezone_set('America/Sao_Paulo');\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if($model->status_chegada == 1){\n $model->data_chegada = date('Y-m-d');\n $model->save();\n }\n if ($model->status_entrega == 1){\n $model->data_pronto = date('Y-m-d');\n $model->save();\n }elseif ($model->status_entrega == 2 && !$model->data_pronto) {\n $model->data_entregue = date('Y-m-d');\n $model->data_pronto = date('Y-m-d');\n $model->save();\n }elseif ($model->status_entrega == 2){\n $model->data_entregue = date('Y-m-d');\n $model->save();\n }\n\n return $this->redirect(['index']);\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionStock'])) {\n $model->attributes = $_POST['GestionStock'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->kamar_id]);\n // }\n if ($model->load(Yii::$app->request->post())) {\n // Yii::$app->creator->update($model);\n $model->updated_by = Yii::$app->user->identity->username;\n \t $model->updated_date = date(\"Y-m-d\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->kamar_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }", "public function actionUpdate($id) {\n \n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n if (isset($_POST['BasePago'])) {\n //print_r($model);\n $model->attributes = $_POST['BasePago'];\n if ($model->save()){\n Yii::app()->user->setFlash('success',\"Pago modificado.\");\n \n $this->redirect(array('view', 'id' => $model->idPago));}\n }\n\n $this->render('update', array('model' => $model,\n ));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->id_oficial]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, $id)\n {\n //\n $visitas_fisicas = Visita_Fisica::findOrFail($id);\n $visitas_fisicas->año=$request->input('año');\n $visitas_fisicas->numero_de_cedula=$request->input('numero_de_cedula');\n $visitas_fisicas->fecha_de_cedula=$request->input('fecha_de_cedula');\n $visitas_fisicas->calle=$request->input('calle');\n $visitas_fisicas->colonia=$request->input('colonia');\n $visitas_fisicas->alcaldia=$request->input('alcaldia');\n $visitas_fisicas->cuenta_catastral=$request->input('cuenta_catastral');\n $visitas_fisicas->uso=$request->input('uso');\n $visitas_fisicas->superficie_del_terreno=$request->input('superficie_del_terreno');\n $visitas_fisicas->folio_de_solicitud=$request->input('folio_de_solicitud');\n $visitas_fisicas->oficio_de_solicitud=$request->input('oficio_de_solicitud');\n $visitas_fisicas->referencia=$request->input('referencia');\n $visitas_fisicas->realizo=$request->input('realizo');\n $visitas_fisicas->save();\n return redirect()->route('visitas_fisicas.index');\n\n }", "public function actionUpdate($id)\n {\n // $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // }\n\n // return $this->render('update', [\n // 'model' => $model,\n // ]);\n\n $model = $this->findModel($id);;\n $modelsAnggota = $model->stSpdAnggotas;\n\n // Only admin can change pegawai instansi otherwise auto_fill_instansi_with_user\n if(Yii::$app->user->identity->role==99){\n $model->setScenario(StSpd::SCENARIO_ADMIN);\n $model->detachBehavior(\"auto_fill_instansi_with_user\");\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n $model->createDocx();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelsAnggota' => (empty($modelsAnggota)) ? [new StSpdAnggota] : $modelsAnggota\n ]);\n }\n }", "public function actionUpdate($id){\r\r\n\r\r\n\t\tif($_POST){\r\r\n\r\r\n\t $OrdenConsumo = OrdenConsumo::model()->findByPk($id);\r\r\n\t $OrdenConsumo->fecha= $_POST['OrdenConsumo']['fecha'];\r\r\n\t $OrdenConsumo->codigo_id= 5;\r\r\n\t $OrdenConsumo->cliente_id= $_POST['OrdenConsumo']['cliente_id'];\r\r\n\t $OrdenConsumo->operario_id = $_POST['OrdenConsumo']['operario_id'];\r\r\n\t $OrdenConsumo->usuario_id = Yii::app()->user->id;\r\r\n\r\r\n\t /*Si es compra*/\r\r\n\t if(5==3)\r\r\n\t $operador ='+';\r\r\n\t else\r\r\n\t $operador ='-';\r\r\n\r\r\n\t if($OrdenConsumo->save()){\r\r\n\r\r\n\t foreach ($_POST['id'] as $key => $value) {\r\r\n\t $DetalleConsumo= DetalleConsumo::model()->findByPk( $_POST['id'][$key] );\r\r\n\t $DetalleConsumo->operacion = (Codigos::model()->findByPk(5)->codigo);\r\r\n\t $DetalleConsumo->orden_consumo_id = $OrdenConsumo->id;\r\r\n\t $DetalleConsumo->producto_id = $_POST['producto_id'][$key] ;\r\r\n\t $DetalleConsumo->cantidad = $operador.$_POST['cantidad'][$key];\r\r\n\t $DetalleConsumo->peso = $operador.$_POST['peso'][$key]; \r\r\n\t $DetalleConsumo->save();\r\r\n\t } \r\r\n\r\r\n\t \r\r\n\t $this->redirect(array(\r\r\n\t 'index',\r\r\n\t 'message'=>'Factura actualizada con exito'\r\r\n\t ));\r\r\n\t }\r\r\n\r\r\n\t }else{\r\r\n\r\r\n\t $this->render('update',array(\r\r\n\t 'model'=>$this->loadModel($id),\r\r\n\t 'DetalleConsumo'=>( DetalleConsumo::model()->findAll( 'orden_consumo_id=:orden_consumo_id', array(':orden_consumo_id'=>$id)) )\r\r\n\t ));\r\r\n\r\r\n\t }\r\r\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->file = UploadedFile::getInstance($model, 'file');\n\n if ($model->file == null) {\n } else {\n $model->atribuirImagem();\n }\n\n $model->save();\n Yii::$app->getSession()->setFlash('success', 'Produto editado com sucesso');\n return $this->redirect(['view', 'id' => $model->IDproduto]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, $id){\n\n $chefe = Chefe::find($id);\n\n $data = $request->all();\n $chefe->fill($data)->save();\n Session::flash('mensagem_edit', \"Cargo editado com Sucesso!\");\n return redirect()->route('chefe.index');\n }", "public function update()\n {\n $Codification->update($request->all());\n return redirect()->route('codifications.index')\n ->with('success','Codification updated successfully');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request)\n {\n $proyecto = FabProyectos::findOrFail($request->id);\n $proyecto = new FabProyectos();\n $proyecto->nom_proyecto = $request->nom_proyecto;\n $proyecto->cliente = $request->cliente;\n $proyecto->fecha = $request->fecha; \n $proyecto->ubicacion = $request->ubicacion; \n $proyecto->save();\n }", "public function actionUpdate($id)\n { \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel(crypt::Decrypt($id));\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Consegne']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Consegne'];\n\t\t\t$tmp = explode(\"/\",$model->data);\n\t\t\t$model->data = strtotime($tmp[2].'-'.$tmp[1].'-'.$tmp[0]);\n\t\t\t$model->id_user = Yii::app()->user->objUser['id_user'];\n\t\t\t$model->codfisc = strtoupper($model->codfisc);\n\t\t\t$model->nome = strtoupper($model->nome);\n\t\t\t$model->cognome = strtoupper($model->cognome);\n\t\t\t$model->indirizzo = strtoupper($model->indirizzo);\n\t\t\t$model->note = strtoupper($model->note);\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>crypt::Encrypt($model->id_archive)));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id_cat_puesto)\n\t{\n\t\t$catPuesto=$this->loadModel($id_cat_puesto);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($catPuesto);\n\n\t\tif(isset($_POST['CatPuesto']))\n\t\t{\n\t\t\t$catPuesto->attributes=$_POST['CatPuesto'];\n\n $catPuesto->fecha_modificacion = date('Y-m-d h:i:s');\n $catPuesto->persona_modificacion = Yii::app()->user->id;\n\n\n\t\t\tif($catPuesto->save())\n\t\t\t\t$this->redirect(array('index','id_cat_puesto'=>$catPuesto->id_cat_puesto));\n\t\t}\n\n\t\t$this->render('update',array(\n 'catPuesto'=>$catPuesto,\n\t\t));\n\t}", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n $estado = (Yii::$app->request->get(\"estado\"))?Yii::$app->request->get(\"estado\"):\"\";\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id_operacion' => $model->id_operacion]);\n } else {\n return $this->render('update', [\n 'model' => $model,'estado'=>$estado\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n\n $this->performAjaxValidation($model, 'ahorro-form');\n\n if (isset($_POST['Ahorro'])) {\n $model->attributes = $_POST['Ahorro'];\n// $model->fecha = Yii::app()->dateFormatter->format(\"yyyy-MM-dd hh:mm:ss\", $model->fecha);\n $model->fecha = Util::FormatDate($model->fecha, 'Y-m-d');\n if ($model->save()) {\n $this->redirect(array('admin'));\n }\n }\n $model->fecha = Util::FormatDate($model->fecha, 'd/m/Y');\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function update(Request $request, $id)\n {\n $carrera = Carrera::find($id);\n\n $carrera->escuela_id = $request->get('escuela');\n $carrera->codigo = $request->get('codigo');\n $carrera->nombre = $request->get('nombre');\n $carrera->descripcion = $request->get('descripcion');\n\n $carrera->save();\n\n Session::flash('message', 'La Carrera ' .$carrera->nombre.' ha sido actualizada');\n\n return redirect()->route('carrera.index');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\t\t\n\t\tif(isset($_POST['name']))\n\t\t{\n\t\t\t$model->fCatalogueName=$_POST['name'];\n\t\t\t$model->fStatus=$_POST['statu'];\n\t\t\t$model->fIsDownLoad=$_POST['down'];\n\t\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t\t$model->fUpdateDate=time();\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\t$this->renderPartial('update',array(\n\t\t\t\t\t\t'data'=>UFSBaseUtil::printJson(array(\n\t\t\t\t\t\t\t\t'fCatalogueName'=>CHtml::encode($model->fCatalogueName),\n\t\t\t\t\t\t\t\t'fIsDownLoad'=>CHtml::encode($model->fIsDownLoad),\n\t\t\t\t\t\t\t\t'fStatus'=>CHtml::encode($model->fStatus),\n\t\t\t\t\t\t\t\t'fUpdateDate'=>CHtml::encode(empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate)),\n\t\t\t\t\t\t\t\t'fUpdateUser'=>CHtml::encode($model->fUpdateUser),\n\t\t\t\t\t\t\t\t'msg'=>$this->FrameInfo(Yii::app()->params['layouttype']['top'],Yii::t('message','Update Success'),Yii::app()->params['notytype']['success']),\n\t\t\t\t\t\t))\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}", "public function update() {\n\t\t$id = $this->input->post('idUpdate');\n\t\t$data = $this->input->post();\n\t\t$update['nama'] = $data['nama_kategoriUpdate'];\n\t\tif ($this->kategori_m->update($id, $update)) {\n\t\t\t$this->message('Berhasil! Data berhasil di update', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n\t\t} else {\n\t\t\t$this->message('Gagal! Data gagal di update', 'danger');\n\t\t}\n\t\tredirect('kategori');\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n// return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect('/content-menu');\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update ()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_update');\n $view->title = \"Verein\";\n $view->heading = \"Verein bearbeiten\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->display();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_favorito]);\n\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, $id)\n {\n $cargos = Cargos::find($id);\n\n $cargos->update($request->all());\n\n return redirect(\"cargos\");\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->mensagens('success', 'Orçamento', 'Alterações realizadas com sucesso.');\n return $this->redirect(['orcamento/index', 'id_projeto' => $model->id_projeto]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id, UpdateCotacaoSeguroRequest $request)\n {\n $cotacaoSeguro = $this->cotacaoSeguroRepository->findWithoutFail($id);\n\n if (empty($cotacaoSeguro)) {\n Flash::error('Cotacao Seguro not found');\n\n return redirect(route('cotacaoSeguros.index'));\n }\n\n $cotacaoSeguro = $this->cotacaoSeguroRepository->update($request->all(), $id);\n\n Flash::success('Cotacao Seguro updated successfully.');\n\n return redirect(route('cotacaoSeguros.index'));\n }", "public function update(Request $request, $fincas)\n {\n $finca =finca:: where ('codigo_finca','=', $fincas)->first();\n $this->validate($request, [\n 'codigo_finca' => 'required|max:10',\n 'nombre_finca' => 'required|max:25',\n 'descripcion_finca' =>'required|max:255',\n ]);\n\n $finca->codigo_finca = $request->input('codigo_finca');\n $finca->nombre_finca = $request->input('nombre_finca');\n $finca->descripcion_finca = $request->input('descripcion_finca');\n $finca->save(); \n return redirect('/fincas/index');\n }", "public function actionUpdate($id)\n {\n \t//supaya org non guest gabisa akses yg lain\n \tif (\\Yii::$app->user->isGuest) {\n \t\treturn $this->redirect(Yii::$app->params['default']);\n \t}\n\t\t\n\t\t\t\t$jabatan=Yii::$app->user->identity->jabatan;\n\t\tif(!($jabatan=='Project Manager' || $jabatan=='Supervisor')){\n\t\t\treturn $this->redirect(Yii::$app->params['default'].'index.php/home');\n\t\t}\n\t\t\n\t\t//$model = new Barismilestone();\n $model = $this->findModel($id);\n \n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$id=$model->siteId;\n\t\t\treturn $this->redirect(Yii::$app->params['default'].\"index.php/site/view?id=$id\");\t\t\t\n\t\t}\n\t\t\t\n else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Respuestas']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Respuestas'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_con));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if (Yii::$app->request->post()) {\n $model->load(Yii::$app->request->post());\n $model->save();\n return $this->redirect(['site/view', 'id' => $model->id]);\n } else {\n return $this->render('knpr/update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}", "public function actionUpdate($id)\r\n {\r\n $model=$this->loadModel($id);\r\n\r\n // Uncomment the following line if AJAX validation is needed\r\n // $this->performAjaxValidation($model);\r\n if(isset($_POST['DetalleVenta']))\r\n {\r\n $model->attributes=$_POST['DetalleVenta'];\r\n if($model->save())\r\n $this->redirect(array('view','id'=>$model->id));\r\n }\r\n\r\n $this->render('update',array(\r\n 'model'=>$model,\r\n ));\r\n }", "public function update($id, Request $request)\r\n {\r\n \r\n $cotizacione = cotizacione::findOrFail($id);\r\n $cotizacione->update($request->all());\r\n\r\n Session::flash('message', 'cotizacione updated!');\r\n Session::flash('status', 'success');\r\n\r\n return redirect('cotizaciones');\r\n }", "public function update($id = null)\n {\n $model = new CategoriasModel(); \n $request = \\Config\\Services::request(); \n $nombre = $request->getPostGet('nombre'); \n $datos = array(\n 'NombreCa' => $nombre\n ); \n $model->update($id, $datos);\n return redirect()->to(base_url('/categorias')) ;\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // $model->ReClave=$model->Clave;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idUsuario]);\n }\n\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request)\n {\n\n Vendas::where('id', $request->id)->update([\n \t'id_funcionario' => $request->id_funcionario, \n\t 'id_cliente' => $request->id_cliente, \n\t 'id_produto' => $request->id_produto, \n\t 'quantidade' => $request->quantidade]);\n\n return redirect()->route('vendasget');\n }", "public function update(RessourceFormRequest $request)\n\t{\n\t\t//\n\t\t$ressource = Ressource::find($request->id);\n\t\t$ressource->name = $request->name;\n\t\t$ressource->site_id = $request->site_id;\n\t\t//$ressource->domaine_id = $request->domaine_id;\n\t\t//$ressource->categorie_id = $request->categorie_id;\n\t\t//$ressource->date_service = date(\"Y-m-d\",strtotime($request->date_service));\n\t\t$ressource->date_service = implode('/', array_reverse( explode('/',$request->date_service) ) );\n\t\t$ressource->reference = $request->reference;\n\t\t$ressource->comment = $request->comment;\n\t\tif(Input::has('actif'))\n\t\t{\n\t\t\t$ressource->actif = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ressource->actif = 0;\n\t\t}\n\t\t$ressource->save();\n\t\t\\Session::flash('message', 'Ressource mise à jour.');\n\t\treturn redirect('/ressource/edit/'.$request->id);\n\t}", "public function update($id)\n {\n $input = Request::except('_token');\n\n $tarifario = Tarifario::findOrfail($id);\n \t\n $tarifario->Vigencia = $input['Vigencia'];\n \n $tarifario->UsuarioUltAct = $input['UsuarioUltAct'];\n \n $tarifario->FechaUltAct = $input['FechaUltAct'];\n \n \n $tarifario->save();\n\n return redirect('tarifario');\n }", "public function update(Request $request, $id){\n $actPedagogia = ActPedagogia::findOrFail($id);\n $actPedagogia->canalizacion = $request->canalizacion;\n $actPedagogia->update();\n return redirect()->back();\n }", "public function actionUpdate($id)\n\t{\n\t\ttry{\n\t\t\t$model=$this->loadModel($id);\n\t\n\t\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\t// $this->performAjaxValidation($model);\n\t\n\t\t\tif(isset($_POST['Story']))\n\t\t\t{\n\t $model->size_id = $_POST['Story']['size_id'];\n\t $model->sstory_id = $_POST['Story']['sstory_id'];\n\t $model->weight = $_POST['Story']['weight'];\n\t $model->number = $_POST['Story']['number'];\n\t $model->cstory_id = $_POST['Story']['cstory_id'];\n\t $model->description = $_POST['Story']['description'];\n\t $model->modified_in = new CDbExpression('NOW()');\n\t if(!$model->save()){\n\t $transaccion->rollback();\n\t throw new Exception(\"Error al guardar la historia.\".var_dump($model->errors));\n\t }\n\t \n\t $project = $model->pbacklogs[0]->project;\n\t Historical::record(\"Se editó la historia número \".$model->number.\" - \".$model->description.\" - al proyecto \".$project->key.\" - \".$project->name.\".\", \"Story\", $model->id);\n\t $this->redirect(array('project/productbacklog/'.$project->id));\n\t\t\t}\n\t\n\t\t\t$this->render('update',array(\n\t\t\t\t'model'=>$model,\n\t\t\t 'project'=>$model->pbacklogs[0]->project\n\t\t\t));\n\t\t}catch(Exception $e){\n throw new CHttpException(\"de sistema \", $e -> getMessage());\n }\n\t}", "public function update()\n {\n // if we have POST data to create a new customer entry\n if (isset($_POST['submit_update_vendedor'])) {\n // Instance new Model (Customers)\n $Vendedor = new VendedoresModel();\n // do update() from model/model.php\n $Vendedor->update($_POST['nome'], $_POST['email'], $_POST['vendedor_id']);\n }\n\n // where to go after customer has been added\n header('location: ' . URL . 'vendedores/index');\n }", "public function update(Request $request)\n {\n //\n $categoria= Category::findOrFail($request->id_categoria);\n $categoria->nombre= $request->nombre;\n $categoria->descripcion= $request->descripcion;\n $categoria->estado= '1';\n $categoria->save();\n return Redirect::to(\"/admin/categoria\");\n }", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "public function actionUpdate($id)\n\t{\n\t $this->layout = \"//layouts/column2admin\";\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pedido']))\n\t\t{\n\t\t $model->cambiarTipoEstado(TipoEstadoPedido::model()->findByPk($_POST['Pedido']['id_tipo_estado']));\n\t\t\t$model->attributes=$_POST['Pedido'];\n \n if (isset($_POST['ValoresDescriptor'])) {\n $model->addValores($_POST['ValoresDescriptor']);\n }\n\t\t\tif($model->save()) {\n\t\t\t Yii::app()->user->setFlash('success','Registro salvado correctamente');\n\t\t\t\t$this->redirect(array('admin'));\n } else {\n Yii::app()->user->setFlash('error','Error al salvar el registro');\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n if(Permiso::requerirRol('administrador')){\n $this->layout='/main2';\n }elseif(Permiso::requerirRol('gestor')){\n $this->layout='/main3';\n }\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idUsuario]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate()\n\t{\n\t\t$model=$this->loadfiles();\n\t\tif(isset($_POST['Files']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Files'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n // check active diet\n if($model->status_del) throw new NotFoundHttpException('The requested page does not exist.');//return $this->redirect(['index']);\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.68579215", "0.6842699", "0.67270225", "0.66001326", "0.6575052", "0.6437881", "0.6400569", "0.63786995", "0.6373376", "0.637138", "0.6363588", "0.63323665", "0.6303967", "0.62889224", "0.6274382", "0.6267757", "0.6264036", "0.6260078", "0.62341714", "0.6218727", "0.62018037", "0.619482", "0.6188804", "0.61596733", "0.6143455", "0.6127246", "0.6117736", "0.61139715", "0.6106455", "0.6098917", "0.60886335", "0.6068173", "0.6067566", "0.6062678", "0.60565245", "0.60501426", "0.60344267", "0.60312355", "0.60268116", "0.6022966", "0.6001516", "0.5995354", "0.59940124", "0.59916735", "0.59816074", "0.5978773", "0.5977384", "0.5973805", "0.597044", "0.5970356", "0.5969243", "0.5964102", "0.59597063", "0.5953735", "0.5953602", "0.5946322", "0.5946098", "0.594566", "0.5942427", "0.59370095", "0.5931308", "0.5926927", "0.59244955", "0.592187", "0.59200597", "0.5919233", "0.59178066", "0.59175086", "0.5914893", "0.5914841", "0.5913286", "0.59082025", "0.59055054", "0.59049296", "0.5904784", "0.5897742", "0.5894591", "0.588467", "0.5884577", "0.5883442", "0.588295", "0.58824", "0.5877861", "0.58774173", "0.58722335", "0.58697665", "0.58697", "0.5867403", "0.5864669", "0.58640945", "0.586351", "0.5859428", "0.5858152", "0.58578074", "0.5852943", "0.5850288", "0.58438444", "0.5843556", "0.5839845", "0.58387166" ]
0.7221478
0
Deletes an existing FacturaGastos model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_tabla_presupuesto=$request->get('id_tabla_presupuesto');\n $id_postulacion = $request->get('id_postulacion');\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n $buscaTablaPresupuesto = Tablapresupuesto::find()->where(['id_tabla_presupuesto' => $id_tabla_presupuesto])->one();\n if($buscaPostulacion != null && $buscaTablaPresupuesto != null){ \n\n $this->findModel($id_tabla_presupuesto)->delete();\n\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "public function actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function actionDelete($id) {\n \n Vacancy::deleteAll(['fid'=>$id]);\n \n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public function delete()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $tacgia->delete();\n\n go_back();\n }", "public function deleteAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre &eacute;cole n\\'a pas été supprimé.';\n\n\t\t$school = School::find( (int) $this->getRequest()->post('id') );\n\t\t$deleted = $school->delete();\n\n\t\tif ( $deleted ) {\n\t\t\t$message = 'Votre &eacute; a correctement été supprimé.';\n\t\t}\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'status' => $deleted,\n\t\t\t'message' => $message,\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}", "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function actionDelete() {\n $model = new \\UsersModel();\n $login = $this->getParam('login');\n\n if ( $model->delete($login) ) {\n $this->flashMessage('Odstraněno', self::FLASH_GREEN);\n } else {\n $this->flashMessage('Záznam nelze odstranit', self::FLASH_RED);\n }\n\n $this->redirect('default');\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id) {\n $model=$this->findModel($id);\n\t\t$id_operacion=$model->id_operacion;\n\t\t$model->delete();\n\t\t\n\t\treturn $this->redirect(['index', 'id_operacion' => $id_operacion]);\n //return $this->redirect(['index']);\n }", "public function actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if (Yii::$app->request->isPost) {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->unlinkAll('comments', true);\n if($this->findModel($id)->delete()) {\n Yii::$app->session->setFlash('success', 'Статья удалена');\n } else {\n Yii::$app->session->setFlash('error', 'При удалении возникла ошибка');\n }\n }\n return $this->renderIndex();\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteAction()\n {\n \t$this->_helper->getHelper('ViewRenderer')->setNoRender(true);\n \t\n \t// Récuperation de l'ID photo\n\t\t$id = (is_numeric($this->_getParam('id'))) ? $this->_getParam('id') : 0;\n\t\t\n\t\t// Récuperation de la photo\n\t\t$photoMapper = new Application_Model_PhotoMapper();\n\t\t$photo = $photoMapper->getPhoto($id);\n\t\t\n\t\tif(!is_null($photo))\n\t\t{\n\t\t\t// Suppression de la photo\n\t\t\t$rowsDeleted = $photoMapper->deletePhoto($id);\n\t\t\n\t\t\t// Message\n\t\t\t$message = $rowsDeleted.' photo supprimée';\n\t\t\t$this->_helper->getHelper('FlashMessenger')->addMessage($message);\n\t\t\t\n\t\t\t// Redirection\n\t\t\t$this->_helper->getHelper('Redirector')->gotoSimple('edit', 'project', 'admin', array('id' => $photo->getIdProjet()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_helper->getHelper('Redirector')->gotoSimple('list', 'project', 'admin');\n\t\t}\n }", "public function destroyAction() {\n $model = new Application_Model_Compromisso();\n //mando para a model o id de quem sera excluido\n $model->delete($this->_getParam('id'));\n //redireciono\n $this->_redirect('compromisso/index');\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function borrarfactura(){\nUtils::administador(); \nif(isset($_GET['id'])){\n$id = $_GET['id'];\n$pago = new PagoFactura();\n$pago->setId($id);\n$pagos = $pago->delete();\n} \n\nif($pagos){\n$_SESSION['mensaje'] = 'Factura Eliminada Correctamente'; \n}\n\nelse{\n$_SESSION['error'] = 'Error al Eliminar Factura'; \n}\n\nheader(\"location:\".base_url.\"Admin/facturas\");\n}", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function index_delete()\n {\n $id = (int) $this->delete('id');\n\n //Obtenemos el registro\n $row = $this->Rest_model->get(array('id' => $id));\n \n //Validamos que exista\n if(!empty($this->delete('id')) && empty($row))\n {\n //Devolvemos un error en caso de que no exista\n $this->response([\n 'status' => FALSE,\n 'message' => 'El registro no existe'\n ], REST_Controller::HTTP_BAD_REQUEST);\n }\n \n //Borramos el registro\n $result = $this->Rest_model->delete($id);\n\n if($result >= 1)\n {\n $this->response([\n 'status' => TRUE,\n 'message' => 'Registro eliminado con éxito'\n ], REST_Controller::HTTP_OK);\n }\n\n $this->response([\n 'status' => FALSE,\n 'message' => 'Ocurrió un error'\n ], REST_Controller::HTTP_BAD_REQUEST);\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "function delete($idUsuario){\n $this->UsuarioModel->destroy($idUsuario);\n\n redirect(\"usuario\");\n\n\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\r\n\t{\r\r\n\r\r\n\t\tif($this->loadModel($id)->delete())\r\r\n \tDetalleConsumo::model()->deleteAll( 'orden_consumo_id=:orden_consumo_id', array(':orden_consumo_id'=>$id) );\r\r\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\r\n\t\tif(!isset($_GET['ajax']))\r\r\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\r\n\t}", "public function deleteAction() {\n\t\t// if($post->delete()) {\n\t\t// \tSession::message([\"Post <strong>$post->name</strong> deleted!\" , \"success\"]);\n\t\t// \tredirect_to('/posts/index');\n\t\t// } else {\n\t\t// \tSession::message([\"Error saving! \" . $error->get_errors() , \"success\"]);\n\t\t// }\n\t}", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete() {\n// print_r($_POST);\n Comment::model()->findByPk($_POST['id'])->delete();\n echo CJSON::encode(array(\"data\" => 'berhasil'));\n// $this->loadModel($_POST['id'])->delete();\n // if AJAX request (triggered by deletion via dashboard grid view), we should not redirect the browser\n// if (!isset($_GET['ajax']))\n// $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('dashboard'));\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n Yii::$app->session->setFlash('success','Prefactura eliminada correctamente');\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $this->_findModel($id)->delete();\n return $this->redirect(['index']);\n }", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function deleteAction()\n {\n $service = $this->getServiceLocator()->get($this->service);\n if( $service->delete($this->params()->fromRoute('id', 0)) )\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n else\n $this->getResponse()->setStatusCode(404);\n\n }", "public function delete()\n {\n $id = $this->uri->segment('5');\n if ($this->global_model->delete('classified', array('id' => $id))) {\n $this->session->set_flashdata('success', 'Delete successfully!');\n redirect('admin/Classifieds/Classifieds/viewmyclassfied');\n }\n\n }", "public function deleteAction() {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('backend-guildes-list');\n }\n $oTable = $this->getTableGuilde();\n $oEntite = $oTable->findRow($id);\n $oTable->delete($oEntite);\n $this->flashMessenger()->addMessage($this->_getServTranslator()->translate(\"La guilde a été supprimée avec succès.\"), 'success');\n return $this->redirect()->toRoute('backend-guildes-list');\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function actionDelete($id) {\r\n\t\t$this->findModel ( $id )->delete ();\r\n\t\t\r\n\t\treturn $this->redirect ( [ \r\n\t\t\t\t'index' \r\n\t\t] );\r\n\t}", "public function actionDelete()\n {\n $id = $_POST['id'];\n\n if($this->loadModel($id)->delete()){\n $_SESSION['delete'] = \"Service deleted successfully\";\n echo json_encode([\n 'token' => 1,\n ]);\n }\n else{\n echo json_encode([\n 'token' => 0,\n ]);\n }\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n /*if(!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));*/\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "function index_delete() {\n $id_diagnosa = $this->delete('id_diagnosa');\n $this->db->where('id_diagnosa', $id_diagnosa);\n $delete = $this->db->delete('diagnosa');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "public function actionDelete()\n {\n return $this->findModel(Yii::$app->request->post('id'))->delete(false);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n \n $model->delete();\n return $this->redirect([\n 'index'\n ]);\n }", "public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "function eliminar(){\n\t\t$this->load->helper('url');\n\t\t$id=$this->input->post('documento');\n\t\t\n\t\t$this->load->model('Investigador_Model');\n\t\t$this->Investigador_Model->eliminar($id);\n\t\tredirect('Investigador_Controller');\n\t}", "public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }" ]
[ "0.73244494", "0.7314289", "0.69912285", "0.6966967", "0.6918114", "0.69061714", "0.68892163", "0.68714225", "0.6858354", "0.68575025", "0.68504465", "0.6787784", "0.6766061", "0.6766061", "0.6763107", "0.67396176", "0.67357373", "0.6712747", "0.6712747", "0.6701593", "0.6697948", "0.66977084", "0.66911155", "0.6688105", "0.6680131", "0.6666088", "0.66623235", "0.66458714", "0.6645435", "0.6638445", "0.6618455", "0.6618393", "0.66169894", "0.6598329", "0.65945655", "0.6585916", "0.6585916", "0.65838593", "0.65838593", "0.6582602", "0.6578178", "0.6576707", "0.6576707", "0.65756047", "0.65756047", "0.65756047", "0.65756047", "0.65756047", "0.65756047", "0.65756047", "0.6574632", "0.6567813", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65656024", "0.65628624", "0.65591", "0.65591", "0.65591", "0.65591", "0.6548818", "0.6548818", "0.65470105", "0.6544717", "0.65423405", "0.65382266", "0.65382266", "0.6538156", "0.65315664", "0.6524087", "0.6524087", "0.6524087", "0.65164274", "0.6511808", "0.65041816", "0.64974487", "0.64971673", "0.64926314", "0.64893514" ]
0.0
-1
Finds the FacturaGastos model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = FacturaGastos::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function find($primary_key, $model);", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id) {\n $model = NubeFactura::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }", "protected function findModel($id)\n {\n if (($model = Cluster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Campanha::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = InfraestructuraEducativa::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Docingresados::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Document::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('Страница не существует.');\n }", "protected function findModel($id)\n {\n if (($model = MarcacaoConsulta::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = SkepPenetapanBcf15::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Apresentacao::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "protected function findModel($id)\n {\n if (($model = GeSeguimientoGestion::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Kamar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function findById() {\n // TODO: Implement findById() method.\n }", "protected function findModel($id)\n {\n if (($model = Sfida::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id, $id_devolucion) {\n if (($model = Factura::findOne(['id' => $id, 'id_devolucion' => $id_devolucion])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('La página solicitada no existe');\n }\n }", "protected function findModel($id)\n {\n if (($model = KhoSanPham::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find(int $id): ?Model;", "public function find(int $id): ?Model;", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "protected function findModel($id)\n {\n if (($model = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = DaftarSmk::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Orcamento::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = RefFoods::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}", "public function find($id = null) {\n $argument = $id?? $this->request->fetch('id')?? null;\n return $this->model->find($argument);\n }", "protected function findModel($id)\n {\n if (($model = Comercios::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model=CompraCartao::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = GiftcodeType::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "public function findModel($clz, $key);", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Financeiro::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = ComingsRepository::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Documento::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = RealEstateMaster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Nursinghomes::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n \tif (\\Yii::$app->user->isGuest) {\n \t\treturn $this->redirect(Yii::$app->params['default']);\n \t}\n\t\t//supaya org non guest gabisa akses yg lain\n\t\t\n if (($model = Barismilestone::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kaohao::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Convocatoria::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = $this->motherboardRepository->find($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = Cash::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = MagentoFruugoInfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ProgramHasSumberDana::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = Recetastbl::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n }", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}", "protected function findModel($id)\n {\n if (($model = MsCoa::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id){\r\r\n\r\r\n\t $model=OrdenConsumo::model()->findByPk($id);\r\r\n\r\r\n\t if($model===null)\r\r\n\t throw new CHttpException(404,'The requested page does not exist.');\r\r\n\t return $model;\r\r\n\r\r\n\t}", "protected function findModel($id)\n {\n if (($model = PaskibraModel::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model = IdeaHeap::model()->findByPk($id);\n\n if ($model === null)\n throw new CHttpException(404);\n return $model;\n }", "public function loadModel($id) {\n $model = Carrer::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Appdependencias::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = UserGroupMaster::findOne($id)) !== null)\n\t{\n return $model;\n }\n\telse\n\t{\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Fenhong::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = Contestant::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = RefPembahasan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SanPham::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected\n\tfunction findModel(\n\t\t$id\n\t) {\n\t\tif ( ( $model = Building::findOne( $id ) ) !== null ) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModel($id) {\n if (($model = Cars::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = HasilKonsultasi::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id) {\n $model = GestionStock::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Clausuras::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = CatalogDocument::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('catalog', 'The requested page does not exist.'));\n }", "protected function findModel($id)\r\n {\r\n if (($model = Usertable::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function loadModel($id)\n\t{\n\t\t$model=ConfFa::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n\t{\n if (($model = CoreSettings::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "protected function findModel($id)\n {\n if (($model = DrugTuri::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PropertyPreAppraisalImages::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\r\n {\r\n if (($model = Pelanggaran::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = Brand::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'La página solicitada no existe').'.');\n }", "public function loadModel($id) {\n $model = Cotizador::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Korzet::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'A keresett tartalom nem található.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Consulta::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model=NotaFiscal::model()->findByPk($id);\n if ($model===null) {\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Buku::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = PublicNum::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Major::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Gallery::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function _findModel($id)\n {\n $modelClass = $this->_getModelClass();\n\n if (($model = $modelClass::findOne($id)) === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Contain::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = CardRecharge::findOne(['f_physical_id' => $id, 'f_parent_spot_id' => $this->parentSpotId])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('你所请求的页面不存在');\n }\n }", "protected function findModel($id)\n {\n if (($model = Capil::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Ocorrencia::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SecurityEntities::findOne($id)) !== null) \n {\n return $model;\n } else \n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Route::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id) {\n $model = Aviso::model()->findByPk($id);\n if ($model === null) {\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = CursoProger::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
[ "0.6862537", "0.680813", "0.67317003", "0.65594375", "0.6491513", "0.64674497", "0.6465391", "0.6438614", "0.6422437", "0.64214915", "0.6411807", "0.63901937", "0.6386965", "0.6376312", "0.63663197", "0.6362384", "0.6359765", "0.6357555", "0.6355867", "0.63535285", "0.63484114", "0.63452077", "0.63439405", "0.6340235", "0.63371456", "0.6336101", "0.6335309", "0.6335309", "0.6334472", "0.63299054", "0.6319561", "0.6314686", "0.63132447", "0.6311083", "0.6309645", "0.6307734", "0.63072765", "0.6304189", "0.630239", "0.63009715", "0.6299582", "0.62971544", "0.6295426", "0.6288119", "0.62833476", "0.6282018", "0.6278602", "0.62777096", "0.6262702", "0.6262542", "0.62615186", "0.6256987", "0.6252964", "0.6251382", "0.6239136", "0.62349784", "0.623372", "0.6229829", "0.62285966", "0.62216043", "0.62200505", "0.621657", "0.6211603", "0.62104833", "0.6208682", "0.620841", "0.62079966", "0.6207963", "0.62058794", "0.6205446", "0.62004906", "0.61959827", "0.61916196", "0.6190308", "0.618918", "0.61884356", "0.61879116", "0.61859703", "0.6185772", "0.6183746", "0.6183128", "0.6182897", "0.61806804", "0.618002", "0.6178744", "0.61775726", "0.6177459", "0.6175677", "0.617352", "0.6172078", "0.61688423", "0.6167765", "0.6167608", "0.616642", "0.61659014", "0.6163211", "0.6162945", "0.6162492", "0.61612093", "0.61608857" ]
0.66535676
3
TODO: Implement apply() method.
public function apply(Builder $builder, Model $model) { //un usuario es vendedor(seller) cuando tiene productos $builder->has('products'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function apply() {}", "public function apply();", "public function apply();", "public function apply()\n {\n return $this;\n }", "public function apply($value);", "public function __invoke()\n {\n return $this->apply(func_get_args());\n }", "public function getInstanceApply()\n {\n return $this->get(self::_INSTANCE_APPLY);\n }", "function apply($q);", "protected abstract function applyNoArg();", "function apply() {\n\t\t$this->store();\n\t}", "function apply($fn, $args) {\n return call_user_func_array($fn, $args);\n}", "protected function processApply(array $apply, string $name, DataSet $dataSet, $value): void {\n\n foreach ($apply as $applyIndex => $applyDefinition) {\n\n $maxIndexes = [\n 'g' => 0,\n ];\n\n // Set this to false to start the process\n $isDoneProcessing = false;\n\n // End the process if everything has been processed\n while (!$isDoneProcessing) {\n\n // Set this to true - If a collection is being processed it'll update the status\n $isDoneProcessing = true;\n\n // Get the params\n $params = $applyDefinition->getArgs();\n\n // Process each params (retrieve reference if available)\n foreach ($params as $paramIndex => &$param) {\n\n // Generate the reference locator key\n $referenceLocatorName = md5($name . $applyIndex . $paramIndex . (string)$param);\n\n // Retrieve the current reference locator if it is registered\n $referenceLocator = $this->services->getReferenceLocatorCollection()->getReferenceLocator($referenceLocatorName);\n\n // Init and register the reference locator if empty\n if (!isset($referenceLocator)) {\n\n $referenceLocator = new ReferenceLocator($param);\n $this->services->getReferenceLocatorCollection()->registerReferenceLocator($referenceLocatorName, $referenceLocator);\n\n }\n\n // Update the param value if it was a reference\n if ($referenceLocator->isReference()) {\n\n // Get the next reference available in the reference locator\n $reference = $referenceLocator->getNextReference($this->services->getDataSetCollection());\n\n // Update the reference string in the param with the reference value\n $param = $reference->getValue();\n\n if (!$referenceLocator->isDone()) {\n\n // Prevent the process to break out of the loop if we have other references to process\n $isDoneProcessing = false;\n\n }\n\n // Save the highest index set (default) to be able to generate the final field key later\n $referenceIndexes = $reference->getIndexes();\n if (isset($referenceIndexes['g']) && $referenceIndexes['g'] >= $maxIndexes['g']) {\n\n $maxIndexes = $referenceIndexes;\n\n }\n\n }\n\n }\n\n if ($applyDefinition->getType() === ContractApplyDefinition::TYPE_PROCESSOR) {\n\n // Get the processor by name\n $processor = $this->services->getDataProcessorCollection()->getDataProcessor($applyDefinition->getName());\n\n // If value = null try to get key first (this should only work in the case of a source since the\n // destination is supposed to be empty for now)\n if (!isset($value)) {\n\n $value = $dataSet->get($name);\n\n }\n\n // Apply the processor\n $value = $processor->process($value, $params);\n\n // Generate the final key\n $fieldKey = $name;\n foreach ($maxIndexes as $level => $index) {\n\n $fieldKey = str_replace('[$' . $level . ']', $index, $fieldKey);\n\n }\n\n // Set the final value\n $dataSet->set($fieldKey, $value);\n\n } elseif ($applyDefinition->getType() === ContractApplyDefinition::TYPE_VALIDATOR) {\n\n // Get the validator by name\n $validator = $this->services->getDataValidatorCollection()->getDataValidator($applyDefinition->getName());\n\n // If value = null try to get key directly (this should only work in the case of a source since the\n // destination is supposed to be empty for now)\n if (!isset($value)) {\n\n $value = $dataSet->get($name);\n\n }\n\n // Apply the validator\n $isValid = $validator->validate($value, $params);\n\n if (!$isValid) {\n throw new MetamorphoseValidateException('Invalid value for the target field or attribute ' . $name);\n }\n\n } else {\n\n throw new MetamorphoseException('Invalid apply type for ' . $name);\n\n }\n\n }\n\n }\n\n }", "function apply(callable $cb) {\n\t\tarray_walk($this->rows, $cb, $this);\n\t\treturn $this;\n\t}", "public function __invoke() {\n $args = func_get_args();\n $numArgs = count($args);\n\n if ($numArgs > 0) {\n\t$callback = function ($applicativeFun, $applicativeArg) {\n\t return $applicativeFun->apply($applicativeArg);\n\t};\n\t$result = array_reduce($args, $callback, $this);\n } else {\n\t$result = $this->apply();\n }\n\n return $result;\n }", "public function apply(Cell $cell)\n {\n }", "public function apply($query);", "public function apply(callable $callback);", "public function call()\n {\n return $this->apply(func_get_args());\n }", "abstract protected function appliesTo(): string;", "public function apply($model);", "public function apply($entity);", "public function __construct(array $apply)\n {\n $this->apply = $apply;\n }", "abstract public function apply(Builder $builder, Model $model);", "public function applyValue($value);", "public function apply(callable ...$callables): self;", "function OnAfterApply(){\n }", "public function apply(?callable $callable = null): self;", "abstract public function transform();", "function OnBeforeApply(){\n }", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "protected function applyTransformation() {\n // no transformation for index\n }", "abstract public function apply($tokens);", "public function to_fn() {\n $self = $this;\n return static function ($values) use ($self) {\n return $self->apply($values);\n };\n }", "private function applyArray($arr)\n {\n foreach ($this as $key => $value)\n if (isset($arr[$key]))\n $this->$key = $arr[$key];\n }", "public function to_a() {\n $self = $this;\n return static function ($values) use ($self) {\n return $self->apply($values)->to_a();\n };\n }", "function onBeforeApply() {\n\t\treturn true;\n\t}", "function iterator_apply(Traversable $iterator, callable $callback, ?array $args): int {}", "protected function _applyCustomFilter() {\r\n return $this;\r\n }", "protected abstract function map();", "public static function apply($subject, $matches)\n {\n }", "public function mutate();", "public function mutate();", "public function applies() {\n return IWJ_Applies::instance();\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n }", "public function getOneClickApply();", "public function applyDiff(Diff $diff);", "public function __invoke()\n {\n $callable = $this->callable;\n return $callable(...$this->arguments);\n }", "public function apply(Exception $ex);", "public function canApply(): bool;", "public function apply($values) {\n $fnToApply = $this->fnToApply;\n return $fnToApply($values);\n }", "public function apply(ModelCriteria $query);", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "final public function apply($applicativeArgument = null) {\n return is_null($applicativeArgument) ?\n\t$this->applyNoArg() :\n\t$this->applyToArg($applicativeArgument);\n }", "function RunnerApply (&$obj, &$argsArr)\n{\t\n\tforeach ($argsArr as $key=>$var)\n\t\tsetObjectProperty($obj,$key,$argsArr[$key]);\n}", "abstract public function apply(Request $request, Response $response, Closure $next);", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "public function apply(Model $model): \\Illuminate\\Database\\Eloquent\\Builder;", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }", "abstract public function apply(Event $event) : Model;", "public abstract function compute();", "function apply($node)\r\n\t\t{\r\n\t\t\t$this->address = $node->address;\r\n\t\t\t$this->elements = $node->elements;\r\n\t\t\t$this->size = $node->size;\r\n\t\t\t$this->parent = $node->parent;\r\n\t\t\t$this->less = $node->less;\r\n\t\t\t$this->previous = $node->previous;\r\n\t\t\t$this->next = $node->next;\r\n\t\t}", "public function apply(\\DOMElement $dom, Scope $scope);", "public function apply(Builder $query, $value);", "public function apply($select, $column, $value);", "abstract public function map($data);", "public function call();", "public function call();", "public function _apply()\n {\n $order = $this->_entity;\n $data = $order->getArrayCopy();\n\n $orderTotal = $data['grand_total'] - $data['shipping_total'];\n foreach (Order::getNonCashPaymentCodes() as $code) {\n $orderTotal += $data[$code];\n }\n\n return array('order_total'=> $orderTotal);\n }", "public function apply(&$values): bool;", "public function invoke();", "abstract public function map(callable $func);", "public function map(Closure $mutate): Result;", "abstract public function mapValues(\\Closure $f): self;", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "public function transform(Closure $func): static;", "public function xapply() {\n\t\t//\n\t\tdefine ( '_BF_APPLY', true );\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\tif ($args ['view'] == 'formconfiguration') {\n\t\t\t$this->_redirect ( 'xsaveformconfig' );\n\t\t} elseif ($args ['view'] == 'fields') {\n\t\t\tparent::xapply ( $args );\n\t\t} elseif ($args ['view'] == 'actions') {\n\t\t\tparent::xapply ( $args );\n\t\t} elseif ($args ['view'] == 'edit_formlayout') {\n\t\t\t$this->_redirect ( 'xsaveformlayout' );\n\t\t} else {\n\t\t\tparent::xapply ( $args );\n\t\t}\n\t\t$this->registry->setValue ( 'usedTabs', 1 );\n\t\n\t}", "public function isApplied();", "public function compute(\\SplStack $stack);", "public function apply($query)\n {\n // return $query->where('id', 1);\n }", "public function apply($a)\n {\n return $a->fmap($this->heldValue);\n }", "public function __invoke()\n {\n }", "public function applyFunction(string $functionName, ...$args): ICollection;", "public function reduce($fn) {\n $self = $this;\n $fnApply = static function($initialValue, $values) use ($self, $fn) {\n return $self->apply($values)->reduce($initialValue, $fn);\n };\n return $fnApply;\n }", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "public function inOriginal();", "function intermediate() {}", "private function applyCriteria()\n {\n foreach( $this->criteria as $criterion )\n {\n $this->query = $criterion->apply( $this->query, $this );\n }\n\n return $this;\n }", "public function __invoke( \\Traversable $iterator )\n {\n\n $current = ($iterator instanceOf \\IteratorAggregate)\n ? $iterator->getIterator()->current()\n : $iterator->current();\n\n // Perform\n $apply = $this->apply;\n $apply( $current );\n\n // Must return true for iterator_apply\n return true;\n }", "public function apply(callable $callable)\n {\n $this->values = array_map($callable, $this->values);\n\n return $this;\n }", "public function aggregate(): void;", "protected function applyWidth()\n {\n }", "protected function postApply(): void {\n\t\t// re-register events\n\t\telgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Rules::applyRules', 1);\n\t\telgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Enqueue::createMetadata');\n\t}", "public function perform();", "static function apply($array,$callback,$parameters = []){\n\t\t$parameters = (array)$parameters;\n\t\t$newArray = [];\n\t\tforeach($array as $k=>$v){\n\t\t\t$newArray[$k] = call_user_func_array($callback,array_merge([$k,$v],$parameters));\n\t\t}\n\t\treturn $newArray;\n\t}", "protected function _applyDateRangeFilter() {\r\n return $this;\r\n }", "function run($obj){\n\t\treturn $this->pipe->reduce(function ($res, $item){\n\t\t\treturn $item($res);\n\t\t}, $obj);\n\t}" ]
[ "0.84559315", "0.835797", "0.835797", "0.65540826", "0.65387034", "0.6433934", "0.6427539", "0.64059186", "0.6275572", "0.60727775", "0.6065891", "0.58763844", "0.5818278", "0.57856965", "0.57257915", "0.55958694", "0.55818814", "0.5566615", "0.55659807", "0.55254596", "0.55232954", "0.5499143", "0.54800344", "0.5420629", "0.54114676", "0.5402962", "0.5335257", "0.53252447", "0.53041536", "0.52945876", "0.52945876", "0.52945876", "0.5269763", "0.52154213", "0.518505", "0.5177297", "0.5161184", "0.5147335", "0.51413524", "0.51007277", "0.50976914", "0.50636584", "0.5001951", "0.5001951", "0.49476108", "0.4934155", "0.4930153", "0.49219465", "0.49204683", "0.49197394", "0.491709", "0.49148703", "0.49038273", "0.4883708", "0.4873851", "0.48640114", "0.48567712", "0.48155576", "0.48107758", "0.47843298", "0.47371206", "0.47306153", "0.47297823", "0.46991822", "0.46872562", "0.46672228", "0.46562397", "0.46519405", "0.46519405", "0.46434137", "0.46429083", "0.4628991", "0.4616859", "0.46143883", "0.46096402", "0.45971003", "0.45949203", "0.45928845", "0.45923018", "0.45868626", "0.45867372", "0.4580779", "0.4570547", "0.455569", "0.45390907", "0.45327508", "0.45327508", "0.45327508", "0.45327508", "0.45231074", "0.45213297", "0.4519026", "0.4502726", "0.44961804", "0.4494792", "0.44871217", "0.44856456", "0.44795406", "0.4474673", "0.4473732", "0.44701836" ]
0.0
-1
Gets movie information by a string
public function getByString($movie){ $url = "http://www.omdbapi.com/?t=".urlencode($movie)."&y=&plot=short&r=json"; if($json = file_get_contents($url)){ $info = json_decode($json); if(isset($info->Title) && $info->Title !=''){ return $info->Title."(".$info->Year.") - Rating ".$info->imdbRating." - http://www.imdb.com/title/".$info->imdbID."/"; }else{ return 'Couldn\'t find this movie'; } }else{ return 'Could not connect.'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMovieInformation($movie)\n{\n if($movie != \"\") {\n $OMDB_API_KEY = '99842c57';\n $omdbUrl = \"http://www.omdbapi.com?s=$movie&apikey=$OMDB_API_KEY&type=movie\";\n $movie = file_get_contents($omdbUrl);\n\n $movieDetails =json_decode($movie, true);\n\n \n if(count($movieDetails['Search'])) {\n $movieList = $movieDetails['Search'];\n // Pick the first movie\n $movie = $movieList[0];\n $movieTitle = $movie[\"Title\"];\n $movieYear = $movie[\"Year\"];\n $moviePoster = $movie[\"Poster\"];\n\n sendFulfillmentResponse($movieTitle, $movieYear, $moviePoster, true);\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n } else {\n sendFulfillmentResponse(null, null, null, false);\n }\n \n}", "function gatherMovieInfo($moviefile, $moviedbid)\n\t{\n\t\t$movieinfo['filepath'] = $moviefile;\n\t\t$movieinfo['moviedbid'] = $moviedbid;\n\n\t\t\n\t\tif ($moviedbid == \"0\") {\n\t\t\t//\n\t\t\t// adding as a custom movie with no moviedb link. Like a home movie.\n\t\t\t//\n\t\t\t$info = pathinfo($moviefile);\n\t\t\t$title = basename($moviefile,'.'.$info['extension']);\n\t\t\t\n\t\t\t$movieinfo['title'] = $title;\n\t\t\t$movieinfo['original_title'] = $title;\n\t\t\t$movieinfo['genres'] = 'Home Movies';\n\t\t}\n\t\telse\n\t\t{\n\t\t\n\t\t\t// get runtime from file\n\t\t\t$meta= new getID3();\n\t\t\t$file = $meta->analyze($moviefile);\n\t\t\t$duration = $file['playtime_seconds'];\n\t\t\t$movieinfo['duration'] = round($duration / 60);\n\n\t\t\t$moviedbinfo = getAPI3Result(\"movie/\" . $moviedbid, \"append_to_response=casts,releases,images\");\n\n\t//\t\t$movieinfo['duration'] = $moviedbinfo['runtime'];\n\t\t\t$movieinfo['title'] = $moviedbinfo['title'];\n\t\t\t$movieinfo['imdbid'] = $moviedbinfo['imdb_id'];\n\t\t\t$movieinfo['original_title'] = $moviedbinfo['original_title'];\n\t\t\t$movieinfo['year'] = substr($moviedbinfo['release_date'],0,4);\n\t\t\t$movieinfo['mpaa'] = getUSRating($moviedbinfo);\n\t\t\t$movieinfo['director'] = getDirector($moviedbinfo);\n\t\t\t$movieinfo['writers'] = getWriters($moviedbinfo);\n\t\t\t$movieinfo['tagline'] = $moviedbinfo['tagline'];\n\t\t\t$movieinfo['genres'] = getGenres($moviedbinfo);\n\t\t\t$movieinfo['overview'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['plot'] = $moviedbinfo['overview'];\n\t\t\t$movieinfo['actors'] = getActors($moviedbinfo);\n\t\t\t$movieinfo['moviedbruntime'] = $moviedbinfo['runtime'];\n\n\t\t\t$config = getAPI3Result(\"configuration\");\n\n\t\t\t// get the thumbnails\n\t\t\t$thumbnails = \"\";\n\t\t\tforeach($moviedbinfo['images'][\"posters\"] as $poster) {\n\t\t\t\t$fullpath = $config['images']['base_url'] . \"original\" . $poster['file_path'];\n\t\t\t\tif (empty($movieinfo['thumb'])) $movieinfo['thumb'] = $fullpath;\n\t\t\t\t$thumbnails .= \"<thumb>\" . $fullpath . \"</thumb>\";\n\t\t\t}\t\t\t\t\n\t\t\t$movieinfo['allthumbs'] = $thumbnails;\n\t\t}\n\t\t\n\t\treturn $movieinfo;\n\n\t}", "public function getMovieInfo($idMovie, $option = '', $append_request = ''){\n\t\t$option = (empty($option)) ? '' : '/' . $option;\n\t\t$params = 'movie/' . $idMovie . $option;\n\t\t$result = $this->_call($params, $append_request);\n\t\t\t\n\t\treturn $result;\n\t}", "public function doMovieSearch()\n {\n if ( !preg_match( \"/^(.*)(19|20)[0-9]{2}/\", $this->Release, $matches ) )\n {\n $variables = array( 'status' => 'ko', 'message' => 'unable to extract the movie name' );\n }\n else\n {\n $movieTitle = $matches[1];\n\n $scraper = new MkvManagerScraperSubsynchro();\n $movies = array_map(\n function( $movie ) {\n $movie['id'] = str_replace( array( '/', '.' ), array( '|', '~' ), $movie['id'] );\n return $movie;\n },\n $scraper->searchMovies( $movieTitle )\n );\n\n $variables = array( 'status' => 'ok', 'movies' => $movies );\n }\n\n $result = new ezcMvcResult();\n $result->variables += $variables;\n\n return $result;\n }", "public function movies()\n\t{\n\t\tif (preg_match('/^([a-z].+) - \\[\\d+\\/\\d+\\][ _-]{0,3}(\"|#34;).+(\"|#34;) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} ///^Have Fun - (\"|#34;)(.+)\\.nfo(\"|#34;) Ph4let0ast3r yEnc$/i\n\t\tif (preg_match('/^Have Fun - (\"|#34;)(.+)\\.nfo(\"|#34;) Ph4let0ast3r yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(01/34) \"Sniper.Reloaded.2011.BluRay.810p.DTS.x264-PRoDJi.Turkish.Audio.par2\" - 139,30 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) (\"|#34;)(.+)\\.(par2|nfo|rar|nzb)(\"|#34;) - \\d+[.,]\\d+ [kKmMgG][bB] - yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //\"Discovery.Channel.Tsunami.Facing.The.Wave.720p.HDTV.x264-PiX.rar\"\n\t\tif (preg_match('/^(\"|#34;)(.+)\\.rar(\"|#34;)$/i', $this->subject, $match)) {\n\t\t\treturn $match[2];\n\t\t} //Saw.VII.2010.720p.Bluray.x264.DTS-HDChina Saw.VII.2010.720p.Bluray.x264.DTS-HDChina.nzb\n\t\tif (preg_match('/^([a-z].+) .+\\.(par2|nfo|rar|nzb)$/i', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(????) [1/1] - \"The Secret Life of Walter Mitty 2013 CAM AAC x264-SSDD.mp4\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(001/114) - Description - \"The.Chronicles.of.Riddick.2004.DC.BluRay.1080p.DTS.par2\" - 10,50 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}Description[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[00/56] - \"The.Last.Days.On.Mars.720p.BluRay.x264-DR.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[REUP] 6.Degress.of.Hell.2012.1080p.BluRay.DTS-HD.x264-BARC0DE - [03/50] - \"BARC0DE.vol00+1.PAR2\" yEnc\n\t\t//[REUP]Home.Of.The.Brave.2006.1080p.BluRay.DTS-HD.x264-BARC0DE - [03/38] - \"BARC0DE.vol00+1.PAR2\" yEnc\n\t\tif (preg_match('/^\\[REUP\\]( )?(.+?) - \\[\\d+\\/\\d+\\] - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //- Description - \"The.Legend.of.Hercules.2014.720p.BluRay.x264.YIFY.mp4.01\" - 795,28 MB - yEnc\n\t\tif (preg_match('/^- Description - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])[- ]{0,4}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Star.Trek.Into.Darkness.2013.3D.HOU.BDRip.1080p-FAGGOTS [431/432] - \"stid3d.vol124+128.par2\" yEnc\n\t\tif (preg_match('/^([\\w.()-]{8,}?)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(130/138) - Captain America The Winter Soldier 2014 NEW (FIXED) 720p CAM x264 Pimp4003 - \"wXZ6LxFt.zip.130\" - 2.02 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}([\\w.() -]{8,}?\\b)[-_\\s]{0,3}\".+?' . $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //22.Jump.Street.2014.720p.BluRay.x264-tpU.vol000+01.PAR2 [73/84] - \"22.Jump.Street.2014.720p.BluRay.x264-tpU.vol000+01.PAR2\" yEnc\n\t\tif (preg_match('/^.+\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function getMovieDetails() {\n\t\t\t$url = \"http://api.brightcove.com/services/library?command=find_video_by_reference_id&media_delivery=http&reference_id=\".$this->getMovieID() .\"&video_fields=name,renditions&token=Ekg-LmhL4QrFPEdtjwJlyX2Zi4l6mgdiPnWGP0bKIyKKT_94PTKHrw..\";\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$jsonResponse = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$result = json_decode($jsonResponse);\n\t\treturn $result->renditions;\n\t}", "function getSingleMovie($title, $vote_average, $overview, $releaseDate, $genres, $peer_id, $keyboard)\r\n{\r\n $movieGenres = '';\r\n\r\n foreach ($genres as $genre) {\r\n $movieGenres .= localizeGenreID($genre) . ', ';\r\n }\r\n $movieGenres = rtrim($movieGenres, ', ');\r\n if ($overview !== '') {\r\n $message = $title . '<br>' .\r\n 'Жанры: ' . $movieGenres . '<br>' .\r\n 'Оценка: ' . $vote_average . '<br>' .\r\n 'Дата выхода: ' . $releaseDate . '<br>' .\r\n 'Описание: ' . $overview;\r\n } else {\r\n $message = $title . '<br>' .\r\n 'Жанры: ' . $movieGenres . '<br>' .\r\n 'Оценка: ' . $vote_average . '<br>' .\r\n 'Дата выхода: ' . $releaseDate . '<br>';\r\n }\r\n\r\n request($message, $peer_id, $keyboard, '');\r\n}", "function get_movies( $query )\n{\n log_error('get_movies');\n $html = get_html($query);\n\n $results = array();\n\n foreach($html->find('#movie_results .theater') as $div) {\n log_error('found a theatre');\n $result = array();\n\n //$theatre_id = $div->find('h2 a',0)->getAttribute('href');\n $theatre_info = $div->find('.info',0)->innertext;\n\n //$result['theatre_id'] = substr( $theatre_id, (strrpos($theatre_id, 'tid=')+4) );\n $result['theatre_name'] = $div->find('.name',0)->innertext;\n\n $pos_info = strrpos( $theatre_info, '<a');\n if( $pos_info !== false )\n $result['theatre_info'] = substr( $theatre_info, 0, strrpos( $theatre_info, '<a'));\n else\n $result['theatre_info'] = $theatre_info;\n\n $result['movies'] = array();\n foreach($div->find('.movie') as $movie) {\n log_error('found a movie - '.$movie->find('.name a',0)->innertext);\n\n $movie_id = $movie->find('.name a',0)->getAttribute('href');\n $movie_id = substr( $movie_id, (strrpos($movie_id, 'mid=')+4) );\n\n log_error('obtained movie_id: '.$movie_id);\n\n $info_raw = $movie->find('.info',0)->innertext;\n $pos = strpos($info_raw, ' - <a');\n\n if( $pos !== false ){\n $info = substr( $info_raw, 0, $pos);\n\n $trailer = urldecode($movie->find('.info a', 0)->getAttribute('href'));\n $trailer = substr($trailer, 7);\n $trailer = substr($trailer, 0, strpos($trailer, '&'));\n }\n else {\n $trailer = '';\n }\n\n // showtimes\n $times = array();\n // echo 'movie: '.$movie->find('.name a',0)->innertext.'<br>';\n // echo $movie->find('.times',0)->childNodes(0);\n foreach($movie->find('.times > span') as $time) {\n // echo 'time: '.$time->innertext.'<br>';\n // echo 'attr: '.$time->getAttribute('style').'<br>';\n\n if( trim($time->getAttribute('style')) != 'padding:0' )\n {\n $time_strip = strip_tags($time->innertext);\n $time_strip = str_replace('&nbsp', '', $time_strip);\n $time_strip = str_replace(' ', '', $time_strip);\n //$time_strip = html_entity_decode($time_strip);\n //echo 'a:'.$time_strip.'<br>';\n /*$pos_time = false;\n $pos_time = strrpos($time->innertext, '-->');\n if( $pos_time !== false ){\n $showtime = substr($time->innertext, $pos_time+3);\n //echo $showtime.'<br>';\n }*/\n //echo $time;\n array_push( $times, $time_strip );\n }\n }\n\n array_push($result['movies'], array(\n 'id' => $movie_id,\n 'name' => $movie->find('.name a',0)->innertext,\n 'info' => $info, // (does <a> exist) ? (yes) : (no)\n 'time' => $times,\n 'trailer' => $trailer\n ));\n }\n\n $results[] = $result;\n }\n\n return $results;\n}", "function getSubtitleInfo($fileName) {\n\n $subtitleInfo = array();\n\n try {\n $url = \"http://www.opensubtitles.org/sv/search/sublanguageid-swe/moviename-\";\n $urlReadyName = urlencode(str_replace(\".mp4\", \"\", $fileName));\n $return = $this->controller->http->call($url.$urlReadyName, array(), \"GET\", \"\");\n\n preg_match_all(\"/servOC\\(([0-9]+),\\'\\/\\w+\\/\\w+\\/[0-9]+\\/([a-z-]+)\\/[a-z-]+\\',/\", $return['content'], $result);\n foreach ($result[1] as $key => $value) {\n $subtitleInfo[] = array($value, $result[2][$key]);\n }\n } catch (Exception $e) { return $subtitleInfo; }\n return $subtitleInfo;\n }", "public function genre()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" genre ?\");\n\t}", "function gatherMovieInfoFromPost( $params ) \n\t{\n\t\tif (!empty($params['localdbid']))\n\t\t\t$movieinfo['localdbid'] = $params['localdbid'];\n\t\t$movieinfo['filepath'] = $params['filepath'];\n\t\t$movieinfo['duration'] = $params['duration'];\n\t\t$movieinfo['title'] = $params['title'];\n\t\t$movieinfo['imdbid'] = $params['imdbid'];\n\t\t$movieinfo['original_title'] = $params['original_title'];\n\t\t$movieinfo['year'] = $params['year'];\n\t\t$movieinfo['mpaa'] = $params['mpaa'];\n\t\t$movieinfo['director'] = $params['director'];\n\t\t$movieinfo['writers'] = $params['writers'];\n\t\t$movieinfo['tagline'] = $params['tagline'];\n\t\t$movieinfo['genres'] = $params['genres'];\n\t\t$movieinfo['overview'] = $params['overview'];\n\t\t$movieinfo['plot'] = $params['overview'];\n\t\t$movieinfo['actors'] = $params['actors'];\n\t\t$movieinfo['thumb'] = isset($params['thumb']) ? urldecode($params['thumb']) : '';\n\t\t$movieinfo['allthumbs'] = urldecode($params['allthumbs']);\n\n\t\treturn $movieinfo;\n\t}", "public function retrieveMovie($args=[]){\n\t\t#ID argument: if not set, fallback to 0\n\t\t$id = $args[\"id\"] ?? 0;\n\t\t#If no ID given, return error\n\t\tif(!$id) return [\"success\" => 0, \"msg\" => \"Empty response from TMDb\"];\n\t\t#Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-movie-details)\n\t\t$url = \"https://api.themoviedb.org/3/movie/{$id}?api_key={$this->apiKey}&language={$this->requestLang}\";\n\t\t#Instantiate a new HTTP handler class\n\t\t$HttpHandler = new HttpHandler();\n\t\t#Retrieve raw output from the HTTP handler over the URL\n\t\t$outputRaw = $HttpHandler->execGET($url);\n\t\t#Bypass the consumed output\n\t\treturn $this->consumeRawOutput($outputRaw);\n\t}", "function get_media_info( $video ){\n $media_infos = array( ); $content = shell_exec( 'mediainfo \"' . $video . '\"' ); $xx = explode( \"\\n\\n\", $content );\n\n foreach ( $xx as $data ){$infos = explode( \"\\n\", $data ); $media_type = '';\n foreach ( $infos as $key => $val ){@list($k, $v, $e) = explode( \":\", $val );\n if ( empty( $v ) ){$media_type = $k;}\n else{\n $media_key = str_replace( array( ' ' ), '_', trim( strtolower( $k ) ) );\n $media_value = trim( $v );\n if ( !empty( $e ) )$media_value .= \":$e\"; $media_infos[$media_type][$media_key] = $media_value;\n }\n }\n }return $media_infos;\n}", "public function show(movie $movie)\n {\n //\n }", "public function show(movie $movie)\n {\n //\n }", "public function dvd_movies()\n\t{\n\t\tif (preg_match('/^Skata - (.+) \\(\\d+ \\/ \\d+\\) - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(????) [02361/43619] - \"18j Amy-superlange Beine.exe\" yEnc\n\t\tif (preg_match('/\\(\\?+\\) \\[\\d+\\/\\d+\\] - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Mutant.Chronicles.German.2008.AC3.DVDRip.XviD.(01/40) \"Mutant.Chronicles.German.2008.AC3.DVDRip.XviD.nfo\" yEnc\n\t\tif (preg_match('/.*\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function gatherMovieInfoFromLocal( $db, $localdbid ) \n\t{\n\t\t$movie = $db->querySingle($select = \"SELECT * FROM movieview WHERE idMovie='\" . $localdbid . \"'\", true);\n\n\t\t$movieinfo['localdbid'] = $localdbid;\n\t\tif ($movie)\n\t\t{\n\t\t\t$movieinfo['filepath'] = $movie['strPath'] . $movie['strFileName'];\n\t\t\t$movieinfo['duration'] = $movie['c11'];\n\t\t\t$movieinfo['title'] = $movie['c00'];\n\t\t\t$movieinfo['imdbid'] = $movie['c09'];\n\t\t\t$movieinfo['original_title'] = $movie['c16'];\n\t\t\t$movieinfo['year'] = $movie['c07'];\n\t\t\t$movieinfo['mpaa'] = $movie['c12'];\n\t\t\t$movieinfo['director'] = $movie['c15'];\n\t\t\t$movieinfo['writers'] = $movie['c06'];\n\t\t\t$movieinfo['tagline'] = $movie['c03'];\n\t\t\t$movieinfo['genres'] = $movie['c14'];\n\t\t\t$movieinfo['overview'] = $movie['c01'];\n\t\t\t$movieinfo['plot'] = $movie['c02'];\n\t\t\t$movieinfo['allthumbs'] = $movie['c08'];\n\t\t\t\n\n\t\t\tif (preg_match('/\\<thumb\\>(?P<thumb>.*)\\<\\/thumb\\>/', $movieinfo['allthumbs'], $matches)) {\n\t\t\t\t$movieinfo['thumb'] = $matches['thumb'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$movieinfo['thumb'] = '';\n\t\t\t}\n\t\n\t\t\t$actors = $db->query(\"SELECT * FROM actorlinkmovie JOIN actors ON actorlinkmovie.idActor=actors.idActor WHERE idMovie='\" . $localdbid . \"'\");\n\t\t\t$movieinfo['actors'] = \"\";\n\t\t\twhile ($actor = $actors->fetchArray()) {\n\t\t\t\tif (!empty($movieinfo['actors'] )) $movieinfo['actors'] .= \" /\\n\";\n\t\t\t\t$movieinfo['actors'] .= $actor['strActor'] . \" AS \" . $actor['strRole'];\n\t\t\t}\n\t\t\t$actors->finalize();\n\t\t}\n\n\n\t\treturn $movieinfo;\n\t}", "public function search_movie_by_imdb_id($id, $type = 'imdb') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['type'] = $type;\n $params['id'] = $id;\n return $this->call('movie_alias/' . $format, $params, 'GET');\n }", "function get_movie($id)\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT DateTime, video, user.name as author,\n\t\t\t\t\t\tmovie.name as title, text\n\t\t\t\t\t\tFROM movie, movie_category, user\n\t\t\t\t\t\tWHERE movie.userID = user.userID \n\t\t\t\t\t\tAND movie.movieID = :id\");\n\t$stmt->execute(array(':id' => $id));\n\t$movie = $stmt->fetchAll(PDO::FETCH_ASSOC);\n close_database_connection($db);\n return $movie[0];\n}", "function getMovieDB($webtmdb, $mid){\n $url = $webtmdb;\n\n if(!$curld = curl_init()){\n exit;\n }\n curl_setopt($curld, CURLOPT_URL, $url); //loads information from url, in our case a json \n curl_setopt($curld, CURLOPT_RETURNTRANSFER, true); //ends transfer \n $prepros = curl_exec($curld); //executes setopt we set previosly \n curl_close($curld); //close connection \n $json = json_decode($prepros, true); // decode json file we got from API\n //\n /*\n make a table \n original_title - movie name \n https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'] - poster image on a page \n */\n //\n $output = \"<style>th,td{padding: 15px;text-align: left; border-bottom: 1px solid #ddd;}</style><tr><th><a href='tmdb.php/?movieId=\".$mid.\"'>\".$json['original_title'].\"</a></th></tr><tr><img height='200' src='https://www.themoviedb.org/t/p/w300_and_h450_bestv2/\".$json['poster_path'].\"'></tr>\";\n return $output;\n}", "public function get_movie($movie_id) {\n\t\t\n\t\t$tmpl_args = array (\n\t\t\t\"movie-id\" => $movie_id\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_MOVIE, $tmpl_args);\n\t\t\t\t\n\t\tif(isset($json->id) and !empty($json->id)) {\n\t\t\treturn new rt_movie($json, $this);\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t}", "public function search_url($url){\n\n\n //Fetch the movie info\n $json = file_get_contents($url);\n\n //Convert json to array\n $array = json_decode($json);\n\n //Get rid of episode list before var_dumping\n //unset($array[0]->episodes);\n\n //Debug\n /*\n echo '<pre>';\n var_dump($array);\n echo '</pre>';\n */\n\n //Setup the video abstraction layer\n $test = new abstract_media;\n\n //Setup output buffering\n ob_start();\n\n //Echo the results\n if(isset($array[0])){\n if(isset($array[0]->poster->cover)){\n echo '<img src=\"'.$array[0]->poster->cover.'\" /><br />';\n $test->cover = $array[0]->poster->cover;\n }\n\n if(isset($array[0]->title)){\n echo 'Title: '.$array[0]->title.\"<br /> \\r\\n\";\n $test->title = $array[0]->title;\n }\n\n if(isset($array[0]->plot_simple)){\n echo 'Plot: '.$array[0]->plot_simple.\"<br /> \\r\\n\";\n $test->plot_simple = $array[0]->plot_simple;\n }\n\n if(isset($array[0]->year)){\n echo 'Year: '.$array[0]->year.\"<br /> \\r\\n\";\n $test->year = $array[0]->year;\n }\n\n if(isset($array[0]->rated)){\n echo 'Rated: '.$array[0]->rated.\"<br /> \\r\\n\";\n $test->rated = $array[0]->rated;\n }\n\n if(isset($array[0]->rating)){\n echo 'Rating: '.$array[0]->rating.\"<br /> \\r\\n\";\n $test->rating = $array[0]->rating;\n }\n\n if(isset($array[0]->runtime)){\n echo 'Runtime(s): '.implode(', ', $array[0]->runtime).\"<br /> \\r\\n\";\n $test->runtime = $array[0]->runtime;\n }\n\n if(isset($array[0]->genres)){\n echo 'Genre(s): '.implode(', ', $array[0]->genres).\"<br /> \\r\\n\";\n $test->genres = $array[0]->genres;\n }\n\n if(isset($array[0]->language)){\n echo 'Language(s): '.implode(', ', $array[0]->language).\"<br /> \\r\\n\";\n $test->language = $array[0]->language;\n }\n\n if(isset($array[0]->country)){\n echo 'Country(s): '.implode(', ', $array[0]->country).\"<br /> \\r\\n\";\n $test->country = $array[0]->country;\n }\n\n if(isset($array[0]->actors)){\n echo 'Actors: '.implode(', ', $array[0]->actors).\"<br /> \\r\\n\";\n $test->actors = $array[0]->actors;\n }\n\n if(isset($array[0]->directors)){\n echo 'Director(s): '.implode(', ', $array[0]->directors).\"<br /> \\r\\n\";\n $test->directors = $array[0]->directors;\n }\n\n if(isset($array[0]->writers)){\n echo 'Writer(s): '.implode(', ', $array[0]->writers).\"<br /> \\r\\n\";\n $test->writers = $array[0]->writers;\n }\n\n if(isset($array[0]->filming_locations)){\n echo 'Filming Location(s): '.$array[0]->filming_locations.\"<br /> \\r\\n\"; //This is output as a string for some reason\n $test->filming_locations = $array[0]->filming_locations;\n }\n\n if(isset($array[0]->imdb_id)){\n echo 'IMDb id: '.$array[0]->imdb_id.\"<br /> \\r\\n\";\n $test->ibdb_id = $array[0]->imdb_id;\n }\n }\n\n //Save the output buffer contents in the output variable\n $test->output = ob_get_contents();\n ob_end_clean();\n\n //Return the abstract video object\n return $test;\n }", "public function getFilmInfo($day)\n\t{\n\n\t\tswitch ($day->getName())\n\t\t{\n\t\t\tcase 'Friday':\n\t\t\t\t$day =\"01\";\n\t\t\t\tbreak;\n\t\t\tcase 'Saturday':\n\t\t\t\t$day =\"02\";\n\t\t\t\tbreak;\n\t\t\tcase 'Sunday':\n\t\t\t\t$day =\"03\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//TODO : Do something.\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$url =$this->cinemaLink;\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//Get all selects of movie exc. disabled w text instruction.\n\t\t$query = \"//select[@id ='movie']/option[not(text() = '--- Välj film ---')]\";\n\t\t$select = $this->curl->getDOMData($data,$query);\t\n\t\t\n\t\t//\n\n\t\t//Get the number of movies\n\t\t$numberOfMovies = $select->length;\n\t\t\n\t\t//add date query to the URL\n\t\t$url .=\"check?day=\".$day;\n\t\t/* Iterate through all movies, add them to url, get\n\t\t* and extract times \n\t\t*/\n\t\t$movieTimeRepository = new availableTimeRepository();\n\n\t\tfor($i =1; $i < $numberOfMovies+1; $i++)\n\t\t{\n\t\t\t//get the name of the movie\n\t\t\t$movieName = $select[$i-1]->nodeValue;\n\t\t\t//create a new movieTime object\n\t\t\t$movieTime = new availableTime($movieName);\n\t\t\t//get the times and availability for each movie\n\t\t\t//example of URL with movieQuery: http://localhost:8080/cinema/check?day=02&movie=01\n\t\t\t$movieQuery= ($i <10)? \"&movie=0\".$i: \"&movie=\".$i;\n\t\t\t$data = $this->curl->curlGetReq($url.$movieQuery);\n\t\t\t//decode it and iterate the data\n\t\t\t$movieData =json_decode($data,true);\n\t\t\t\n\t\t\tforeach ($movieData as $movieInfo)\n\t\t\t{\t\n\t\t\t\t//if the status ==1 ==true,it's available\n\t\t\t\tif($movieInfo['status'])\n\t\t\t\t{\t//save the available time to corresponding movie obj.\n\t\t\t\t\t$movieTime->addTime($movieInfo['time']);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$movieTimeRepository->add($movieTime);\n\n\n\t\t}\t\t\n\t\n\t\treturn $movieTimeRepository;\n\t\t\n\t}", "public function getById($id)\n {\n return \\App\\Movie::findOrFail($id)->load('genre');\n }", "public function getById($id)\n {\n $searchUrl = $this->apiUrl.$this->apiKey.\"/movie/\".$id.\"/\";\n $searchResponse = file_get_contents($searchUrl);\n $searchObj = json_decode($searchResponse, true);\n\n return $searchObj;\n }", "public function updateXXXInfo($xxxmovie)\n\t{\n\n\t\t$res = false;\n\t\t$this->whichclass = '';\n\n\t\t$iafd = new \\IAFD();\n\t\t$iafd->searchTerm = $xxxmovie;\n\n\t\tif ($iafd->findme() !== false) {\n\n\t\t\tswitch($iafd->classUsed) {\n\t\t\t\tcase \"ade\":\n\t\t\t\t\t$mov = new \\ADE();\n\t\t\t\t\t$mov->directLink = (string)$iafd->directUrl;\n\t\t\t\t\t$res = $mov->getDirect();\n\t\t\t\t\t$res['title'] = $iafd->title;\n\t\t\t\t\t$res['directurl'] = (string)$iafd->directUrl;\n\t\t\t\t\t$this->whichclass = $iafd->classUsed;\n\t\t\t\t\t$this->pdo->log->doEcho($this->pdo->log->primary(\"Fetching XXX info from IAFD -> Adult DVD Empire\"));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($res === false) {\n\n\t\t\t$this->whichclass = \"aebn\";\n\t\t\t$mov = new \\AEBN();\n\t\t\t$mov->cookie = $this->cookie;\n\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t$res = $mov->search();\n\n\t\t\tif ($res === false) {\n\t\t\t\t$this->whichclass = \"ade\";\n\t\t\t\t$mov = new \\ADE();\n\t\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t\t$res = $mov->search();\n\t\t\t}\n\n\t\t\tif ($res === false) {\n\t\t\t\t$this->whichclass = \"pop\";\n\t\t\t\t$mov = new \\Popporn();\n\t\t\t\t$mov->cookie = $this->cookie;\n\t\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t\t$res = $mov->search();\n\t\t\t}\n\n\t\t\t// Last in list as it doesn't have trailers\n\t\t\tif ($res === false) {\n\t\t\t\t$this->whichclass = \"adm\";\n\t\t\t\t$mov = new \\ADM();\n\t\t\t\t$mov->cookie = $this->cookie;\n\t\t\t\t$mov->searchTerm = $xxxmovie;\n\t\t\t\t$res = $mov->search();\n\t\t\t}\n\n\n\t\t\t// If a result is true getAll information.\n\t\t\tif ($res !== false) {\n\t\t\t\tif ($this->echooutput) {\n\n\t\t\t\t\tswitch ($this->whichclass) {\n\t\t\t\t\t\tcase \"aebn\":\n\t\t\t\t\t\t\t$fromstr = \"Adult Entertainment Broadcast Network\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ade\":\n\t\t\t\t\t\t\t$fromstr = \"Adult DVD Empire\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"pop\":\n\t\t\t\t\t\t\t$fromstr = \"PopPorn\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"adm\":\n\t\t\t\t\t\t\t$fromstr = \"Adult DVD Marketplace\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$fromstr = null;\n\t\t\t\t\t}\n\t\t\t\t\t$this->pdo->log->doEcho($this->pdo->log->primary(\"Fetching XXX info from: \" . $fromstr));\n\t\t\t\t}\n\t\t\t\t$res = $mov->getAll();\n\t\t\t} else {\n\t\t\t\t// Nothing was found, go ahead and set to -2\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t}\n\n\t\t$mov = array();\n\n\t\t$mov['trailers'] = (isset($res['trailers'])) ? serialize($res['trailers']) : '';\n\t\t$mov['extras'] = (isset($res['extras'])) ? serialize($res['extras']) : '';\n\t\t$mov['productinfo'] = (isset($res['productinfo'])) ? serialize($res['productinfo']) : '';\n\t\t$mov['backdrop'] = (isset($res['backcover'])) ? $res['backcover'] : 0;\n\t\t$mov['cover'] = (isset($res['boxcover'])) ? $res['boxcover'] : 0;\n\t\t$res['cast'] = (isset($res['cast'])) ? join(\",\", $res['cast']) : '';\n\t\t$res['genres'] = (isset($res['genres'])) ? $this->getgenreid($res['genres']) : '';\n\t\t$mov['title'] = html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['plot'] = (isset($res['sypnosis'])) ? html_entity_decode($res['sypnosis'], ENT_QUOTES, 'UTF-8') : '';\n\t\t$mov['tagline'] = (isset($res['tagline'])) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '';\n\t\t$mov['genre'] = html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['director'] = (isset($res['director'])) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '';\n\t\t$mov['actors'] = html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['directurl'] = html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8');\n\t\t$mov['classused'] = $this->whichclass;\n\n\t\t$check = $this->pdo->queryOneRow(sprintf('SELECT id FROM xxxinfo WHERE title = %s',\t$this->pdo->escapeString($mov['title'])));\n\t\t$xxxID = 0;\n\t\tif(isset($check['id'])){\n\t\t$xxxID = $check['id'];\n\t\t}\n\n\t\tif($check === false OR $xxxID > 0){\n\n\t\t// Update Current XXX Information - getXXXCovers.php\n\t\tif($xxxID > 0){\n\t\t\t$this->update($check['id'], $mov['title'], $mov['tagline'], $mov['plot'], $mov['genre'], $mov['director'], $mov['actors'], $mov['extras'], $mov['productinfo'], $mov['trailers'], $mov['directurl'], $mov['classused']);\n\t\t\t$xxxID = $check['id'];\n\t\t}\n\n\t\t// Insert New XXX Information\n\t\tif($check === false){\n\t\t\t$xxxID = $this->pdo->queryInsert(\n\t\t\t\tsprintf(\"\n\t\t\t\t\tINSERT INTO xxxinfo\n\t\t\t\t\t\t(title, tagline, plot, genre, director, actors, extras, productinfo, trailers, directurl, classused, cover, backdrop, createddate, updateddate)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(%s, %s, COMPRESS(%s), %s, %s, %s, %s, %s, %s, %s, %s, 0, 0, NOW(), NOW())\",\n\t\t\t\t\t$this->pdo->escapeString($mov['title']),\n\t\t\t\t\t$this->pdo->escapeString($mov['tagline']),\n\t\t\t\t\t$this->pdo->escapeString($mov['plot']),\n\t\t\t\t\t$this->pdo->escapeString(substr($mov['genre'], 0, 64)),\n\t\t\t\t\t$this->pdo->escapeString($mov['director']),\n\t\t\t\t\t$this->pdo->escapeString($mov['actors']),\n\t\t\t\t\t$this->pdo->escapeString($mov['extras']),\n\t\t\t\t\t$this->pdo->escapeString($mov['productinfo']),\n\t\t\t\t\t$this->pdo->escapeString($mov['trailers']),\n\t\t\t\t\t$this->pdo->escapeString($mov['directurl']),\n\t\t\t\t\t$this->pdo->escapeString($mov['classused'])\n\t\t\t\t)\n\t\t\t);\n\t\t\t}\n\n\t\t\tif ($xxxID > 0) {\n\n\t\t\t\t// BoxCover.\n\t\t\t\tif (isset($mov['cover'])) {\n\t\t\t\t\t$mov['cover'] = $this->releaseImage->saveImage($xxxID . '-cover', $mov['cover'], $this->imgSavePath);\n\t\t\t\t}\n\n\t\t\t\t// BackCover.\n\t\t\t\tif (isset($mov['backdrop'])) {\n\t\t\t\t\t$mov['backdrop'] = $this->releaseImage->saveImage($xxxID . '-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024);\n\t\t\t\t}\n\n\t\t\t\t$this->pdo->queryExec(sprintf('UPDATE xxxinfo SET cover = %d, backdrop = %d WHERE id = %d', $mov['cover'], $mov['backdrop'], $xxxID));\n\n\t\t\t} else {\n\t\t\t\t$xxxID = -2;\n\t\t\t}\n\n\t\t}\n\n\t\tif ($this->echooutput) {\n\t\t\t$this->pdo->log->doEcho(\n\t\t\t\t$this->pdo->log->headerOver(($xxxID !== false ? 'Added/updated XXX movie: ' : 'Nothing to update: ')) .\n\t\t\t\t$this->pdo->log->primary($mov['title'])\n\t\t\t);\n\t\t}\n\n\t\treturn $xxxID;\n\t}", "function get_movies(){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_movies' => true, //a flag to execute the right code in App-Logic! \n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "private function fetchUrl($strSearch)\n {\n // Remove whitespaces.\n $strSearch = trim($strSearch);\n \n // \"Remote Debug\" - so I can see which version you're running.\n // To due people complaining about broken functions while they're\n // using old versions. Feel free to remove this.\n if ($strSearch == '##REMOTEDEBUG##') {\n $strSearch = 'https://www.imdb.com/title/tt1022603/';\n echo '<pre>Running PHP-IMDB-Grabber v' . IMDB::IMDB_VERSION . '.</pre>';\n }\n \n // Get the ID of the movie.\n $strId = IMDB::matchRegex($strSearch, IMDB::IMDB_URL, 1);\n if (!$strId) {\n $strId = IMDB::matchRegex($strSearch, IMDB::IMDB_ID, 1);\n }\n \n // Check if we found an ID ...\n if ($strId) {\n $this->_strId = preg_replace('~[\\D]~', '', $strId);\n $this->_strUrl = 'https://www.imdb.com/title/tt' . $this->_strId . '/';\n $bolFound = false;\n $this->isReady = true;\n }\n \n // ... otherwise try to find one.\n else {\n $strSearchFor = 'all';\n if (strtolower(IMDB::IMDB_SEARCHFOR) == 'movie') {\n $strSearchFor = 'tt&ttype=ft&ref_=fn_ft';\n } elseif (strtolower(IMDB::IMDB_SEARCHFOR) == 'tvtitle') {\n $strSearchFor = 'tt&ttype=tv&ref_=fn_tv';\n } elseif (strtolower(IMDB::IMDB_SEARCHFOR) == 'tvepisode') {\n $strSearchFor = 'tt&ttype=ep&ref_=fn_ep';\n }\n \n $this->_strUrl = 'https://www.imdb.com/find?s=' . $strSearchFor . '&q=' . str_replace(' ', '+', $strSearch);\n $bolFound = true;\n \n // Check for cached redirects of this search.\n $fRedirect = @file_get_contents($this->getCacheFolder() . md5($this->_strUrl) . '.redir');\n if ($fRedirect) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Found an old redirect:</b> ' . $fRedirect . '<br>';\n }\n $this->_strUrl = trim($fRedirect);\n $this->_strId = preg_replace('~[\\D]~', '', IMDB::matchRegex($fRedirect, IMDB::IMDB_URL, 1));\n $this->isReady = true;\n $bolFound = false;\n }\n }\n\n // Check if there is a cache we can use.\n $fCache = $this->getCacheFolder() . md5($this->_strId) . '.cache';\n if (file_exists($fCache)) {\n $bolUseCache = true;\n $intChanged = filemtime($fCache);\n $intNow = time();\n $intDiff = round(abs($intNow - $intChanged) / 60);\n if ($intDiff > $this->_intCache) {\n $bolUseCache = false;\n }\n } else {\n $bolUseCache = false;\n }\n \n if ($bolUseCache) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Using cache for ' . $strSearch . ' from ' . $fCache . '</b><br>';\n }\n $this->_strSource = file_get_contents($fCache);\n return true;\n } else {\n // Cookie path.\n if (function_exists('sys_get_temp_dir')) {\n $this->_fCookie = tempnam(sys_get_temp_dir(), 'imdb');\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Path to cookie:</b> ' . $this->_fCookie . '<br>';\n }\n }\n // Initialize and run the request.\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Run cURL on:</b> ' . $this->_strUrl . '<br>';\n }\n\n $arrInfo = $this->doCurl($this->_strUrl);\n $strOutput = $arrInfo['contents'];\n \n // Check if the request actually worked.\n if ($strOutput === false) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>! cURL error:</b> ' . $this->_strUrl . '<br>';\n }\n $this->_strSource = file_get_contents($fCache);\n if ($this->_strSource) {\n return true;\n }\n return false;\n }\n \n // Check if there is a redirect given (IMDb sometimes does not return 301 for this...).\n $fRedirect = $this->getCacheFolder() . md5($this->_strUrl) . '.redir';\n if ($strMatch = $this->matchRegex($strOutput, IMDB::IMDB_REDIRECT, 1)) {\n $arrExplode = explode('?fr=', $strMatch);\n $strMatch = ($arrExplode[0] ? $arrExplode[0] : $strMatch);\n\t\t \n if (filter_var($strMatch, FILTER_VALIDATE_URL)) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Saved a new redirect:</b> ' . $fRedirect . '<br>';\n }\n file_put_contents($fRedirect, $strMatch);\n $this->isReady = false;\n // Run the cURL request again with the new url.\n IMDB::fetchUrl($strMatch);\n return true;\n\t\t}\n }\n // Check if any of the search regexes is matching.\n elseif ($strMatch = $this->matchRegex($strOutput, IMDB::IMDB_SEARCH, 1)) {\n $strMatch = 'https://www.imdb.com/title/tt' . $strMatch . '/';\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Using the first search result:</b> ' . $strMatch . '<br>';\n echo '<b>- Saved a new redirect:</b> ' . $fRedirect . '<br>';\n }\n file_put_contents($fRedirect, $strMatch);\n // Run the cURL request again with the new url.\n $this->_strSource = null;\n $this->isReady = false;\n IMDB::fetchUrl($strMatch);\n return true;\n }\n // If it's not a redirect and the HTTP response is not 200 or 302, abort.\n elseif ($arrInfo['http_code'] != 200 && $arrInfo['http_code'] != 302) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Wrong HTTP code received, aborting:</b> ' . $arrInfo['http_code'] . '<br>';\n }\n return false;\n }\n \n $this->_strSource = $strOutput;\n \n // Set the global source.\n $this->_strSource = preg_replace('~(\\r|\\n|\\r\\n)~', '', $this->_strSource);\n \n // Save cache.\n if (!$bolFound) {\n if (IMDB::IMDB_DEBUG) {\n echo '<b>- Saved a new cache:</b> ' . $fCache . '<br>';\n }\n file_put_contents($fCache, $this->_strSource);\n }\n \n return true;\n }\n }", "public function search_id($id){\n $imdb_id = urlencode($id);\n $url = 'http://mymovieapi.com/?ids='.$imdb_id.'&type=json&plot=simple&episode=1&lang=en-US&aka=simple&release=simple&business=0&tech=0';\n search_url($url);\n }", "function retrieve_details() {\n\n// 11/25 - this shit needs work...\n \n\t/**\n\t * step 1\n\t * \n\t * retrieve all movies with an imdb_id but no details\n\t */\n\tini_set(\"max_execution_time\", \"300\");\n\t$sql_all = \"SELECT * FROM mr_movie_details WHERE imdb_id > 0 AND date_updated <=> NULL\";\n\t$res_all = mysql_query( $sql_all );\n\n\t// End the script if there are no new movies\n\tif ( mysql_num_rows( $res_all ) > 0 ) {\n\n\t\t/**\n\t\t * step 2\n\t\t *\n\t\t * retrieve all imdb_info and update db\n\t\t */\n\t\n\t\twhile ( $r = mysql_fetch_array( $res_all ) ) {\n\t\n\t\t\t$imdbid = $r['imdb_id'];\n\t\t\t$movie_id = $r['movie_id'];\n\t\t\t$filename = $r['filename'];\n\t\t\n\t\t\t$movie = new imdb( $imdbid );\n\t\t\t$movie->setid( $imdbid );\n\t\t\t\n\t\t\t$title = $movie->title();\n\t\t\t$year = $movie->year();\n\t\t\t$runtime = $movie->runtime();\n\t\t\t$genre = $movie->genre();\n//\t\t\t$genreID \t= get_genre_id( $genre );\n\t\t\t$all_genres = $movie->genres();\n\t\t\t$mpaar \t\t= $movie->mpaa ();\n\t\t\t$tagline\t= $movie->tagline();\n\t\t\t$directors\t= $movie->director();\n\t\t\t$producers\t= $movie->producer();\n\t\t\t$writers\t= $movie->writing();\n\t\t\t$cast\t\t= $movie->cast();\n\t\t\t//$plot \t\t= $movie->plot();\n\t\t\t//$short_plot = substr( $plot[0], 0, 255 );\n\t\t\t\n\n\n\t\t\tif ( strlen( $plot[0] ) > 255 )\n\t\t\t\t$short_plot .= ' [...]';\n\t\t\t\n\t\t\tif ( check_genre( $genre ) == FALSE )\n\t\t\t\tadd_genre( $genre );\n\t\n\t\t\tforeach ( $all_genres as $g ) {\n\t\t\t\tif ( check_genre( $g ) == FALSE )\n\t\t\t\t\tadd_genre( $g );\n\t\n\t\t\t\t// Update movie_genres\n\t\t\t\t$mg_sql = \"INSERT INTO mr_movie_genres (movie_id, genre_id) VALUES \".\n\t\t\t\t\t\" ($movie_id, \". get_genre_id( $g ) .\")\";\n\t\n\t\t\t\t$mg_res = mysql_query( $mg_sql );\n\t\t\t}\n\n/*\n\t\n\t\t\t$theVersion = get_version( substr( $filename, 0, strlen( $filename ) - 4 ) );\n\t\t\t//echo \"Version: $theVersion\";\n\t\t\t//echo $theVersion;\n\t\t\tif ( !check_version( $theVersion ) ) \n\t\t\t\tif ( !add_new_version( $theVersion ) )\n\t\t\t\t\techo \"<p>Couln't add $theVersion version to database.</p>\\n\";\n\t\t\t\t\n\t\t\t$theVersionID = get_version_id( $theVersion );\n*/\t\t\t\n\t\t\t\n// -- THIS NEEDS TO BE EDITED..\n\n\t\t\t$md_sql =\t'UPDATE mr_movie_details SET '.\n\t\t\t\t\t\t' date_updated = NOW(), '.\n\t\t\t\t\t\t' title = '. format_sql( $title ). ', '.\n\t\t\t\t\t\t' year = '. format_sql( $year ). ', '.\n\t\t\t\t\t\t' runtime = '. format_sql( $runtime ). ', '.\n\t\t\t\t\t\t' mpaa_rating = '. format_sql( $mpaar['USA'] ). ', '.\n\t\t\t\t\t\t' tagline = '. format_sql( trim( $tagline ) ) . ' '.\n\t\t\t\t\t\t\" WHERE movie_id = $movie_id LIMIT 1\";\n\n\n\t\t\t$producersSQL = \"INSERT INTO mr_movie_producers (movie_id, producer_id, producer_role) VALUES \";\n\t\t\tfor ( $i = 0; $i < count( $producers ); $i++ ) {\n\t\t\t\t$checkSQL = \"SELECT * FROM mr_producers WHERE producer_name LIKE \". format_sql( trim( $producers[$i]['name'] ), TRUE );\n\t\t\t\t$checkRES = mysql_query( $checkSQL );\n\t\t\t\tif ( mysql_num_rows( $checkRES ) == 0 ) {\n\t\t\t\t\tmysql_query( \"INSERT INTO mr_producers (producer_name) VALUES (\". format_sql( trim( $producers[$i]['name'] ) ) .\")\" );\n\t\t\t\t} else {\n\t\t\t\t\twhile ( $r = mysql_fetch_array( $checkRES ) ) {\n\t\t\t\t\t\t$producer_id = $r['producer_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$producersSQL .= \"( $movie_id, $producer_id, \". format_sql( trim( $producers[$i]['role'] ) ) .\"), \";\n\t\t\t}\n\t\t\t$producersSQL = substr( $producersSQL, 0, -2 );\n\t\t\t//echo $producersSQL;\n\t\t\t@mysql_query( $producersSQL );// or die(\"Couldn't add producers! \");\n\n $writersSQL = \"INSERT INTO mr_movie_writers (movie_id, writer_id) VALUES \";\n for ( $i = 0; $i < count( $writers ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_writers WHERE writer_name LIKE \". format_sql( trim( $writers[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_writers (writer_name) VALUES (\". format_sql( trim( $writers[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $writer_id = $r['writer_id'];\n }\n }\n $writersSQL .= \"( $movie_id, $writer_id ), \";\n }\n $writersSQL = substr( $writersSQL, 0, -2 );\n //echo $writersSQL;\n\t\t\t@mysql_query( $writersSQL );// or die(\"Couldn't add writers!\");\n\n $directorsSQL = \"INSERT INTO mr_movie_directors (movie_id, director_id) VALUES \";\n for ( $i = 0; $i < count( $directors ); $i++ ) {\n $checkSQL = \"SELECT * FROM mr_directors WHERE director_name LIKE \". format_sql( trim( $directors[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_directors (director_name) VALUES (\". format_sql( trim( $directors[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $director_id = $r['director_id'];\n }\n }\n $directorsSQL .= \"( $movie_id, $director_id ), \";\n }\n $directorsSQL = substr( $directorsSQL, 0, -2 );\n //echo $directorsSQL;\n\t\t\t@mysql_query( $directorsSQL );// or die(\"Couldn't add directors!\");\n\n\n $castSQL = \"INSERT INTO mr_movie_actors (movie_id, actor_id, actor_role) VALUES \";\n for ( $i = 0; $i < count( $cast ); $i++ ) { \n $checkSQL = \"SELECT * FROM mr_actors WHERE actor_name LIKE \". format_sql( trim( $cast[$i]['name'] ), TRUE );\n $checkRES = mysql_query( $checkSQL );\n if ( mysql_num_rows( $checkRES ) == 0 ) {\n mysql_query( \"INSERT INTO mr_actors (actor_name) VALUES (\". format_sql( trim( $cast[$i]['name'] ) ) .\")\" );\n } else {\n while ( $r = mysql_fetch_array( $checkRES ) ) {\n $actor_id = $r['actor_id'];\n }\n }\n $castSQL .= \"( $movie_id, $actor_id, \". format_sql( trim( $cast[$i]['role'] ) ) .\"), \";\n }\n $castSQL = substr( $castSQL, 0, -2 );\n //echo $castSQL;\n\t\t\t@mysql_query( $castSQL );// or die(\"Couldn't add cast!\");\n\n\n// directors, writers, cast\n\n\t\n\t\t\t$ratingSQL = \"INSERT INTO mr_movie_ratings (movie_id) VALUES ($movie_id)\";\n\t\t\t$ratingRes = mysql_query( $ratingSQL );\n\t\n\t\t\t$m_sql = \"UPDATE movies SET \".\n\t\t\t\t\" have_details = 'Y', \".\n\t\t\t\t\" version_id = $theVersionID \".\n\t\t\t\t\" WHERE movie_id = $movie_id\";\n\t\n\t\t\t//echo $m_sql;\n\t\t\t\n\t\t\t$md_res = mysql_query( $md_sql );\n//\t\t\t$m_res = mysql_query( $m_sql );\n\t\n\t\t\t$html['msg'] .= \"<div id=\\\"message\\\" class=\\\"updated\\\"><p>Info for <b>$title</b> added to database!</p></div>\\n\";\n\t\n\t\t}\n\t\t\n\t\t$html['main'] .= \"<p>Go <a href=\\\"{$_SERVER['PHP_SELF']}\\\">Home</a>.</p>\\n\";\n\t} else {\n\t\t$html['main'] .= \"<p>There are no movies with IMDB IDs but without details downloaded.</p>\\n\";\n\t}\n\t\n\treturn $html;\n}", "public function movie_show($movie_id = null) {\n // por el metodo de HTTP\n\n if ($movie_id == null) {\n show_404();\n }\n\n $movie = $this->Movie->find($movie_id);\n\n if (!is_object($movie)) {\n show_404();\n }\n\n $vdata[\"name\"] = $movie->name;\n $vdata[\"year\"] = $movie->year;\n $vdata[\"description\"] = $movie->description;\n $vdata[\"image\"] = $movie->image;\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/movies/show\", $vdata, TRUE);\n $view['title'] = \"Mostrar película: \" . $movie->name;\n $this->parser->parse('core/templates/body', $view);\n }", "public function get_movie($slug)\n {\n return $this->db\n ->get_where('tbl_movies', ['slug' => $slug])\n ->row_array();\n\n }", "public function showmetadata($string){\n\n $artistalike = DB::table('artistas')->where('nomeartista','LIKE', '%' . $string . '%')->first();\n\n if(!$artistalike){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n $data = $artistalike->id;\n \n $metadata = DB::table('artistas')\n ->select(\n 'nomeartista',\n 'desc_artista',\n 'filepath'\n )->where('nomeartista', 'LIKE', '%' . $string . '%')\n ->get();\n\n $metaalbum = DB::table('artistas')\n ->join('album', 'album.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'album.titulo_album',\n 'album.desc_album',\n 'album.filepath_avatar'\n )\n ->get();\n \n $metamusica = DB::table('artistas')\n ->join('musica', 'musica.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'musica.id',\n 'musica.nomemusica',\n 'musica.filepath',\n 'musica.created_at'\n )\n ->get();\n \n if(!$metadata){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n return [\n 'find' => [\n 'artist' => [\n 'artista' => $metadata,\n 'data' => [\n 'album'=>$metaalbum,\n 'musicas'=>$metamusica\n ]\n\n ]\n ]\n ];\n }", "public function movies_x264()\n\t{\n\t\tif (preg_match('/^http:\\/\\/nzbroyalty\\.com - (.+?) - \\[\\d+\\/(\\d+\\]) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Scream.4.2011.WS.720p.BluRay.X264-AMIABLE - [000/106] - \"Scream.4.2011.WS.720p.BluRay.X264-AMIABLE.nzb\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9._-]+ - ?\\[)\\d+\\/(\\d+\\]) - \"(.+?)\\.(nzb|rar|par2)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //The Beaver 2011 720p BluRay DD5.1 x264-CtrlHD - [00/65] - \"The Beaver 2011 720p BluRay DD5.1 x264-CtrlHD.nzb\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9].+?)( - )\\[\\d+(\\/\\d+\\] - \").+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"The.Hudsucker.Proxy.1994.1080p.Blu-ray.Remux.AVC.DTS.HD.MA.2.0-KRaLiMaRKo\"(127/132) \"The.Hudsucker.Proxy.1994.1080p.Blu-ray.Remux.AVC.DTS.HD.MA.2.0-KRaLiMaRKo.vol379+20.par2\" - 24.61 GB - yEnc\n\t\tif (preg_match('/(\"|#34;)(.+)(\"|#34;)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}(\"|#34;).+?(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4})(\"|#34;)[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(Amour.2012.1080p.BluRay.x264-EbP)(002/337) \"Amour.2012.1080p.BluRay.x264-EbP.part001.rar\" - 16.58 GB - yEnc\n\t\tif (preg_match('/^\\([\\w.-]+\\)[\\(\\[]\\d+\\/\\d+[\\]\\)] \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(La.pianiste.(aka.The.Piano.Teacher).(2001).720p.BluRay.AC3.x264-MandR) [085/101] - \"La.pianiste.(aka.The.Piano.Teacher).(2001).720p.BluRay.AC3.x264-MandR.part084.rar\" yEnc\n\t\tif (preg_match('/^\\([\\w .()-]+\\) [\\(\\[]\\d+\\/\\d+[\\]\\)] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[00/56] - \"The.Last.Days.On.Mars.720p.BluRay.x264-DR.nzb\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //< Michael.Jackson.Bad.25.2012.720p.BluRay.x264-PHD > - \"Michael.Jackson.Bad.25.2012.720p.BluRay.x264-PHD.par2\" (01/64) yEnc\n\t\tif (preg_match('/^< [\\w.() -]+ > - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\(\\d+\\/\\d+\\) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //:Waga.Haha.no.Ki.2012.BluRay.720p.DTS.x264 - Chronicle.Of.My.Mother.2012 - [55/56] - \"waha.720p.vol063+64.par2\" yEnc\n\t\tif (preg_match('/^:([\\w.-]+)[-_\\s]{0,3}[\\w.-]+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Cat Ballou (1965) Multi-Dub AVC 480p.MKV.001\" 01 of 11 yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\d+ of \\d+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Fly.With.The.Gold.2012.720p.BluRay.x264-WiKi [03/73] - \"wiki-fwtg.par2\" yEnc\n\t\tif (preg_match('/^([\\w.-]+)[-_\\s]{0,3}\\[\\d+\\/(\\d+\\])[-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Parker.2013.MULTi.720p.BluRay.x264-GAIA - \"Parker.2013.MULTi.720p.BluRay.x264-GAIA.nfo\" yEnc\n\t\tif (preg_match('/^([\\w.-]+)[-_\\s]{0,3}\".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function getMarWebsite($id, $str)\n{\n\t// loop through all post types of marcato artists websites. Exit when string is\n\t// found and return the proper details.\n\tfor($i=0; $i<=10; $i++)\n\t{\n\t\t$url = \"marcato_artist_website_\".$i.\"_url\";\n\t\t$result = get_post_meta($id, $url);\n\t\t\n\t\t//end as soon as no results are pulled.\n\t\tif(!isset($result[0])) return false;\n\n\t\t//compare result with our passed string. It can be 0 but not false.\n\t\tif( strstr($result[0], $str) !== false ){\n\t\t\treturn $result[0];\n\t\t}\n\t}\n}", "public function show(Movie $movie)\n {\n //\n }", "public function show(Movie $movie)\n {\n //\n }", "private function getMovieDataWWM($movie_id){\n\t\t\n\t\t// gather movie data\n\t\t$movie_data = json_decode(json_encode((array) simplexml_load_string($this->get_data('http://webservice.cinema-source.com/3.8/?apikey=THBMB&query=movie&stars=yes&photos=all&movie_id='.trim($movie_id)))), 1);\n\n\t\treturn $movie_data['movie'];\n\t}", "public function movies_divx()\n\t{\n\t\tif (preg_match('/^\\(www\\.Thunder-News\\.org\\) .+? - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Movieland Post Voor FTN - [01/43] - \"movieland0560.par2\" yEnc\n\t\tif (preg_match('/^[a-zA-Z ]+Post Voor FTN - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Disney short films collection by mayhem masta\"1923 - Alice's Wonderland.vol15+7.par2\" yEnc\n\t\tif (preg_match('/.+?by mayhem masta\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(http://dream-of-usenet.info) - [01/43] - \"Nicht.auflegen.2002.German.DL.AC3.BDRip.XviD-iNCEPTiON.nfo\" yEnc\n\t\tif (preg_match('/^\\(.+usenet\\.info\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[######]-[FULL]-[#hdtv@LinkNet]-[Sesame.Street.S41E03.1080i.HDTV.DD5.1.MPEG2-TrollHD]-[00/51] - \"Sesame Street S41E03 Chicken When It Comes to Thunderstorms 1080i HDTV DD5.1 MPEG2-TrollHD.nzb\" yEnc\n\t\tif (preg_match('/\\[#]+\\]-\\[.+\\]-\\[.+\\]-\\[(.+)\\][- ]\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ Rules.of.Engagement.S06E12.720p.WEB-DL.DD5.1.H.264-CtrlHD ]-[01/24] - \"Rules.of.Engagement.S06E12.720p.WEB-DL.DD5.1.H.264-CtrlHD.nfo\" yEnc\n\t\tif (preg_match('/^\\[ ([a-zA-Z0-9.-]{6,}) \\]-\\[\\d+\\/\\d+\\] - \".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function get_movie_name($file_name){\n\t\t$this->_set_movie_name($file_name);\n\t\treturn $this->movie_name;\n\t}", "function mars_video_meta() {}", "public function show($id)\n {\n $movie = Movie::findOrFail($id);\n return $movie;\n }", "public function getDiscoverMovie($page = 1) {\n\n\t\t$movies = array();\n\n\t\t$result = $this->_call('discover/movie', 'page='. $page);\n\n\t\tforeach($result['results'] as $data){\n\t\t\t$movies[] = new Movie($data);\n\t\t}\n\n\t\treturn $movies;\n\t}", "public function show($id) {\n return response()->json(Movie::find($id));\n }", "public static function getFriendlyName() {\r\n\t\treturn 'Movie';\r\n\t}", "public function selectMovie($id) {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->movieSelectById($id);\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\n\t}", "public abstract function get($text);", "function setInfo() {\n //Sanatize using Regex\n $santizied=$this->sanitize($this->rawTitle);\n \n \n //IMDB API Options\n $plot='full'; //Plot format Full or Simple\n $limit=1; //Number of results\n \n $reply=file_get_contents('http://imdbapi.org/?title='.$santizied.'&type=json&plot='.$plot.'&episode=0&limit='.$limit.'&yg=0&mt=M&lang=en-US&offset=&aka=simple&release=simple');\n $obj = json_decode($reply,true);\n\t\t\n\n \n if (@is_null($obj[0]['title'])) { \n $this->download=false;\n }\n else { \n $this->title=$obj[0]['title'];\n $this->time=$obj[0]['runtime'][0];\n $this->genres=$obj[0]['genres'];\n $this->rating=$obj[0]['rating'];\n $this->plot=$obj[0]['plot_simple'];\n $this->director=$obj[0]['directors'][0];\n $this->casts=$obj[0]['actors'];\n $this->year=$obj[0]['year'];\n\t\t\t $this->imdbid=$obj[0]['imdb_id'];\n //TODO: Uncomment this\n //$this->poster=$obj[0]['poster'];\n\t\t\t $this->poster=$this->thePoster($obj[0]['poster']);\n //$this->poster='http://localhost:8080/wordpress/wp-content/uploads/2013/01/d.jpg';\n \n $this->download=TRUE;\n\n } \n \n\n }", "public function get($text);", "public function show($id)\n {\n try {\n $movie = \\App\\Movie::find($id);\n $movie_genres = $movie->genres;\n $movie_screens = $movie->screens;\n } catch (\\Throwable $th) {\n error_log($th);\n }\n $movie = [\n 'movie'=>$movie,\n 'genres'=>$movie_genres,\n 'screens'=>$movie_screens\n ];\n return $movie;\n }", "public function movieSelectActionGet()\n {\n $title = \"Select a movie\";\n\n //Destroy previous sessions\n $this->app->session->destroy();\n\n // Initiate the session for the game.\n $this->app->session->start();\n\n $this->app->db->connect();\n\n $sql = \"SELECT id, title FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/movie-select\", [\n \"res\" => $res,\n ]);\n\n if ($this->app->request->getGet(\"showAll\")) {\n $sql = \"SELECT * FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function GetMovie($id)\n {\n try \n { \n $query = \"SELECT * FROM \" . $this->tableName . \" where id=$id;\";\n $this->connection = Connection::GetInstance();\n $resultSet = $this->connection->Execute($query);\n\n $movie = new Movie();\n \n foreach ($resultSet as $row) {\n $movie->setId($row[\"id\"]);\n $movie->setAdult($row[\"adult\"]);\n $movie->setName($row[\"movieName\"]);\n $movie->setSummary($row[\"summary\"]);\n $movie->setLanguage($row[\"movieLanguage\"]);\n $movie->setImage($row[\"dir_image\"]);\n $movie->setReleaseDate($row[\"releaseDate\"]);\n $arrayGenres = $this->MoviesxGenresDAO->GetGenresByMovieId($id);\n $aux = array();\n foreach($arrayGenres as $genreId)\n {\n array_push($aux, $genreId[\"idGenre\"]);\n }\n $movie->setGenres($aux);\n $movie->setRuntime($row[\"runtime\"]);\n // $movie->setPlayingNow($row[\"playingNow\"]);\n }\n \n } catch (Exception $ex) {\n throw $ex;\n } \n\n return $movie;\n }", "public function show($id)\n {\n $movie = Http::get('https://api.themoviedb.org/3/movie/'.$id.'?api_key='.$this->token.'&append_to_response=credits')->json();\n $downloads = Download::with('cloud_storage')->where('id',$id)->get();\n $casts = Http::get('https://api.themoviedb.org/3/movie/'.$id.'?api_key='.$this->token.'&append_to_response=credits')->json()['credits']??'Test';\n $similars = Http::get('https://api.themoviedb.org/3/movie/'.$id.'/similar?api_key='.$this->token)->json()['results'];\n return view('pages/detailscreen',[\n 'movie'=>$movie,\n 'downloads'=>$downloads,\n 'casts'=>$casts,\n 'similars'=>$similars,\n ]);\n }", "function searchString($string, $page){\n \tglobal $numofVideos;\n \t$realstring = pg_escape_string($string);\n \t$realpage = pg_escape_string($page);\n \t$link = createConection();\n \t$query = \"SELECT * FROM video where VideoName ilike '%\".$realstring.\"%' ORDER BY VideoName Limit \".$numofVideos.\" OFFSET \".$realpage*$numofVideos.\";\";\n \t$result = pg_exec($link,$query);\n \tcloseConection($link);\n \treturn $result;\n }", "public function detailAction()\n {\n $movieId = $this->dispatcher->getParam('id');\n\n $content = $this->api->get(self::API_ROUTE_MOVIE_CRUD . '/' . $movieId);\n\n if($content instanceof AppError) {\n $this->view->setVar('errors', $content->getMessage());\n } else {\n $this->view->setVar('movie', $content->movie);\n $this->view->setVar('genres', $content->genres);\n $this->view->setVar('videos', $content->videos);\n $this->view->setVar('isFavorite', $content->isFavorite);\n }\n }", "public function multimedia_scifi()\n\t{\n\t\tif (preg_match('/^some m4vs - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "private function getMediaInfoByFilename($filename) {\n $key = array_search($filename, array_column($this->media_info, 'filename'));\n return $this->media_info[$key];\n }", "public function type_movie_show($type_movie_id = null) {\n // por el metodo de HTTP\n\n if ($type_movie_id == null) {\n show_404();\n }\n\n $type_movie = $this->Type_movie->find($type_movie_id);\n\n if (!is_object($type_movie)) {\n show_404();\n }\n\n $vdata[\"name\"] = $type_movie->name;\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/types_movie/show\", $vdata, TRUE);\n $view['title'] = \"Mostrar película: \" . $type_movie->name;\n $this->parser->parse('core/templates/body', $view);\n }", "public static function getMovieWhich($attr, $value)\n {\n $movies = Movies::where($attr, $value)->orderBy('year', 'desc')->paginate(10);\n return $movies;\n }", "public function show($id)\n {\n return response()->json(\n Movie::where('user_id', Auth::guard('token')->id())->where('id', $id)->first()\n );\n }", "public function get($video_id);", "public function search_movie_by_rotten_id($rotten_id) {\n $format = variable_get('rottentomatoes_format', '.json');\n $params = '';\n return $this->call('movies/' . $rotten_id . $format, $params, 'GET');\n }", "function testMovie2(): void\n {\n // https://www.imdb.com/title/tt0481536/\n\n Global $config;\n $config['http_header_accept_language'] = 'en-US,en;q=0.9';\n\n $id = '0481536';\n $data = engineGetData($id, 'imdb', false);\n $this->assertNotEmpty($data);\n\n // $this->printData($data);\n\n $this->assertNotContains('istv', $data);\n $this->assertMatchesRegularExpression('/After being mistaken for terrorists and thrown into Guantánamo Bay, stoners Harold and Kumar escape and return to the U.S./', $data['plot']);\n }", "public function show($id)\n {\n \t$movieData = Movie::where('id',$id)->first();\n \tif ($movieData->count() == 0){\n \t\treturn response()->json(\n \t\t\t[\n \t\t\t\t'error' => 'no result'\n \t\t\t]);\n \t}\n \t$mGenres = $movieData->genres->first()->name;\n \t$mActors = $movieData->actors;\n \t$mActorResult = [];\n \tforeach ($mActors as $key => $actor) {\n \t\t$mActorResult[] = $actor->name;\n \t}\n \t$image = File::where([\n \t\t'type' \t=> 'movie',\n \t\t'type_id' \t=> $id\n \t\t])->first();\n \t$mDir = '';\n \tif ($image != null && $image->count()>0){\n $mDir = $image->dir;\n }\n \t$result = [\n \t\t\t'Name' \t\t=> $movieData->name,\n \t\t\t'Genre'\t\t=> $mGenres,\n \t\t\t'Actors' =>$mActorResult,\n \t\t\t'Rating'\t=> $movieData->rate,\n \t\t\t'Description' => $movieData->description,\n \t\t\t'images' \t\t=> $mDir,\n \t\t];\n\n\n return response()->json($result);\n }", "public function processMovies($releaseToWork = '')\n\t{\n\t\tif ($this->site->lookupimdb === '1') {\n\t\t\t$movie = new Movie($this->echooutput);\n\t\t\t$movie->processMovieReleases($releaseToWork);\n\t\t}\n\t}", "public function extract($string);", "public function get_video_info($video) {\n static $command_ouput;\n if (!empty($command_output))\n return $command_output;\n\n $file = escapeshellarg($video);\n // Execute the command\n $options = $this->params['cmd_path'] . ' -i ' . $file;\n $command_output = $this->run_command($options);\n return $command_output;\n }", "public function parse($string)\n {\n\n $type = 'unknown';\n $id = false;\n\n preg_match(\"/[a-zA-Z0-9_-]+/\", $string, $output);\n\n if (count($output) > 0) {\n\n if ($this->isChannelId($string)) {\n $type = 'channel';\n $id = $string;\n } else if ($this->isVideoId($string)) {\n $type = 'video';\n $id = $string;\n }\n\n }\n\n if (substr($string, 0, 3) === 'www' || substr($string, 0, 8) === 'youtube.') {\n $string = 'https://'.$string;\n }\n\n $parsed = parse_url($string);\n\n if (!isset($parsed['host'])) {\n return ['type' => $type, 'id' => $id];\n }\n\n // https://www.youtube.com/channel/UC6MFZAOHXlKK1FI7V0XQVeA\n if (strpos($parsed['path'], '/channel') === 0)\n {\n $id = explode('/', $parsed['path'])[2];\n if ($this->isChannelId($id)) {\n $type = 'channel';\n }\n }\n\n // https://www.youtube.com/user/ProZD\n if (strpos($parsed['path'], '/user') === 0)\n {\n $type = 'channel';\n $id = $this->getChannelId('user/'.explode('/', $parsed['path'])[2]);\n }\n\n\n // https://www.youtube.com/idubbbztv\n if (count((explode('/', $parsed['path']))) == 2 && !isset($parsed['query'])) {\n $type = 'channel';\n $id = $this->getChannelId(explode('/', $parsed['path'])[1]);\n }\n\n // https://www.youtube.com/watch?v=4ZK8Z8hulFg\n if (strpos($parsed['path'], '/watch') === 0)\n {\n $type = 'video';\n parse_str($parsed['query'], $query);\n $id = $query['v'];\n }\n\n // https://youtu.be/aJX4ytfqw6k\n if ($parsed['host'] === 'youtu.be')\n {\n $type = 'video';\n $id = substr($parsed['path'], 1);\n }\n\n return ['type' => $type, 'id' => $id];\n }", "public function searchTitleActionGet()\n {\n $title = \"Search for a movie by title\";\n $searchTitle = $this->app->request->getGet(\"searchTitle\");\n\n $this->app->db->connect();\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $this->app->page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle,\n ]);\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "function get_all_titles( $movie_dir = \"/home/priddle/www/movies/\", $strip_ext = TRUE ) {\n\tforeach( glob( \"$movie_dir*.mp4\" ) as $filename ) {\n\t\tif ( $strip_ext == TRUE ) {\n\t\t\t$title = explode( \".mp4\", $filename );\n\t\t\t$movie = substr( $title[0], strlen( $movie_dir ) );\n\t\t\t$all_movies[] = $movie;\n\t\t} else {\n\t\t\t$movie = substr( $filename, strlen( $movie_dir ) );\n\t\t\t$all_movies[] = $movie;\n\t\t}\n\t}\n\n\treturn $all_movies;\n}", "public function getMediaObjectByFilename($filename) {\n // TODO: make method private again\n $query = \"//collection/media-object/filename[text() = '$filename']/..\";\n $xpath = new DOMXPath($this->domDocument);\n $result = $xpath->query($query);\n return $result->item(0);\n }", "function gen_search($str){\r\n\t\t\r\n\t\t$gen_con = mysqli_connect(\"localhost\",\"root\",\"\",\"product_list\");\r\n\t\t$gen_mov = \"SELECT * FROM `movies` WHERE genre like '%$str%'\";\r\n\t\t$gen_tv = \"SELECT * FROM `tv` WHERE genre like '%$str%'\";\r\n\t\t\r\n\t\t$gen_mov_result = mysqli_query($gen_con,$gen_mov);\r\n\t\t$gen_tv_result = mysqli_query($gen_con,$gen_tv);\r\n\r\n\t\tif(mysqli_num_rows($gen_mov_result)>0||mysqli_num_rows($gen_tv_result)>0){\r\n\t\t\techo \"<h2 style='text-align: center;'> MOVIES </h2>\";\r\n\t\t\tif(mysqli_num_rows($gen_mov_result) == 0)\r\n\t\t\t\techo \"\r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<h3 style='text-align: center;'> Nothing came up... </h3>\r\n\t\t\t\t\t\t<br><hr><br>\r\n\t\t\t\t\t\";\r\n\t\t\telse\r\n\t\t\t\twhile ($record = mysqli_fetch_assoc($gen_mov_result)) { \r\n\t\t\t\t\t$id=$record['id'];\r\n\t\t\t\t\t$name=$record['name'];\r\n\t\t\t\t\t$genre=$record['genre'];\r\n\t\t\t\t\t$rating=$record['rating'];\r\n\t\t\t\t\t$imgpath=$record['imgpath'];\r\n\t\t\t\t\t$imdbpath=$record['imdbpath'];\r\n\t\t\t\t\t$bookpath=$record['bookpath'];\r\n\t\t\t\t\techo \"\t\r\n\t\t\t\t\t<div class='container'>\r\n\t\t\t\t\t\t<div class='card'>\r\n\t\t\t\t\t\t\t<div class='card-body'>\r\n\t\t\t\t\t\t\t\t<img src='$imgpath' height='100' style='float: left; border: 0.25px solid grey;'/>\r\n\t\t\t\t\t\t\t\t<div style='float: right;'>\r\n\t\t\t\t \t\t\t\t<h4 class='card-title'>$name</h4>\r\n\t\t\t\t\t\t\t\t\t<p class='card-text'> \r\n\t\t\t\t\t\t\t\t\t\t$genre &nbsp &nbsp &nbsp <div style='font-size: 15px; font-weight: 700;'> $rating </div>\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t<a href='$bookpath' class='card-link btn btn-outline-success'>Book Now</a>\r\n\t\t\t\t\t\t\t\t\t<a href='$imdbpath' class='card-link btn btn-outline-danger' target='_blank'>View Info</a>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br>\";\r\n\t\t\t\t}\r\n\t\t\techo \"<h2 style='text-align: center;'> TV SHOWS </h2>\";\r\n\t\t\tif(mysqli_num_rows($gen_tv_result) == 0)\r\n\t\t\t\techo \"\r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<h3 style='text-align: center;'> Nothing came up... </h3>\r\n\t\t\t\t\t\t<br><hr><br>\r\n\t\t\t\t\t\";\r\n\t\t\telse{\r\n\t\t\t\twhile ($record = mysqli_fetch_assoc($gen_tv_result)) { \r\n\t\t\t\t\t$id=$record['id'];\r\n\t\t\t\t\t$name=$record['name'];\r\n\t\t\t\t\t$genre=$record['genre'];\r\n\t\t\t\t\t$rating=$record['rating'];\r\n\t\t\t\t\t$imgpath=$record['imgpath'];\r\n\t\t\t\t\t$imdbpath=$record['imdbpath'];\r\n\t\t\t\t\t$bookpath=$record['bookpath'];\r\n\t\t\t\t\techo \"\t\r\n\t\t\t\t\t<div class='container'>\r\n\t\t\t\t\t\t<div class='card'>\r\n\t\t\t\t\t\t\t<div class='card-body'>\r\n\t\t\t\t\t\t\t\t<img src='$imgpath' height='100' style='float: left; border: 0.25px solid grey;'/>\r\n\t\t\t\t\t\t\t\t<div style='float: right;'>\r\n\t\t\t\t \t\t\t\t<h4 class='card-title'>$name</h4>\r\n\t\t\t\t\t\t\t\t\t<p class='card-text'> \r\n\t\t\t\t\t\t\t\t\t\t$genre &nbsp &nbsp &nbsp <div style='font-size: 15px; font-weight: 700;'> $rating </div>\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t<a href='$bookpath' class='card-link btn btn-outline-success'>Book Now</a>\r\n\t\t\t\t\t\t\t\t\t<a href='$imdbpath' class='card-link btn btn-outline-danger' target='_blank'>View Info</a>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br>\";\r\n\t\t\t\t}\r\n\t\t\t\techo \"<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tnothing_came_up();\r\n\t}", "function isTriggered() {\n\t\tif(!isset($this->data['text'])) {\n\t\t\t$this->printUsage();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$HTTP = new HTTP('api.themoviedb.org');\n\t\t\n\t\t$html = $HTTP->GET('/2.1/Movie.search/'.$this->getConfig('language').'/xml/'.$this->api_key.'/'.urlencode($this->data['text']));\n\t\t$XML = simplexml_load_string($html);\n\t\tif(!$XML) {\n\t\t\t$this->reply('Error on contacting themoviedb.org');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$tmp = $XML->xpath('opensearch:totalResults');\n\t\t$results = (int)$tmp[0];\n\t\tif(!$results) {\n\t\t\tif($this->getConfig('language') != 'en') {\n\t\t\t\t$html = $HTTP->GET('/2.1/Movie.search/en/xml/'.$this->api_key.'/'.urlencode($this->data['text']));\n\t\t\t\t$XML = new SimpleXMLElement($html);\n\t\t\t\tif(!$XML) {\n\t\t\t\t\t$this->reply('Error on contacting themoviedb.org');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$tmp = $XML->xpath('opensearch:totalResults');\n\t\t\t\t$results = (int)$tmp[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!$results) {\n\t\t\t$this->reply('There is no information available about this movie.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$tmp = $XML->children()->children();\n\t\t$Movie = $tmp[0];\n\t\t\n\t\t$text = \"\\x02\".$Movie->name.\"\\x02\";\n\t\tif((string)$Movie->original_name != (string)$Movie->name) $text.= ' ('.$Movie->original_name.')';\n\t\tif(!empty($Movie->released)) $text.= \" | \\x02Released:\\x02 \".$Movie->released;\n\t\tif($Movie->rating != '0.0') $text.= \" | \\x02Press Rating:\\x02 \".$Movie->rating.'/10';\n\t\tif(!empty($Movie->certification)) $text.= \" | \\x02Rated:\\x02 \".$Movie->certification;\n\t\t$text.= ' ('.$Movie->url.')';\n\t\t\n\t\t$this->reply($text);\n\t\t$this->reply($Movie->overview);\n\t}", "public function showbylike($string){\n $artistalike = DB::table('artistas')->where('nomeartista','LIKE', '%' . $string . '%')->first();\n\n if(!$artistalike){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ],404);\n } \n return response()->json($artistalike);\n }", "function filmdata(){\r\n\tglobal $pdo;\r\n\tglobal $movie;\r\n\tglobal $movie_id;\r\n\tglobal $favoriettext;\r\n\t\t//ophalen genres\r\n\t$sql = \"SELECT genre_name FROM Movie m JOIN movie_genre g on m.movie_id = g.movie_id where m.movie_id = \".$movie_id.\";\";\r\n\t$genres = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC) or die(print_r($pdo->errorInfo(), true));\r\n\t\t//ophalen directors\r\n\t$sql = \"SELECT p.firstname, p.lastname FROM Movie m JOIN Movie_Director d ON m.movie_id = d.movie_id JOIN Person p ON d.person_id = p.person_id WHERE d.movie_id = \".$movie_id.\" ORDER BY p.firstname ASC;\";\r\n\t$directors = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t//ophalen actors\r\n\t$sql = \"SELECT p.firstname, p.lastname FROM Movie m JOIN Movie_Cast c ON m.movie_id = c.movie_id JOIN Person p ON c.person_id = p.person_id WHERE c.movie_id = \".$movie_id.\" ORDER BY p.firstname ASC;\";\r\n\t$actors = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t//lengte van film in uren berekenen\r\n\t$filmlengte = date('G\\u\\u\\r i\\M\\i\\n', mktime(0,$movie[0]['duration']));\r\n\t\t//cover_image vullen\r\n\tif(!isset($movie[0]['cover_image'])){\r\n\t\t$movie[0]['cover_image'] = \"placeholder.png\";\r\n\t}\r\n\t\t//trailer URL vullen\r\n\tif(!isset($movie[0]['URL'])){\r\n\t\t$movie[0]['URL'] = 'https://www.youtube.com/embed/ponurLICAoM';\r\n\t}\r\n\t\t//genres formatten\r\n\tif($genres){\r\n\t\t$formattedgenres = \"\";\r\n\t\tforeach($genres as $genre){\r\n\t\t\t$formattedgenres = $formattedgenres.implode(\" \", $genre).\", \";\r\n\t\t}\r\n\t\t$formattedgenres = rtrim($formattedgenres, \", \");\r\n\t}\r\n\t\t//directors array formatten\r\n\tif($directors){\r\n\t\t$formatteddirectors = \"\";\r\n\t\tforeach($directors as $director){\r\n\t\t\t$formatteddirectors = $formatteddirectors.implode(\" \", $director).\", \";\r\n\t\t}\r\n\t\t$formatteddirectors = rtrim($formatteddirectors, \", \");\r\n\t}\r\n\t\t//actors array formatten\r\n\tif($actors){\r\n\t\t$formattedactors = \"\";\r\n\t\tforeach($actors as $actor){\r\n\t\t\t$formattedactors = $formattedactors.implode(\" \", $actor).\", \";\r\n\t\t}\r\n\t\t$formattedactors = rtrim($formattedactors, \", \");\r\n\t}\r\n\t\t//printen waardes\r\n\techo '<div class=\"movie-flex\">';\r\n\techo '<h1>'.$movie[0]['title'].'</h1>';\r\n\techo '<h3>('.$movie[0]['publication_year'].')</h3>';\r\n\techo '<br>';\r\n\techo '<form action=\"#\" method=\"post\"><input class=\"button\" id=\"submit\" type=\"submit\" name=\"favoriet\" width=\"20\" height=\"10\" value=\"'.$favoriettext.'\"/></form>';\r\n\techo '</div>';\r\n\techo '<p> '.$filmlengte.' | '.$formattedgenres.' | '.$movie[0]['publication_year'].'</p>';\r\n\techo '<div class=\"movie-flex\">';\r\n\techo '<a href=\"data/image_data/'.$movie[0]['cover_image'].'\"><img src=\"data/image_data/'.$movie[0]['cover_image'].'\" height=\"200\" width=\"150\" alt=\"The Matrix\"></a>';\r\n\techo '<div class=\"movieinformation-flex\">';\r\n\techo '<p id=\"description\">'.$movie[0]['description'].'</p>';\r\n\tif(isset($formatteddirectors)){\r\n\t\techo '<p>Directors: '.$formatteddirectors.'.</p>';\r\n\t}\r\n\tif(isset($formattedactors)){\r\n\t\techo '<p>Actors: '.$formattedactors.'.</p>';\r\n\t}\r\n\techo '<button class=\"button\" style=\"width:100px;height:50px\"><a style=\"text-decoration=none;\" href=\"afspelen.php?movie_id='.$movie_id.'\">Afspelen</a></button>';\r\n\techo '</div>';\r\n\techo '</div>';\r\n\techo '<div id=\"trailer\">';\r\n\techo '<iframe width=\"420\" height=\"315\" src=\"'.$movie[0]['URL'].'\"></iframe>';\r\n\techo '</div>';\r\n}", "function get_movie_id($title){\r\n\t\tglobal $connection;\r\n\t\t$query = 'SELECT * FROM movies WHERE Title=\"' . $title . '\" LIMIT 1';\r\n\t\t$result = mysqli_query($connection, $query);\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row['Id'];\r\n\t}", "function parseVideoEntry($entry) { \n \t$obj\t\t\t\t= new \\stdClass;\n\t\t$media\t\t\t\t= $entry->children('http://search.yahoo.com/mrss/');\n $obj->title\t\t\t= $media->group->title;\n $obj->description\t= $media->group->description;\n\t\t\n\t\t$yt = $media->children('http://gdata.youtube.com/schemas/2007');\n $attrs = $yt->duration->attributes();\n $obj->length = $attrs['seconds']; \n return $obj; \n\t}", "public function show(Movie $movie)\n {\n //show one movie\n dd(\"show\");\n }", "public function moovee()\n\t{\n\t\tif (preg_match('/\\[ENJOY\\]-\\[FULL\\]-\\[.+\\]-\\[ (.+) \\]-\\[\\d+\\/\\d+\\]-\".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} ///PROUT Movie (2010) NTSC DVD [157/15768] - \"PROUTmovie_NTSC.part155.rar\" yEnc\n\t\tif (preg_match('/^(.+DVD.*) \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[ Hammer.of.the.Gods.2013.720p.WEB-DL.DD5.1.H.264-ELiTE ]-[01/44] - \"Hammer.of.the.Gods.2013.720p.WEB-DL.DD5.1.H.264-ELiTE.par2\" yEnc\n\t\t//[134863]-[ Rihanna.No.Regrets.2013.720p.WEB-DL.DD5.1.H.264-PZK ]-[52/52] - \"Rihanna.No.Regrets.2013.720p.WEB-DL.DD5.1.H.264-PZK.vol127+76.par2\" yEnc\n\t\t//[Hard.Target.1993.UNRATED.720p.BluRay.x264-88keyz] - [001/101] - \"Hard.Target.1993.UNRATED.720p.BluRay.x264-88keyz.nfo\"\n\t\t//[ Fast.And.Furious.6.2013.720p.WEB-DL.AAC2.0.H.264-HDCLUB ]-[REAL]-[01/54] - \"Fast.And.Furious.6.2013.720p.WEB-DL.AAC2.0.H.264-HDCLUB.nfo\" yEnc\n\t\tif (preg_match('/^(\\[\\d+\\]-)?\\[ ?([a-zA-Z0-9.-]{6,}) ?\\](-\\[REAL\\])? ?- ?\\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //\"Nights.of.Cabiria.1957.NTSC.DVD.x264-Tree\"(23/57) \"Nights.of.Cabiria.1957.NTSC.DVD.x264-Tree.part22.rar\" - 2.40 GB yEnc\n\t\tif (preg_match('/^\"(.+(DVD|BluRay|BRRip).+)\"\\(\\d+\\/\\d+\\) \".+\".+[GMK]B yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [0/1] - \"A.Good.Day.to.Die.Hard.2013.nzb\" yEnc\n\t\tif (preg_match('/^\\(\\?{4}\\) \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[xxxxx]-[#a.b.moovee@EFNet]-[ xxxxx ]-[02/66] - \"tulob88.part01.rar\" yEnc\n\t\tif (preg_match('/^\\[x+\\]-\\[.+?\\]-\\[ x+ \\]-\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Groove.2000.iNTERNAL.DVDRip.XviD-UBiK - [001/111] - \"ubik-groove-cd1.par2\" yEnc\n\t\t//Antony.and.Cleopatra.1972.720p.WEB-DL.H264-brento -[35/57] - \"Antony.and.Cleopatra.1972.720p.WEB-DL.AAC2.0.H.264-brento.part34.rar\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9._-]+) - ?\\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Iron.Man.3.2013.R5.DVDRip.XviD-AsA) (01/26) - \"Iron.Man.3.2013.R5.DVDRip.XviD-AsA.part01.part.sfv\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9.-]+)\\) \\(\\d+\\/\\d+\\) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Classic Surf) Morning.Of.The.Earth.1971 [03/29] - \"Morning.Of.The.Earth.1971.part02.rar\" yEnc\n\t\tif (preg_match('/^\\([a-zA-Z0-9].+?\\) ([a-zA-Z0-9.-]+) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[51/62] Morrissey.25.Live.Concert.2013.BDRip.x264-N0TSC3N3 - \"n0tsc3n3-morrissey.25.live.2013.bdrip.x264.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] (.+) - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //[AD120512-00006]-[UnOFFSc3n4iT]-[0131105] Chloe.Tra.Seduzione.E.Inganno.2009.iTALiAN.DVDRip.XviD-TRL [19/41] - \"trl-chltsdzn.part18.rar\" yEnc\n\t\tif (preg_match('/^\\[\\w+-\\w+\\]-\\[\\w+\\]-\\[\\d+\\] (.+) \\[\\d+\\/\\d+\\] - \".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Breathe.In.2013.BRRip.x264-4UN [01/39] - \"Breathe.In.2013.BRRip.x264-4UN.nfo\" yEnc\n\t\tif (preg_match('/^(.+x264.+) \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //The.CyB3rMaFiA.PimPs.YouR.RiDE.WiTH [REPACK] [40/42] - \"d2p5uypp7yn3drpk1080417.vol255+064.par2\" yEnc\n\t\tif (preg_match('/^(.+) \\[REPACK\\] \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //[ Oklahoma\\!.1955.720p.WEB-DL.AAC2.0.H.264-CtrlHD ]-[32/55] - \"Oklahoma.1955.720p.WEB-DL.AAC2.0.H.264-CtrlHD.part31.rar\" yEnc\n\t\tif (preg_match('/\\[ (.+WEB-DL.+) \\]-\\[\\d+\\/\\d+\\] - \"(.+)\\.(mp4|mkv|ts|rar|par.+)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //REQ: working copy of \"That Darn Cat 1997 Xvid-Any grp\" Plz Ty (47/60) \"geckos-ghr2011-xvid.r44\" - 744,19 MB - Gun.Hill.Road.2011.LIMITED.DVDRip.XviD-GECKOS yEnc\n\t\tif (preg_match('/^REQ:.+\".+\".+\\(\\d+\\/\\d+\\) \".+\" - \\d+[,.]\\d+ [MGK]B - (.+) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(T.U.F The real thing I Frankenstein 2014 NL Subs T.U.F) [01/52] - \"I Frankenstein 2014 NL Subs.par2\" yEnc\n\t\tif (preg_match('/^\\(T\\.U\\.F The real thing (.+?) T\\.U\\.F\\)/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(Ringside.The.Best.of.Mike.Tyson.DVDRip.x264.AC3-FCZ)[01/68] - \"Ringside.The.Best.of.Mike.Tyson.DVDRip.1.of.2.x264.AC3-FCZ.nfo\" yEnc\n\t\tif (preg_match('/^\\(([\\w.-]+)\\)\\[\\d+\\/(\\d+\\])[-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function classic_tv_shows()\n\t{\n\t\tif (preg_match('/^Re: REQ: (.+? - \".+?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Per REQ - \"The.Wild.Wild.West.S03E11.The.Night.of.the.Cut-Throats.DVDRip.XVID-tz.par2\" 512x384 [01/40] yEnc\n\t\tif (preg_match('/^Per REQ - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' .+? \\[\\d+\\/\\d+\\] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //By req: \"Dennis The Menace - 4x25 - Dennis and the Homing Pigeons.part05.rar\" yEnc\n\t\tif (preg_match('/^By req: \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //I Spy HQ DVDRips \"I Spy - 3x26 Pinwheel.part10.rar\" [13/22] yEnc\n\t\tif (preg_match('/^[a-zA-Z ]+HQ DVDRips \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' \\[\\d+\\/\\d+\\] yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Sledge Hammer! S2D2 [016/138] - \"SH! S2 D2.ISO.016\" yEnc\n\t\t//Sledge Hammer! S2D2 [113/138] - \"SH! S2 D2.ISO.1132 yEnc\n\t\t//Lost In Space - Season 1 - [13/40] - \"S1E02 - The Derelict.avi\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9].+? (S\\d+D\\d+|- Season \\d+))( -)? \\[\\d+\\/\\d+\\] - \".+?\"? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Night Flight TV Show rec 1991-01-12 (02/54) - \"night flight rec 1991-01-12.nfo\" yEnc\n\t\t//Night Flight TV Show rec 1991-05-05 [NEW PAR SET] (1/9) - \"night flight rec 1991-05-05.par2\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9].+? \\d{4}-\\d\\d-\\d\\d)( \\[.+?\\])? \\(\\d+\\/\\d+\\) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//The.Love.Boat.S05E08 [01/31] - \"The.Love.Boat.S05E08.Chefs.Special.Kleinschmidt.New.Beginnings.par2\" yEnc\n\t\t//Barney.Miller.S08E05.Stress.Analyzer [01/18] - \"Barney.Miller.S08E05.Stress.Analyzer.VHSTVRip.DivX.par2\" yEnc\n\t\tif (preg_match('/^[a-zA-Z0-9][a-zA-Z0-9.-]+S\\d+E\\d+([a-zA-Z0-9.]+)? \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Batman - S1E13-The Thirteenth Hat.par2\" yEnc\n\t\t//\"The Munsters - 1x01 Munster Masquerade.part.par\" HQ DVDRip[02/16] yEnc\n\t\tif (preg_match('/^(Re: )?\"(.+?)(\\.avi|\\.mkv)?' . $this->e0 .\n\t\t\t\t\t '( HQ DVDRip\\[\\d+\\/\\d+\\])? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//Re: Outside Edge series 1 - [01/20] - \"Outside Edge S01.nfo\" yEnc\n\t\t//Green Acres Season 1 [01/87] - \"Green Acres Season 1.par2\" yEnc\n\t\t//MASH Season 1 - [01/54] - \"MASH - Season 01.par2\" yEnc\n\t\tif (preg_match('/^(Re: )?[a-zA-Z0-9]+.+? (series|Season) \\d+ (- )?\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Rich.Little.Show - 1x12 - Season.and.Series.Finale - [02/33] - \"Rich Little Show - 1x12 - Bill Bixby.avi.002\" yEnc\n\t\t//Rich.Little.Show - 1x11 - [01/33] - \"Rich Little Show - 1x11 - Jessica Walter.avi.001\" yEnc\n\t\t//REQ - Banacek - 2x07 - [02/61] - \"Banacek - 2x07 - Fly Me - If You Can Find Me.avi.002\" yEnc\n\t\tif (preg_match('/^(REQ - )?[A-Z0-9a-z][A-Z0-9a-z.]+ - \\d+x\\d+ (- [A-Z0-9a-z.]+ )?- \\[\\d+\\/\\d+\\] - \"(.+?)(\\.avi|\\.mkv)?' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //Handyman Shows-TOH-S32E10 - File 01 of 32 - yEnc\n\t\tif (preg_match('/^Handyman Shows-(.+) - File \\d+ of \\d+ - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//'Mission: Impossible' - 1x09 - NTSC - DivX - 28 of 48 - \"MI-S01E09.r23\" yEnc\n\t\t//'Mission: Impossible' - 1x09 - NTSC - DivX - 01 of 48 - \"MI-S01E09.nfo\" (1/1)\n\t\tif (preg_match('/^([a-zA-Z0-9 -_\\.:]+) - \\d+( of \\d+)[-_\\s]{0,3}\".+?' . $this->e0 .\n\t\t\t\t\t ' (\\(\\d+\\/\\d+\\) )?(yEnc)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//\"Batman - S2E58-Ice Spy.par2\"yEnc\n\t\t//\"Black Sheep Squadron 1x03 Best Three Out of Five.par2\"\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '(yEnc)?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Guns of Will Sonnett - 1x04.mp4\" (Not My Rip)Guns Of Will Sonnett Season 1 1 - 26 Mp4 With Pars yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\(Not My Rip\\).+ \\d+ (- \\d+) .+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(01/10) \"Watch_With_Mother-Bill_And_Ben-1953_02_12-Scarecrow-VHSRip-XviD.avi\" - 162.20 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[.,]\\d+ [kKmMgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//(Our Gang - Little Rascals DVDRips) \"Our Gang - The Lucky Corner (1936).part0.sfv\" [01/19] yEnc\n\t\t//(Our Gang - Little Rascals DVDRips) \"Our Gang - Wild Poses (1933).part.par\" [02/20] Last One I Have! yEnc\n\t\tif (preg_match('/^\\(.+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\[\\d+\\/(\\d+\\]) (Last One I Have! )?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[EnJoY] =>A Blast from Usenet Past (1/3)<= [00/14] - \"Mcdonalds Training Film - 1972 (Vhs-Mpg).part.nzb\" yEnc\n\t\tif (preg_match('/^.+ Usenet Past .+\\[\\d+\\/(\\d+\\]) - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //<OPA_TV> [01/12] - \"Yancy Derringer - 03 - Geheime Fracht.par2\" yEnc\n\t\tif (preg_match('/^<OPA_TV> \\[\\d+\\/(\\d+\\]) - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//77 Sunset Strip 409 [1 of 23] \"77 Sunset Strip 409 The Missing Daddy Caper.avi.vol63+34.par2\" yEnc\n\t\t//Barney.Miller.NZBs [001/170] - \"Barney.Miller.S01E01.Ramon.nzb\" yEnc\n\t\tif (preg_match('/^.+ [\\[\\(]\\d+( of |\\/)(\\d+[\\]\\)])[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t}\n\t\t//All in the Family - missing eps - DVDRips \"All in the Family - 6x23 Gloria & Mike's House Guests.part5.rar\" [08/16] yEnc\n\t\t//Amos 'n' Andy - more shows---read info.txt \"Amos 'n' Andy S01E00 Introduction of the Cast.mkv.001\" (002/773) yEnc\n\t\tif (preg_match('/^.+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' [\\[\\(]\\d+\\/(\\d+[\\]\\)]) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Andy Griffith Show,The 1x05....Irresistible Andy - (DVD).part04.rar\n\t\tif (preg_match('/^(.+\\d+x\\d+.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})( yEnc)?( (Series|Season) Finale)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function findMovie(Request $request)\n {\n /* $movie = Movie::where(['name' => $request->input('name')])->firstOrFail(); */\n //Not matching an exact name\n $movie = Movie::where('name', 'LIKE', \"%{$request->input('name')}%\")->firstOrFail();\n return view('search.result', ['movie'=> $movie, 'trailer'=> $this->apiRequest($movie)]);\n }", "public function get($id) {\n\t\t$sql = <<<SQL\nselect * from $this->tableName\nwhere id=?\nSQL;\n\n\t\t$stmt = $this->pdo()->prepare($sql);\n\t\t$stmt->execute(array($id));\n\n\t\t$movies = array();\n\t\t$row = $stmt->fetch(\\PDO::FETCH_ASSOC);\n\t\tif($row === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new Movie($row);\n\t}", "public function movies(Request $request)\n {\n $query = $request->has('query') ? $request->get('query') : '';\n $page = $request->has('page') ? $request->get('page') : 1;\n\n /** @var $item */\n $item = $this->api->searchMovies($query, ['page' => $page]);\n\n if (!$item) {\n abort(404, \"The genre $query is not found.\");\n }\n\n // returns information of a genre\n return response($item);\n }", "public function show($id)\n {\n $movie = Movie::find($id);\n\n if (!$movie) {\n return $this->notFoundResponse( $id );\n }\n\n return $this->successResponse( $movie, 'Retrieved.');\n }", "function get_video_attributes($video) {\n\n $command = 'ffmpeg -i ' . $video . ' -vstats 2>&1';\n\n Log::info(\"Path \".$video);\n\n $output = shell_exec($command);\n\n Log::info(\"Shell Exec : \".$output);\n\n\n $codec = null; $width = null; $height = null;\n\n $regex_sizes = \"/Video: ([^,]*), ([^,]*), ([0-9]{1,4})x([0-9]{1,4})/\";\n\n Log::info(\"Preg Match :\" .preg_match($regex_sizes, $output, $regs));\n if (preg_match($regex_sizes, $output, $regs)) {\n $codec = $regs [1] ? $regs [1] : null;\n $width = $regs [3] ? $regs [3] : null;\n $height = $regs [4] ? $regs [4] : null;\n }\n\n $hours = $mins = $secs = $ms = null;\n \n $regex_duration = \"/Duration: ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}).([0-9]{1,2})/\";\n if (preg_match($regex_duration, $output, $regs)) {\n $hours = $regs [1] ? $regs [1] : null;\n $mins = $regs [2] ? $regs [2] : null;\n $secs = $regs [3] ? $regs [3] : null;\n $ms = $regs [4] ? $regs [4] : null;\n }\n\n Log::info(\"Width of the video : \".$width);\n Log::info(\"Height of the video : \".$height);\n\n return array('codec' => $codec,\n 'width' => $width,\n 'height' => $height,\n 'hours' => $hours,\n 'mins' => $mins,\n 'secs' => $secs,\n 'ms' => $ms\n );\n}", "function getMov($url, $width, $height) {\r\n\t\t$url = trim($url);\r\n\t\t$url = str_replace('http://', '', $url);\r\n\t\r\n\t\t$height = $height+16;\r\n $video = '<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"'.$width.'\" height=\"'.$height.'\" >\r\n <param name=\"src\" value=\"http://'.$url.'\">\r\n <param name=\"autoplay\" value=\"true\">\r\n <param name=\"type\" value=\"video/quicktime\" width=\"'.$width.'\" height=\"'.$height.'\"> \r\n <embed src=\"http://'.$url.'\" width=\"'.$width.'\" height=\"'.$height.'\" autoplay=\"false\" type=\"video/quicktime\" pluginspage=\"http://www.apple.com/quicktime/download/\">\r\n </object>';\r\n return $video;\r\n\t}", "function get_last_movie($owner_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_last_movie' => true, //a flag to execute the right code in App-Logic! \n 'owner_id' => $owner_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "function pageController($allMovies)\n{\n\n // If $_GET['genre'] holds 'adventure', make $movies hold movies with 'adventure' as a genre.\n\n $data = [];\n // var_dump($_GET);\n\n if(isset($_GET['genre'])) {\n $genre = $_GET['genre'];\n $movies = [];\n\n foreach($allMovies as $movie) {\n if(in_array($genre, $movie['genre'])){\n $movies[] = $movie;\n //sets the search to pull all movies in the movie array set to the genre specified(by user - $genre provides doesn't hardcode the function to a specific genre)\n }\n //refer to needle/haystack concept\n }\n $data['movies'] = $movies; \n\n } elseif(isset($_GET['release'])) {\n $release = $_GET['release'];\n $movies = [];\n\n foreach($allMoveies as $movie) {\n if (in_array($release, $movie['release'])) {\n $movies[] = $movie;\n } \n }\n $data['movies'] = $movies;\n \n } else {\n $data['movies'] = $allMovies;\n }\n // set $data['movies'] to hold all movies (unless another request is made.)\n $data['movies'] = $allMovies;\n\n return $data;\n\n}", "private function findMovie(string $name): Movie\n {\n $movie = $this->movieRepository->showByName($name);\n\n if ($movie === null)\n {\n throw new NoResourceException('Movie does not exist');\n }\n\n return $movie;\n }", "public function show($id)\n {\n return response()->json( movies::findOrFail($id) );\n }", "function readFileName($inputFile) {\n\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n\n $mime_type = finfo_file($finfo, $inputFile); // check mime type\n\n finfo_close($finfo);\n\n $video_attributes = [];\n \n if (preg_match('/video\\/*/', $mime_type)) {\n\n Log::info(\"Inside ffmpeg\");\n\n $video_attributes = get_video_attributes($inputFile, 'ffmpeg');\n } \n\n return $video_attributes;\n}", "function findMatches($content){\n\n\t\t$videos = array();\n\t\t$data = \"\";\n\t\t$cdata = \"\";\n\t\t$xdata = \"\";\n\t\t$sig = \"\";\n\t\t$url = \"\";\n\t\t$type = \"\";\n\n\t\t// Break page into pieces and run regex's to find and build download links.\n\t\t// Note: $results is an array.\n\t\tif(preg_match('/url_encoded_fmt_stream_map(.*?);/', $content, $results)){\n\n\t\t\t$data = \"\";\n\n\t\t\t// $results[0]=the text that matched the full pattern\n\t\t\t// $results[1]=the text matching the first subpattern\n\t\t\t// $results[2]=the text matching the second subpattern (n/a)\n\t\t\t$data = $results[1];\n\n\t\t\t// Literally replace the characters '\\u0026' with an '&'.\n\t\t\t$data = str_replace('\\u0026', '&', $data);\n\t\t\t\n\t\t\t// Convert $data to an array by splitting on ','.\n\t\t\t$data = explode(',', $data);\n\n\t\t\tforeach($data As $cdata){\n\n\t\t\t\t// Break each element in the $data array into an array.\n\t\t\t\t$cdata = explode('&', $cdata);\n\n\t\t\t\t// The $cdata array should have exactly 5 elements if it is an applicable URL.\n\t\t\t\tif (sizeof($cdata) === 5) {\n\n\t\t\t\t\tif (DEBUG === 1) {\n\t\t\t\t\t\techo \"<b>\";\n\t\t\t\t\t\techo \"<br><br>\";\n\t\t\t\t\t\techo \"CDATA\" . \"<br>\";\n\t\t\t\t\t\techo \"<pre>\";\n\t\t\t\t\t\tprint_r($cdata);\n\t\t\t\t\t\techo \"</pre>\";\n\t\t\t\t\t\techo \"</b>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// For each element in the $cdata array...\n\t\t\t\t\tforeach($cdata As $xdata){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Sometimes this is found as the first three characters of an element: \":\"\n\t\t\t\t\t\t// Check for it by seeing if first character is '\"'.\n\t\t\t\t\t\t// If so, remove those three characters.\n\t\t\t\t\t\tif ($xdata[0] === '\"') {\n\t\t\t\t\t\t\t$xdata = substr($xdata, 3);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Look for signature.\n\t\t\t\t\t\tif(preg_match('/^sig/', $xdata)){\n\t\t\t\t\t\t\t$sig = substr($xdata, 4);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Look for URL.\n\t\t\t\t\t\tif(preg_match('/^url/', $xdata)){\n\t\t\t\t\t\t\t$url = substr($xdata, 4);\n\t\t\t\t\t\t\t$url = urldecode($url);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (DEBUG === 1) {\n\t\t\t\t\t\t\t\techo \"<b>\" . \"URL: \" . $url . \"<br>\" . \"</b>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Look for video type.\n\t\t\t\t\t\tif(preg_match('/^itag/', $xdata)){\n\t\t\t\t\t\t\t$type = substr($xdata, 5);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// If $type is not a known video type, change it to type '0' (unknown)\n\t\t\t\t\t\t\tif (!array_key_exists($type, $this->videoMap)) {\n\t\t\t\t\t\t\t\t$type = \"0\";\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (DEBUG === 1) {\n\t\t\t\t\t\t\t\techo \"<b>\" . \"<br>\" . \"TYPE: \" . $type . \"<br>\" . \"</b>\";\n\t\t\t\t\t\t\t\techo \"<br><br>\";\n\t\t\t\t\t\t\t\t//echo \"<hr>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//$url = $url . '&signature=' . $sig;\n\t\t\t\t\t$videos[$this->videoMap[$type][0]][$this->videoMap[$type][1]] = $url;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $videos;\n\t}", "function info( $args, $assoc_args ) {\n\t\t$video = new MBInfoVideo();\n\t\t$content = $args[0];\n\t\t$html = $video->parse_short_code($assoc_args, $content);\n\t\techo $html;\n\t}", "function getName(string $url) {\r\n $playersdata = array();\r\n \r\n //Load the HTML from the site\r\n $html = file_get_contents($url);\r\n $dom_document = new DOMDocument();\r\n libxml_use_internal_errors(true);\r\n $dom_document->loadHTML($html);\r\n \r\n \r\n //use DOMXpath to navigate the html with the DOM\r\n $dom_xpath = new DOMXpath($dom_document);\r\n \r\n // if you want to get the div with id=interestingbox\r\n $elements = $dom_xpath->query(\"//*[@id = 'title']\");\r\n \r\n if (!is_null($elements) && $elements->length > 0) {\r\n foreach ($elements as $element) {\r\n \r\n $nodes = $element->childNodes;\r\n foreach ($nodes as $node) {\r\n return trim($node->nodeValue);\r\n }\r\n }\r\n }\r\n else \r\n return \"\";\r\n}", "public function test_get_movie_by_id()\n {\n $movie = Movie::first();\n\n $this->get( route('v1.movie.show', ['id' => $movie->id ] ) );\n\n $this->response->assertJson([\n 'success' => 'Movie Found'\n ])->assertStatus(200);\n\n }", "public function getGenre(){\n return $this->film['genre'];\n }", "public function getModelsFromMoviesID($movieID) {\n $sampleSQL= \"SELECT * FROM `movies_models`\n WHERE movieID IN (12297, 12298, 12299) ;\";\n return \"{$movieID},\";\n }", "function fsgs_local_navigation_get_string($string) {\n $title = $string;\n $text = explode(',', $string, 2);\n if (count($text) == 2) {\n // Check the validity of the identifier part of the string.\n if (clean_param($text[0], PARAM_STRINGID) !== '') {\n // Treat this as atext language string.\n $title = get_string($text[0], $text[1]);\n }\n } \n return $title;\n}", "function parseXML($xmll) {\n\t//Can return an array with the values...which is what it currently does.\n\n//defaults\n\t$movie['title']='';\n\t$movie['year']='';\n\t$movie['rated']=0;\n\t$movie['released']=\"1 Jan 1970\";\n\t$movie['runtime']=\"0 h 0 min\";\n\t$movie['genre']='';\n\t$movie['director']='';\n\t$movie['writer']='';\n\t$movie['actors']='';\n\t$movie['plot']='';\n\t$movie['poster']='';\n\t$movie['imdbRating']=0;\n\t$movie['imdbVotes']=0;\n\t$movie['imdbID']='';\n\t$movie['type']='';\n\n\t$xml = new SimpleXMLElement($xmll);\n\t$movie['title']=$xml->movie['title'];\n\t$movie['year']=$xml->movie['year'];\n\t$movie['rated']=$xml->movie['rated'];\n\t$movie['released']=$xml->movie['released'];\n\t$movie['runtime']=$xml->movie['runtime'];\n\t$movie['genre']=$xml->movie['genre'];\n\t$movie['director']=$xml->movie['director'];\n\t$movie['writer']=$xml->movie['writer'];\n\t$movie['actors']=$xml->movie['actors'];\n\t$movie['plot']=$xml->movie['plot'];\n\t$movie['poster']=$xml->movie['poster'];\n\t$movie['imdbRating']=$xml->movie['imdbRating'];\n\t$movie['imdbVotes']=$xml->movie['imdbVotes'];\n\t$movie['imdbID']=$xml->movie['imdbID'];\n\t$movie['type']=$xml->movie['type'];\n\n\tif ((string)$movie['imdbRating'] === 'N/A') { $movie['imdbRating'] = 0; }\n\tif ((string)$movie['released'] === 'N/A') { $movie['released'] = NULL; }\n\tif ((string)$movie['runtime'] === 'N/A') { $movie['runtime'] = \"0 h 0 min\"; }\n\tif ((string)$movie['rated'] === 'N/A') { $movie['rated'] = 0; }\n\n\t$runtime = explode(\" \", $movie['runtime']);\n\t$movie['runtime'] = ($runtime[0]*60) + $runtime[2];\n\n\n\treturn $movie;\n}", "public function get ($string){\n\t\t$url = $this->target_server.$string;\n\t\t$result = file_get_contents($url);\n\t\treturn $result;\n\t}" ]
[ "0.6463239", "0.59844595", "0.5968494", "0.5854798", "0.5734729", "0.5726442", "0.5692581", "0.5684597", "0.5640007", "0.5587775", "0.55755264", "0.55613106", "0.5544933", "0.55266213", "0.55266213", "0.55053025", "0.5492138", "0.5454658", "0.54163796", "0.5406832", "0.5404731", "0.5393675", "0.5343914", "0.5324445", "0.53098977", "0.53097445", "0.52943945", "0.5284611", "0.5252939", "0.5248683", "0.52407336", "0.5238716", "0.52012414", "0.51905453", "0.51828754", "0.51625514", "0.51625514", "0.5160246", "0.514677", "0.5134831", "0.5116388", "0.510791", "0.5099822", "0.50942665", "0.5077486", "0.5045446", "0.50270754", "0.5024616", "0.5018844", "0.4989851", "0.4987509", "0.49790278", "0.49781537", "0.49768808", "0.49734244", "0.49697036", "0.49691334", "0.49649766", "0.49641377", "0.49592185", "0.49547014", "0.49522358", "0.49367923", "0.4936225", "0.493501", "0.49275896", "0.49247238", "0.4912293", "0.48987725", "0.48952904", "0.48868605", "0.48782024", "0.4873383", "0.48704448", "0.4864239", "0.4861211", "0.4847917", "0.48405984", "0.4817753", "0.48173118", "0.47906563", "0.47859827", "0.47768596", "0.4775215", "0.477338", "0.47717863", "0.47691235", "0.47658414", "0.47648615", "0.4764209", "0.47619015", "0.475946", "0.4757282", "0.4751164", "0.47503856", "0.47475156", "0.47441894", "0.4741282", "0.4739571", "0.47392204" ]
0.7809437
0
/ Method of abstract class DbModel. Get the entity table name.
public function getTable() { return "general_activity_has_relation_product_discount"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTableName(): string\n {\n return $this->getEntityDao()->getTableName();\n }", "public static function getTableName()\n\t{\n\t\t//called from users, keyword self:: returns model\n\t\t// return self::$table;\n\t\t//called from users, keyword static:: returns users\n\t\treturn static::$table;\n\t}", "public function getTable($entityName)\n {\n $tableName = '';\n //echo $entityName. '<br/>';\n\n if (strpos($entityName, '/')) {\n $modelEntity = $entityName;\n $tableName = $this->_resources->getTableName($modelEntity);\n }\n else if( !empty($this->_resourceModel) ) {\n $entityName = sprintf('%s/%s', $this->_resourceModel, $entityName);\n $tableName = $this->_resources->getTableName($entityName);\n }\n else {\n $tableName = $entityName;\n }\n\n return $tableName;\n }", "protected function getTableName(): string {\n return self::TABLE_NAME;\n }", "public static function getTableName()\n {\n return _DB_PREFIX_ . self::$definition['table'];\n }", "public function getTableName()\n {\n return $this->__get(\"table_name\");\n }", "private static function get_table_name() {\n\n $class = get_called_class();\n\n return strtolower($class);\n\n }", "public static function getTableName() {\n return self::$tableName;\n }", "public function getTableName() ;", "public function get_table_name(){\n return $this->table_name();\n }", "public static function getTableName(){\n\t\treturn self::$table_name;\n\t}", "public static function getTableName()\n {\n $type = static::getType();\n return $type::getTableName();\n }", "protected function getTableName () {\n $class = explode('\\\\', get_class($this));\n\n return strtolower(end($class));\n }", "public static function getTableName()\n {\n return self::getDatabaseName() . '.' . self::NAME;\n }", "function getTableName()\r\n\t{\r\n\t\tif ( $this->table == null ) return (null );\r\n\t\treturn( $this->table->table_name());\r\n\t}", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public function getTableName()\r\n {\r\n return $this->tableName;\r\n }", "public function getTableName(){\r\n\t\treturn strtolower(get_class($this));\r\n\t}", "public function getTableName()\n {\n return $this->tableName;\n }", "abstract public static function getTableName();", "abstract public static function getTableName();", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName()\n {\n return $this->tableName;\n }", "public function getTableName() {}", "public function getTableName() {}", "public function getTableName() : string\n {\n if ($this->tableName !== null) {\n return $this->tableName;\n }\n\n return $this->reflectionClass->getShortName();\n }", "function table_name() {\n\t\tif ($this->table) {\n\t\t\treturn $this->table;\n\t\t} else {\n\t\t\treturn $this->_get_type();\n\t\t}\n\n\t}", "public function getTableName(): string;", "public function getTableName(): string;", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "public function getTableName();", "public function getTableName();", "public function getTableName() {\n\t\treturn $this -> _name;\n\t}", "public static function getTableName()\n\t{\n\t\treturn 'b_timeman_monitor_entity';\n\t}", "public static function getTableName()\n {\n return self::getConfig()->get('scheme/tableName');\n }", "public static function getTableName()\n {\n return ((new self)->getTable());\n }", "public function getTableName()\n\t{\n\t\treturn $this->tableName;\n\t}", "function getTableName() {\n return $this->tableName;\n }", "public static function getTableName()\n\t{\n\t\treturn 'b_sale_entity_marker';\n\t}", "public function getTableName() {\n\t\treturn $this->tableName;\n\t}", "public function getTableName() {\n\t\treturn $this->tableName;\n\t}", "public function getTableName(){\n\t\treturn $this->tableName;\n\t}", "public function _tablename() {\n if (isset($this->_table) && !isNull($this->_table)) {\n return $this->_table;\n } else {\n return camel_case_to_underscore(get_class($this));\n }\n }", "function getTableName(): string;", "abstract protected function getTableName();", "abstract protected function getTableName();", "private function getTableName($model){\n\n if(property_exists($model, 'tablename')){\n return \\Larubel\\Libs\\Helpers\\Helper::getValueFromClassProperty($model, 'tablename');\n }\n\n // if given class has no propery name 'tablename' \n // then generate a generic table name adding 's' at end with model \n return strtolower(\\Larubel\\Libs\\Helpers\\Helper::splitStringLast($model, '\\\\')) . 's';\n }", "public static function get_table_name()\n {\n return self::TABLE_NAME;\n }", "public function get_table_name() {\n return $this->table_name;\n }", "public function getTableName()\n {\n return $this->_tableName;\n }", "public function getTableName( )\n {\n return $this->table_name;\n }", "public function get_table_name()\n {\n return $this->prefix . $this->table;\n }", "public function getTableName()\n {\n return $this->table_name;\n }", "public static function tablename() {\n return self::TABLE;\n }", "public function getTableName(){\n\t\t $table = get_class($this);\n\t\treturn strtolower(substr($table, strripos($table, \"\\\\\")+1));\n\t}", "public function getTableName():string;", "public static function table()\n\t{\n\t\treturn self::em()->getRepository(static::class)->getMetadata()->getTable();\n\t}", "public function getTableName(){\n return $this->tableName;\n }", "public function getTableName(){\n\t\treturn $this->_table;\n\t}", "public function getTableName() {\n\t\t$table = strtolower(get_called_class());\n\t\tif ($table == 'person')\n\t\t\treturn 'people';\n\t\tswitch (substr($table, -1)) {\n\t\t\tcase 'y': return substr($table, 0, -1) . 'ies';\n\t\t\tcase 's': return $table . 'es';\n\t\t}\n\t\treturn $table . 's';\n\t}", "public function getTable()\n {\n if (isset($this->table)) {\n return $this->table;\n }\n return str_replace('\\\\', '', Str::snake(Str::singular(class_basename($this))));\n }", "private function getTableName()\n {\n $class = get_class($this);\n\n $mem = new Cache();\n if ($tableName = $mem->get($class . '-table-name')) {\n return $tableName;\n }\n\n $break = explode('\\\\', $class);\n $ObjectName = end($break);\n $className = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $ObjectName));\n $tableName = Inflect::pluralize($className);\n\n $mem->add($class . '-table-name', $tableName, 1440);\n\n return $tableName;\n }", "public function getTableName()\n {\n if ($this->tableName) {\n return $this->tableName;\n }\n\n return $this->namingStrategy->classToTableName($this->name);\n }", "public function table_name()\n\t{\n\t\treturn $this->table_name;\n\t}", "public function tableName()\n\t{\n\t\treturn '{{'.$this->getTableName().'}}';\n\t}", "public function getTableName()\n {\n return $this->_name;\n }", "public function getTableName()\n {\n return $this->_name;\n }", "public function getTableName()\n {\n return $this->_name;\n }", "protected function table(): string\n {\n return $this->tableName;\n }", "public function getTable()\n\t{\n\t\treturn empty($this->table) ? $this->table = Db_Inflector::pluralize($this->getSingular()) : $this->table;\n\t}", "public function getTableName() {\n if (isset($this->table)) {\n return $this->table;\n } else return $this->name;\n }", "public function getTableName()\n\t{\n\t\treturn $this->getPrefix().$this->tableName;\n\t}", "public function getTable()\n {\n if (! isset($this->table)) {\n return str_replace('\\\\', '', Str::snake(Str::plural(class_basename($this))));\n }\n\n return $this->table;\n }", "protected static function get_table_name() {\n return null;\n }", "public function getTblName()\n {\n return $this->tbl_name;\n }", "public function getTableName() {\n\t\t$dbName = empty($this->_dbName) ? '' : ($this->_dbName . '.');\n\t\t$tableName = $dbName . $this->_tableName;\n\t\treturn ($tableName);\n\t}", "public function table() {\n\t\treturn static::$table ?: strtolower(Str::plural(class_basename($this)));\n\t}", "public function getTable()\n {\n if (isset($this->table)) {\n return $this->table;\n }\n\n return str_replace('\\\\', '', Str::snake(Str::plural(class_basename($this))));\n }", "public function getTable() {\n if ( isset( $this->table ) ) {\n return $this->table;\n }\n\n $table = str_replace( '\\\\', '', snake_case( str_plural( class_basename( $this ) ) ) );\n\n return $this->getConnection()->db->prefix . $table ;\n }", "final public function getTableName()\n\t\t{\n\t\t\treturn $this->_tableName;\n\t\t}", "public function getTableName() {\n return $this->mapping['table'];\n }", "public function getTable(): string\n {\n return $this->_table;\n }", "protected function table () : string {\n return $this->guessName();\n }", "public function getTableName() {\n return $this->table;\n }", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "public function getTable(): string\n {\n return $this->table;\n }", "public function getTable(): string\n {\n return $this->table;\n }", "public function getTable($model=null) {\n\t\tif (is_null($model)) {\n\t\t\t$model = $this->model;\n\t\t}\n\t\treturn $model::getTableName();\n\t}", "public function getTableKeyName()\r\n\t{\r\n\t\treturn \"id\".$this->getTableName();\r\n\t}", "public function getTableSingular()\n {\n if (($table = Str::snake(class_basename($this))) == 'model' && $this->table) {\n $table = Str::singular($this->table);\n }\n\n return $table;\n }", "protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}", "public function getTable()\n\t{\n\t\tif (isset($this->table)) return $this->table;\n\n\t\treturn $this->table = str_replace('\\\\', '', snake_case(str_plural(class_basename($this))));\n\t}", "private static function getTableName() {\n return get_called_class();\n }", "public static function getTableName()\n {\n return Str::snake(Str::pluralStudly(class_basename(get_called_class())));\n }", "public function getTableKeyName()\n\t{\n\t\treturn \"id\".$this->getTableName();\n\t}" ]
[ "0.8248543", "0.7787189", "0.77653664", "0.7736519", "0.7721605", "0.7668768", "0.7663232", "0.7636931", "0.7620625", "0.7606585", "0.7603635", "0.760249", "0.7592529", "0.75905365", "0.7573017", "0.757155", "0.757155", "0.757155", "0.756814", "0.75680995", "0.7554696", "0.7552427", "0.7552427", "0.75512594", "0.75512594", "0.75512594", "0.75512594", "0.7549778", "0.7549778", "0.7546414", "0.7537667", "0.7537575", "0.7537575", "0.7531927", "0.7531927", "0.7531927", "0.7515725", "0.7515725", "0.75154644", "0.75087464", "0.75075173", "0.7493501", "0.7482467", "0.7482211", "0.7478974", "0.74754786", "0.74754786", "0.74658304", "0.7462409", "0.7459782", "0.7456333", "0.7456333", "0.7451838", "0.74443173", "0.7439876", "0.74369067", "0.7431352", "0.7422828", "0.74186796", "0.7414111", "0.7412422", "0.7409014", "0.7393502", "0.7385084", "0.7378094", "0.7372579", "0.73715425", "0.73529845", "0.73476386", "0.7344441", "0.7338131", "0.73370594", "0.73370594", "0.73370594", "0.73338217", "0.73305756", "0.7327287", "0.7327134", "0.73269725", "0.7325457", "0.7324943", "0.73131853", "0.73101443", "0.7302708", "0.72949404", "0.7283167", "0.7280531", "0.7271559", "0.7247368", "0.7246034", "0.7235415", "0.72348785", "0.72348785", "0.72284925", "0.72276694", "0.72228366", "0.72201085", "0.7218392", "0.72143775", "0.72071457", "0.7205019" ]
0.0
-1
Check attributes is valid.
public function validAttributes($attributes) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function validate_attributes()\n {\n foreach (static::$object_attributes as $key => $value) {\n if (!isset($this->{$key})) {\n Error::set(Error::ERROR_MISSING_ATTRIBUTE, [$key], Error::ERROR);\n }\n }\n\n return true;\n }", "public function validate($attributes);", "protected function validateAttributes(): void\n {\n if (empty($this->getRules())) {\n return;\n }\n\n if (! $this->validate()) {\n throw (new FilterDataValidationFailedException())\n ->setMessages($this->messages());\n }\n }", "function areAttributesValid($request) : bool{\n foreach($request->getAttributes() as $key => $value)\n if(!is_numeric($value)) return false;\n return true;\n}", "public function checkAttributes($attributes = array())\n {\n return (\n $this->modelAcceptsAttributes($attributes, $this->getModelAttributes()) &&\n $this->modelNonNullableAttributesSet($attributes, $this->getModelAttributes()) &&\n $this->checkMajorFormatsAreValid($attributes, $this->getModelAttributes()) &&\n $this->avoidDuplicationOfUniqueData($attributes, $this->getModelAttributes(), $this->getModelClassName())\n == true ) ? :false;\n\n }", "public function validAttributes($attributes) {\n if(array_key_exists(\"id\", $attributes)) {\n throw new Exception(\"Can't write the attribute 'id'.\");\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['attribute_type'] === null) {\n return false;\n }\n if ($this->container['numeric_value'] === null) {\n return false;\n }\n if ($this->container['date_value'] === null) {\n return false;\n }\n if ($this->container['flag_value'] === null) {\n return false;\n }\n if ($this->container['is_error_value'] === null) {\n return false;\n }\n return true;\n }", "protected function verifyAttributes()\n {\n $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']);\n $fixtureOptions = $this->prepareFixtureOptions();\n $errors = $this->verifyData($fixtureOptions, $formOptions, true, false);\n return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:');\n }", "protected function _validateAttributeInfo(&$info)\n\t{\n\t\tif(count($info['options']) > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function _check_valid_attr($string) {\n\t\t\n\t\t$result = true;\n\t\t\n\t\t// Check $name for correct characters\n\t\t// \"^[a-zA-Z0-9_-]*$\"\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "protected function isValid()\n {\n foreach (static::$requiredFields as $field) {\n if (! isset($this->attributes[$field]) || ! $this->attributes[$field] ) {\n return false;\n }\n }\n\n if (! $this->volumes) {\n return false;\n }\n\n return true;\n }", "function attribute_validation($attribute) {\n\n /* Checks each attribute individually to make sure it is a valid string */\n foreach ($attribute as $value) {\n\n $numbers = '0123456789';\n\n /* Checks to make sure the value is a string and that there are no numbers contained in the string */\n if (!is_string($value) || (strcspn($value, $numbers) != strlen($value))) {\n\n//echo \"strcspn:\".strcspn($value, $numbers).\" strlen:\".strlen($value);\n $errorMessage = \"Sorry \" . $value . \" is not a valid attribute\";\n echo $errorMessage;\n echo \"\\n\";\n\n $errorLog = new ErrorFileHandler($this->logfile);\n $errorLog->add_to_error_log($errorMessage);\n\n return false;\n }\n }\n\n return true;\n }", "public function valid()\n {\n\n if (strlen($this->container['virtual_operator']) > 60) {\n return false;\n }\n if (strlen($this->container['event_type']) > 100) {\n return false;\n }\n if (strlen($this->container['result_status']) > 100) {\n return false;\n }\n if (strlen($this->container['username']) > 100) {\n return false;\n }\n if (strlen($this->container['property_value']) > 450) {\n return false;\n }\n return true;\n }", "public function getValidAttribute()\n {\n if (!$this->active) {\n app()->make('error')->code(2016);\n }\n\n if (!$this->credentials OR !$this->credentials->count()) {\n app()->make('error')->code(2022);\n }\n\n return true;\n }", "protected function validateAttribute($object, $attribute) {\n \n }", "private function checkAttribute($attr)\n {\n if (! in_array($attr, $this->attributeNames)) {\n throw new BadFunctionCallException(\"Attribute '$attr' doesn't exist for the entity type '$this->entityType'.\");\n }\n }", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function hasAttributes() {\n return $this->_has(24);\n }", "public function ContainsEmptyAttribute()\n {\n foreach(self::$attributes as $attribute)\n {\n if($this->$attribute == '')\n {\n $this->_error = 'All attributes cannot be empty';\n return true;\n }\n }\n \n return false;\n }", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n if ($this->container['brightness'] === null) {\n return false;\n }\n if ($this->container['contrast'] === null) {\n return false;\n }\n if ($this->container['gammaCorrection'] === null) {\n return false;\n }\n if ($this->container['grayscale'] === null) {\n return false;\n }\n return true;\n }", "function validate() {\n\t\t$this->_validationErrors = array();\n\t\tif (null === $this->getsession_id()) {\n\t\t\t$this->_validationErrors[] = 'session_id must not be null';\n\t\t}\n\t\tif (null === $this->getclassroom_id()) {\n\t\t\t$this->_validationErrors[] = 'classroom_id must not be null';\n\t\t}\n\t\tif (null === $this->getname()) {\n\t\t\t$this->_validationErrors[] = 'name must not be null';\n\t\t}\n\t\treturn 0 === count($this->_validationErrors);\n\t}", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['business_unit_id'] === null) {\n return false;\n }\n return true;\n }", "abstract protected function mustApplyRuleOnAttribute(): bool;", "public function isAttributeValid($attrCode, array $attrParams, array $rowData, $rowNum)\n {\n switch ($attrParams['type']) {\n case 'varchar':\n $val = Mage::helper('core/string')->cleanString($rowData[$attrCode]);\n $valid = Mage::helper('core/string')->strlen($val) < self::DB_MAX_VARCHAR_LENGTH;\n break;\n case 'decimal':\n $val = trim($rowData[$attrCode]);\n $valid = (float)$val == $val;\n break;\n case 'select':\n case 'multiselect':\n $valid = isset($attrParams['options'][strtolower($rowData[$attrCode])]);\n break;\n case 'int':\n $val = trim($rowData[$attrCode]);\n $valid = (int)$val == $val;\n break;\n case 'datetime':\n $val = trim($rowData[$attrCode]);\n $valid = strtotime($val) !== false\n || preg_match('/^\\d{2}.\\d{2}.\\d{2,4}(?:\\s+\\d{1,2}.\\d{1,2}(?:.\\d{1,2})?)?$/', $val);\n break;\n case 'text':\n $val = Mage::helper('core/string')->cleanString($rowData[$attrCode]);\n $valid = Mage::helper('core/string')->strlen($val) < self::DB_MAX_TEXT_LENGTH;\n break;\n default:\n $valid = true;\n break;\n }\n\n if (!$valid) {\n $this->addRowError(Mage::helper('importexport')->__(\"Invalid value for '%s'\"), $rowNum, $attrCode);\n } elseif (!empty($attrParams['is_unique'])) {\n if (isset($this->_uniqueAttributes[$attrCode][$rowData[$attrCode]])) {\n $this->addRowError(Mage::helper('importexport')->__(\"Duplicate Unique Attribute for '%s'\"), $rowNum, $attrCode);\n return false;\n }\n $this->_uniqueAttributes[$attrCode][$rowData[$attrCode]] = true;\n }\n return (bool) $valid;\n }", "public function hasAttributes() {\n return $this->_has(15);\n }", "public function hasAttributes() {\n return $this->_has(15);\n }", "public static function checkMassAssignment(array $attributes);", "public function validate(): bool\n {\n foreach ($this->rules() as $attribute => $rules) {\n\n $value = $this->{$attribute};\n //We loop twice because some rules have array rules within them\n foreach ($rules as $rule) {\n /* If $rule is a string take the $rule and assign it to to $ruleName*/\n $ruleName = $rule;\n /* If $rule is not a string i.e an array, take the first element of the array i.e.\n *$rule[0] and assign it to to $ruleName\n */\n if(!is_string($rule))\n {\n $ruleName = $rule[0];\n }\n /*\n * If any attribute has a rule required and no value exists, add an error to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n if($ruleName === self::RULE_REQUIRED && !$value)\n {\n $this->addErrors($attribute, self::RULE_REQUIRED);\n }\n /*\n * If any attribute has a rule email and the value does not pass as valid email, add to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n\n if($ruleName === self::RULE_EMAIL && !filter_var($value, FILTER_VALIDATE_EMAIL))\n {\n $this->addErrors($attribute, self::RULE_EMAIL);\n }\n\n /*\n * If any attribute has a rule match and the value does not match with the value passed\n * in the rule array where this rule is found i.e $this->{$rule['match']} which corresponds\n * to password, so in short, $this->password, if they don't match add error to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n\n if($ruleName === self::RULE_MATCH && $value !== $this->{$rule['match']})\n {\n $this->addErrors($attribute, self::RULE_MATCH);\n }\n\n /*\n * This control structure if the user input is unique to the database. If it is not,\n * it adds an error to the errors array and pass the attribute and\n * the rule as parameters to the addErrors function\n * The model class that returns the unique set of rules also returns the tableName and the attributes\n * (column names in db) specific to that model class\n * The unique rule is rendered differently to cater for various classes, an array with the unique\n * rule passed along with the self::class that calls the active model class which extends to model\n * and attr is also passed along withe corresponding attribute (this is optional)\n *\n */\n\n if($ruleName === self::RULE_UNIQUE)\n {\n /*\n * Here, the active class is gotten along with the tablename and attribute which we\n * call uniqueAttr specific to the active model class\n */\n $className = $rule['class'];\n $tableName = $className::tableName();\n $uniqueAttr = $rule['attr'] ?? $attribute;\n\n /*\n * We prepare a statement that selects all from the tablename gotten where uniqueAttr\n * is typed param :attr (to avoid sql injection)\n * :attr is bound to $value which is the user input (remember data was loaded before\n * passing it through the validate() function) and executed and object of the result is fetched\n */\n\n $statement = Application::$app->db->prepare(\"SELECT * FROM $tableName WHERE $uniqueAttr = :attr\");\n $statement->bindValue(\":attr\", $value);\n $statement->execute();\n $record = $statement->fetchObject();\n\n /*\n * If a record exists, add an Error, if not it returns true\n */\n if($record)\n {\n $this->addErrors($uniqueAttr, self::RULE_UNIQUE);\n }\n\n }\n /*\n * Added a rule valid start date and valid end date that check if the start date is before\n * the current date and if the end date is before the start date of the project\n * If the rule name has valid_start_date and the value is before (here we use < )\n * the date of today which is passed as a corresponding value of start_date in the\n * RULE_VALID_START_DATE array that is passed. Then add an error for the corresponding\n * attribute and rule passing them as arguments in the addErrors function\n */\n\n if ($ruleName === self::RULE_VALID_START_DATE && $value < $rule['start_date'])\n {\n $this->addErrors('start_date', self::RULE_VALID_START_DATE);\n }\n\n /*\n * If the attribute has rule valid_end_date and the value is before or equal to the\n * day of the project start date. Then add an error for the corresponding\n * attribute and rule passing them as arguments in the addErrors function\n */\n\n if ($ruleName === self::RULE_VALID_END_DATE && $value <= $this->{$rule['end_date']})\n {\n $this->addErrors('end_date', self::RULE_VALID_END_DATE);\n }\n\n }\n }\n /*\n * If all the above conditions are met it means validation passed for the data that was passed\n * to the validate function. If so it means the errors array is empty\n * Then if validate passed, return if empty errors array, as true. If errors array is not empty\n * validate function returns false\n */\n return empty($this->errors);\n\n }", "public function validate(){\n\t\t$valid = true;\n\t\t$ref = new ReflectionObject($this);\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\tif(isset($this->_atributosMetadata[$prop->getName()])){\n\t\t\t\t$propMetadata = $this->_atributosMetadata[$prop->getName()];\n\t\t\t\tif($propMetadata->needValidate){\n\t\t\t\t\t$propMetadata->Validate($prop->getValue($this));\n\t\t\t\t\tif($propMetadata->isValid){\n\t\t\t\t\t\t$valid = $valid && $propMetadata->isValid; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $valid;\t\t\n\t}", "public function assertValid()\n {\n }", "public function hasAttributes() {\n return $this->_has(9);\n }", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 100) {\n return false;\n }\n if ($this->container['nit'] === null) {\n return false;\n }\n if (strlen($this->container['nit']) > 15) {\n return false;\n }\n if ($this->container['inbound_configuration_username'] === null) {\n return false;\n }\n if ($this->container['outbound_configuration_contingency_email'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\n {\n $allowed_values = array(\"TRAFFIC\", \"CONVERSIONS\", \"COS\");\n if (!in_array($this->container['campaign_goal'], $allowed_values)) {\n return false;\n }\n if (strlen($this->container['name']) < 2) {\n return false;\n }\n $allowed_values = array(\"ACTIVE\", \"PAUSED\", \"DELETED\");\n if (!in_array($this->container['status'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n $allowed_values = $this->getCapacityValueUomNameAllowableValues();\n if (!in_array($this->container['capacity_value_uom_name'], $allowed_values)) {\n return false;\n }\n $allowed_values = $this->getUnitValuesUomNameAllowableValues();\n if (!in_array($this->container['unit_values_uom_name'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function hasAttributes() {\n return $this->_has(3);\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }", "public function valid()\n {\n return count($this->listInvalidProperties()) === 0;\n }" ]
[ "0.8059332", "0.7311148", "0.72084683", "0.7200815", "0.71783113", "0.71309537", "0.6986787", "0.6922274", "0.6858365", "0.6838568", "0.67922354", "0.6675832", "0.6519247", "0.6518621", "0.6512764", "0.641908", "0.64095247", "0.6409148", "0.64066154", "0.6371408", "0.63631994", "0.63563097", "0.6344382", "0.63179207", "0.631306", "0.63122547", "0.63122547", "0.62864184", "0.62825876", "0.62796247", "0.62749", "0.6267376", "0.6260196", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.6255032", "0.62546575", "0.6249876", "0.6231284", "0.6227537", "0.6227537", "0.6227537", "0.6227537", "0.6227537", "0.6227537" ]
0.7285362
2
Get Primary key attribute name
public function getPrimaryAttribute() { return "id"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrimaryKeyName()\n {\n return self::$primary_key_name;\n }", "public static function primaryKey() {\n return (new static)->getKeyName();\n }", "public function getPrimaryKeyName()\n {\n return $this->primaryKeyName;\n }", "protected function getPrimaryKeyName(): string\n {\n return $this->query->getModel()->getKeyName();\n }", "public function getKeyName()\n {\n if (!$this->primaryKey) {\n if ($key = $this->getPrimaryFromFields()) {\n $this->primaryKey = $key;\n } else {\n $this->primaryKey = 'id';\n }\n }\n\n return $this->primaryKey;\n }", "public function getPrimaryKeyFieldName(){\n\t\treturn $this->primaryKey;\n\t}", "protected abstract function getPrimaryKeyName();", "public function getKeyName()\n {\n return isset($this->primaryKey) ? $this->primaryKey : static::$defaultPrimaryKey;\n }", "public function getUserPrimaryKeyName() {\n\n $forcedPkName = Configure::read('acl.aro.user.primary_key');\n if (! empty($forcedPkName)) {\n return $forcedPkName;\n } else {\n /* Return the primary key's name that follows the CakePHP\n * conventions */\n return 'id';\n }\n }", "public function getRolePrimaryKeyName() {\n\n $forcedPkName = Configure::read('acl.aro.role.primary_key');\n if (! empty($forcedPkName)) {\n return $forcedPkName;\n } else {\n /* Return the primary key's name that follows the CakePHP\n * conventions */\n return 'id';\n }\n }", "public function getPrimaryKey() {\n\t\treturn $this->_key_primary->name;\n\t}", "public function getKeyName()\n {\n return $this->primaryKey;\n }", "public function getKeyName()\n {\n return $this->primaryKey;\n }", "public function getPrimaryKeyName()\n\t{\n\t\treturn 'name';\n\t}", "public function primary_key(){\n $table_columns = $this->meta();\n\n $primary_key_column = NULL;\n foreach ($table_columns as $col) :\n if($col->primary_key):\n $primary_key_column = $col->name;\n endif;\n endforeach;\n\n return $primary_key_column; \n }", "protected function _getPrimaryKey(): string\n {\n if (!$this->_primaryKey) {\n $primaryKey = (array)$this->_table->getPrimaryKey();\n $this->_primaryKey = $primaryKey[0];\n }\n\n return $this->_primaryKey;\n }", "public function getModelKeyName()\n {\n // Create an instance of the model to get primary key name\n // I couldn't find a better solution \n $model = $this->getModel();\n $model = new $model;\n return $model->getKeyName();\n }", "function primary_key()\r\n\t{\r\n\t\treturn 'key';\r\n\t}", "function get_primary_key_column()\n {\n return $this->object->_primary_key_column;\n }", "public function getPrimaryKeyName()\n\t{\n\t\treturn 'id';\n\t}", "protected function _getPrimaryIdKey()\n {\n if ($this->_primaryIdKey == null) {\n $info = $this->_getTable()->info();\n\n $this->_primaryIdKey = (string) array_shift($info[Zend_Db_Table_Abstract::PRIMARY]);\n }\n\n return $this->_primaryIdKey;\n }", "public function getPrimaryKey()\n\t{\n\t\treturn $this->name;\n\t}", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }", "public function getPrimaryKeyColumn() : string\n {\n return $this->primaryKey;\n }", "private function pk_column(){\n\t\tif( in_array(static::$table_name, Model_Kiwi::$composite_key_tables) ){\n\t\t\treturn \"composite_key\";\n\t\t}\n\t\t//if the primary key of the table has been defined in config - return that else use convention\n\t\tif( in_array( static::$table_name, array_keys(Model_Kiwi::$kiwi_pk_hash))){\n\t\t\treturn Model_Kiwi::$kiwi_pk_hash[ static::$table_name ];\n\t\t}\n\t\treturn Model_Kiwi::singularize(static::$table_name) . '_id';\n\t}", "public function pkName()\r\n {\r\n $schema = $this->schema();\r\n foreach($schema as $col){\r\n if( $col['PRIMARY'] === true )\r\n return $col['FIELD'];\r\n }\r\n throw new \\Exception( __CLASS__ .\" Error: could not find Primary Key for table: \" . $this->table->name() ); \r\n }", "function get_primary_key_column()\n {\n return $this->_primary_key_column;\n }", "public function getKeyName()\n {\n return $this->keyName ?: 'id';\n }", "public function getKeyName()\n {\n return $this->keyName ?: 'id';\n }", "public function getCustomEntityPrimaryKeyColumnName()\n {\n return self::CUSTOM_TABLE_PRIMARY_KEY_COLUMN;\n }", "public function getKeyName(): string\n {\n return 'id';\n }", "private function getPrimaryKey()\n {\n $result = database()->fetchResult('SHOW KEYS FROM ' . $this->table . ' WHERE Key_name = \"PRIMARY\"');\n\n return ($result['Column_name'] ?? null);\n }", "public function primary_key()\n\t{\n\t\treturn $this->primary_key;\n\t}", "public function getKeyField()\n {\n $class = get_class($this);\n $parts = explode('\\\\', $class);\n $name = $parts[count($parts)-1];\n return strtolower($name) . '_id';\n }", "protected function _getPrimaryKey(){\n $def = $this->_getDef();\n foreach($def as $column){\n if($column['primary'] === true){\n return $column['field_name'];\n }\n }\n \n return false;\n }", "public function getPKField() {\n return $this->_key_field;\n }", "public static function getPkFieldName()\n {\n $modelClass = self::getClass();\n\n return implode('__', $modelClass::getScheme()->getPkFieldNames());\n }", "protected function getPrimaryKeyMemberName()\n {\n return MemberNames::ENTITY_ID;\n }", "public function getAuthIdentifierName()\n {\n return $this->primaryKey;\n }", "public function getAuthIdentifierName() {\n return $this->primaryKey;\n }", "protected function _getPrimaryKeyAttributes(){\n\t\treturn ActiveRecordMetaData::getPrimaryKeys($this->_source, $this->_schema);\n\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_nom' => $this->iid_nom, 'id_nivel' => $this->iid_nivel);\n }\n return $this->aPrimary_key;\n }", "public static function getPkColumnName()\n {\n $modelClass = self::getClass();\n\n return implode('__', $modelClass::getScheme()->getPkColumnNames());\n }", "protected function getModelPrimaryKey(): string\n {\n $model = $this->option('model');\n $model = new $model;\n\n return $model->getRouteKeyName();\n }", "protected function getPrimaryKeyColumnName()\n {\n return ColumnKeys::PATH;\n }", "public function getPrimaryKeyField()\n\t{\n\t\treturn $this->primaryKey;\n\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_dl' => $this->iid_dl);\n }\n return $this->aPrimary_key;\n }", "public function getPrimaryKey() {\n return $this->_data->getDeepValue('indexes/primary/columns/0', null);\n }", "public function preparePrimaryKeyName()\n {\n $this->primaryKeyName = $this->getOption('primary');\n\n if (empty($this->primaryKeyName)) {\n $this->primaryKeyName = 'id';\n }\n }", "public function get_primary_column()\n {\n }", "public static function primaryKey()\n {\n return static::PRIMARY_KEY;\n }", "public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }", "public function getKey()\n {\n return $this->getAttribute($this->getKeyName());\n }", "public function getKey()\n {\n return $this->getAttribute($this->getKeyName());\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_activ' => $this->iid_activ, 'id_asignatura' => $this->iid_asignatura, 'id_nom' => $this->iid_nom);\n }\n return $this->aPrimary_key;\n }", "abstract public function primaryKey(): string;", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}", "public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('nivel_stgr' => $this->inivel_stgr);\n }\n return $this->aPrimary_key;\n }", "public static function _getPK(){\n return (property_exists(get_called_class(), '_pk') ? static::$_pk : 'id');\n }", "public function get_key() {\n\t\treturn array_get($this->attributes, static::$key);\n\t}", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_ubi' => $this->iid_ubi, 'id_tarifa' => $this->iid_tarifa, 'year' => $this->iyear, 'id_serie' => $this->iid_serie);\n }\n return $this->aPrimary_key;\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "protected function get_default_primary_column_name()\n {\n }", "public function getIdAttribute()\n {\n return $this->attributes[$this->getKeyName()];\n }", "public function getPrimaryKey()\n {\n $cols = $this->info('cols');\n return $cols[0];\n }", "public function getTablePrimaryKey()\n {\n return 'p.id';\n }", "protected function primaryKeyName($table) {\n $table = $this->connection->prefixTables('{' . $table . '}');\n return $this->connection->query('SELECT name FROM sys.key_constraints WHERE parent_object_id = OBJECT_ID(:table) AND type = :type', [\n ':table' => $table,\n ':type' => 'PK',\n ])->fetchField();\n }", "public function getTableKeyName()\n\t{\n\t\treturn \"id\".$this->getTableName();\n\t}", "public function getPk()\n {\n return $this->{static::primaryKey()};\n }", "public function key()\n\t{\n\t\tif (empty($this->key) && !empty($this->definition->primary))\n\t\t{\n\t\t\t$keys = array_values(\n\t\t\t\tarray_filter(\n\t\t\t\t\tpreg_split('~[\\s,]+~', $this->definition->primary)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$keys = array_map(\n\t\t\t\tfunction ($key) {\n\t\t\t\t\treturn Normalise::toVariable($key);\n\t\t\t\t},\n\t\t\t\t$keys\n\t\t\t);\n\n\t\t\t$this->key = count($keys) > 1 ? $keys : array_shift($keys);\n\t\t}\n\n\t\tif (empty($this->key) && $this->has('id'))\n\t\t{\n\t\t\t$this->key = 'id';\n\t\t}\n\n\t\treturn $this->key;\n\t}", "public function getTableKeyName()\r\n\t{\r\n\t\treturn \"id\".$this->getTableName();\r\n\t}", "public function getAuthIdentifier()\n {\n return $this->attributes[$this->primaryKey];\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_situacion' => $this->iid_situacion);\n }\n return $this->aPrimary_key;\n }", "public function getCustomFieldPrimaryKey() : string\n {\n return Slug::generate(get_class($this) . ' ' . $this->getId());\n }", "public static function getPk(){\n return static::$_primaryKey;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_region' => $this->iid_region);\n }\n return $this->aPrimary_key;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_item' => $this->iid_item);\n }\n return $this->aPrimary_key;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_item' => $this->iid_item);\n }\n return $this->aPrimary_key;\n }", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKeyStr()\n {\n return $this->venda->getPrimaryKeyStr() . '-' . $this->getParcela();\n }", "public function getKeysName()\n {\n $primaryKey = [$this->getKeyName()];\n\n if ($sortKey = $this->getSortKeyName()) {\n $primaryKey[] = $sortKey;\n }\n\n return $primaryKey;\n }", "public function PK() {\n $returnvalue = '';\n $returnvalue .= $this->getDeterminationID();\n return $returnvalue;\n }", "public function getPrimaryKey()\r\n\t{\r\n\t\treturn $this->primaryKey;\r\n\t}" ]
[ "0.82570374", "0.8113111", "0.81061685", "0.8074601", "0.8046647", "0.8006839", "0.8002699", "0.7940471", "0.78839964", "0.78674", "0.7833307", "0.78165394", "0.78165394", "0.7790603", "0.77714664", "0.77266103", "0.76868117", "0.7679239", "0.7660843", "0.76578254", "0.75800294", "0.75394374", "0.7528962", "0.7528962", "0.7528295", "0.74909884", "0.74720824", "0.7461095", "0.7451533", "0.7436341", "0.7436341", "0.7425385", "0.7410411", "0.74013245", "0.7375238", "0.7341177", "0.73403066", "0.7263121", "0.7256471", "0.72493136", "0.7243952", "0.7235508", "0.7230212", "0.72286594", "0.7200673", "0.7183438", "0.71666324", "0.7149954", "0.71384", "0.7109764", "0.7109547", "0.7102847", "0.7100449", "0.70775986", "0.7053196", "0.7053196", "0.7051212", "0.70114905", "0.700806", "0.700806", "0.7000163", "0.7000163", "0.6998153", "0.6985144", "0.698221", "0.6951111", "0.6951111", "0.6951111", "0.6951111", "0.6951111", "0.6951111", "0.6950957", "0.69493717", "0.69493717", "0.6949207", "0.6949207", "0.6949207", "0.694745", "0.6942097", "0.6935587", "0.6930286", "0.6919774", "0.69147277", "0.6912789", "0.6911722", "0.6910564", "0.6909761", "0.69027334", "0.68945926", "0.68898165", "0.6888682", "0.6888682", "0.688593", "0.688593", "0.688593", "0.68767107", "0.687292", "0.6870525", "0.6854789" ]
0.6887373
93
date_default_timezone_set('America/New_York'); 08.20.2015 ghh this function verifies the dealerkey is correct and that if it doesn't have one already it will generate one and return
function verifyDealerKey( $dealerkey, $accountnumber ) { global $db; global $requestvars; if ( $db->db_connect_id ) { $query = "select DealerID, DealerKey, IPAddress, Active from DealerCredentials where AccountNumber='$accountnumber' "; if ( !$result = $db->sql_query( $query ) ) { RestLog( "Error" ); die(RestUtils::sendResponse(500, "Error: 16535 There was a problem finding dealer record")); } $row = $db->sql_fetchrow($result); //08.20.2015 ghh - if the query returns nothing,that means that there is not //a valid dealer key for that location and one needs to be created if ( $row[ 'IPAddress' ] != '' && $row[ 'IPAddress' ] != $SERVER['REMOVE_ADDR' ] ) { RestLog( "Error Not Authorized From This IP Address" ); die(RestUtils::sendResponse(401, 'Error 16536 Bad Location')); } //08.20.2015 ghh - here we deal with an inactive dealer trying to work with //the system if ( $row[ 'Active' ] == 0 ) { RestLog( "Error Account Is Inactive" ); die(RestUtils::sendResponse(401, 'Error 16537 Inactive Account')); } //08.20.2015 ghh - now we see if they have a valid key if ( isset( $row[ 'DealerKey' ] ) && $row[ 'DealerKey' ] != $dealerkey ) { RestLog( "Error Dealer Key is Invalid Query:".$query."\n $row[DealerKey] != $dealerkey" ); die(RestUtils::sendResponse(401, 'Error 16538 Bad Dealer Key')); } //08.20.2015 ghh - if we got this far and don't have a dealer key at all //then we need to generate one here. if ( !isset( $row[ 'DealerKey' ] ) ) { $uuid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', // 32 bits for "time_low" mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), // 16 bits for "time_mid" mt_rand( 0, 0xffff ), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 mt_rand( 0, 0x0fff ) | 0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one for variant DCE1.1 mt_rand( 0, 0x3fff ) | 0x8000, // 48 bits for "node" mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); //08.20.2015 ghh - save the new dealerkey into the dealer table $query = "update DealerCredentials set DealerKey='$uuid' where DealerID=$row[DealerID]"; if (!$result = $db->sql_query($query)) { RestLog("Error in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500, 'Error 16539 Problem updating key'); //Internal Server Error return false; } return $uuid; } //08.20.2015 ghh - if the query does return something, we need to evaluate //if the dealer key that it returns is a match to the dealer key that is passed //in $requestvars[ 'DealerID' ] = $row[ 'DealerID' ]; if ($dealerkey == $row['DealerKey']) return $dealerkey; } else { RestLog( "Error" ); die(RestUtils::sendResponse(500, 'Error 16540 Internal Database problem.')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_originator($clean_data = false)\n{\n $timenow = date(\"U\");\n if (($timenow - $clean_data[\"appheader\"][\"transmissiondatetime\"]) > 3600) {\n return false;\n }\n \n \n \n $conn = conn();\n $clean_data[\"privatekeypair\"] = false;\n \n if ($clean_data[\"appheader\"][\"key\"] == \"newlatcherinstallation\") {\n return $clean_data;\n }\n \n if ($result = mysqli_query($conn, \"SELECT * FROM session WHERE key='\" . $clean_data[\"appheader\"][\"key\"] . \"' LIMIT 1\")) {\n while ($row = mysqli_fetch_array($result)) {\n $clean_data[\"privatekeypair\"] = $row[\"key\"];\n }\n mysqli_free_result($result);\n }\n \n mysqli_close($conn);\n \n if ($clean_data[\"privatekeypair\"] === false) {\n return false;\n }\n \n return $clean_data;\n}", "function createKey(){\n\t$strKey = md5(microtime());\n\t\n\t//check to make sure this key isnt already in use\n\t$resCheck = mysql_query(\"SELECT count(*) FROM downloads WHERE downloadkey = '{$strKey}' LIMIT 1\");\n\t$arrCheck = mysql_fetch_assoc($resCheck);\n\tif($arrCheck['count(*)']){\n\t\t//key already in use\n\t\treturn createKey();\n\t}else{\n\t\t//key is OK\n\t\treturn $strKey;\n\t}\n}", "public static function getNewTrackingKey() {\n\t\n\t\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\t\t\n\t\t// try up to 100 times to guess a unique key\n\t\tfor($i=0; $i<100; $i++) {\n\t\t\t$key = '';\n\t\t\tfor($j=0; $j<32; $j++)\t// generate a random 32 char alphanumeric string\n\t\t\t\t$key .= substr($chars,rand(0,strlen($chars)-1), 1);\n\t\t\n\t\t\tif(X2Model::model('Contacts')->exists('trackingKey=\"'.$key.'\"'))\t// check if this key is already used\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn $key;\n\t\t}\n\t\treturn null;\n\t}", "public static function getNewTrackingKey() {\n\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\n // try up to 100 times to guess a unique key\n for ($i = 0; $i < 100; $i++) {\n $key = '';\n for ($j = 0; $j < 32; $j++) {// generate a random 32 char alphanumeric string\n $key .= substr($chars, rand(0, strlen($chars) - 1), 1);\n }\n\n // check if this key is already used\n if (X2Model::model('Contacts')->exists('trackingKey=\"' . $key . '\"')) {\n continue;\n } else {\n return $key;\n }\n }\n return null;\n }", "private function check_api_key() {\n return true;\n $post_token = $this->input->post('App-Request-Token');\n $post_datetime = $this->input->post('App-Request-Timestamp');\n if ($post_token && $post_datetime) {\n $date = gmdate('Y-m-d H:i:s');\n if (strtotime($post_datetime) >= (strtotime($date) - 300) && strtotime($post_datetime) <= strtotime($date)) {\n $token = sha1(config_item('api_request_key') . $post_datetime);\n if ($post_token === $token) {\n return true;\n }\n }\n } else {\n $this->send_error('ERROR');\n exit;\n }\n }", "function generateKeyPrimary($table){\n /*\n key : code-tanggal-hurufAcak-jam\n\n logikanya\n 1 cek create untuk tabel yang mana\n 2 jika pengguna codenya PGN\n 3 jika sawah codoenya SWH\n 4 nanti key akan jadi code-tanggal-hurufAcak-jam\n\n */\n // konfigurasi\n // hurufnya apaan\n $str = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n //batas maksimal huruf randonmnya\n $keyLenght = 6;\n\n //Tentukan code\n if ($table == \"pengguna\") {\n $code = \"PGN\";\n } elseif ($table == \"sawah\") {\n $code = \"SWH\";\n }\n\n $date = date('ymd');\n $randStr = substr(str_shuffle($str), 0, $keyLenght);\n $hours = date('his');\n\n $key = $code . \"-\" . $date . \"-\" . $randStr . \"-\" . $hours;\n\n return $key;\n}", "function generate_mailkey(){\r\n $rseed=date(\"U\")%1000000;\r\n srand($rseed);\r\n $mailkey=md5(rand(10000,10000000));\r\n return $mailkey;\r\n}", "function old_validate_date($date){\n if ($date == \"\" ) { return '00:00:00' ; }\n # create temp table and attempt insert there\n $query = \"CREATE TEMP TABLE validation (test date) \";\n $result = do_sql($query);\n\n # Check if date is valid format by entering it into temp table\n $query = \"INSERT INTO validation (test) values ( '$date' )\";\n $result = do_sql($query);\n\n if ( $result ) {\n do_sql(\"DROP TABLE validation\") ;\n return \"$date\" ;\n }\n else { \n do_sql(\"DROP TABLE validation\") ;\n return false ;\n }\n}", "public function testKeyGenerator()\n {\n $localisationCookieIdGenerator = new LocalisationCookieIdGenerator();\n\n $request = new Request();\n $request->cookies->add([\n 'localisation' => '{\"client\":{\"11\":\"AOK Bayern\"},\"location\":null}'\n ]);\n\n $id = $localisationCookieIdGenerator->generate($request);\n $this->assertEquals('null_11', $id);\n }", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "public function generateKey()\n {\n do\n {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while ($this->keyExists($newKey));\n\n return $newKey;\n }", "public static function generateKey()\n {\n do {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while (self::keyExists($newKey));\n\n return $newKey;\n }", "function generateCandiToken($name){\t\n\t$mydate = getdate();\n\t$token = sha1($name.\"candidate\");\n\treturn $token;\n}", "function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}", "function insertNewBooking($bookingnum, $custid, $pkgId) {\n $query = \"INSERT INTO `bookings` (BookingDate, BookingNo, TravelerCount, CustomerId, PackageId) VALUES ('\".date(\"Y-m-d H:i:s\").\"', '$bookingnum', '1', '$custid', '$pkgId')\";\n $result = Database::insertQuery($query); \n if ($result) {\n return true;\n } else {\n return false;\n }\n }", "public function test_generate_key_random()\n {\n $key1 = GuestToken::generate_key();\n $key2 = GuestToken::generate_key();\n $this->assertNotEquals($key1, $key2);\n }", "function askVerifyAndSaveLicenseKey()\n{\n if (empty($_POST['key']))\n {\n renderLicenseForm('Please enter a license key'); \n exit();\n } else {\n $license_key = preg_replace('/[^A-Za-z0-9-_]/', '', trim($_POST['key'])); \n }\n $checker = new Am_LicenseChecker($license_key, API_URL, RANDOM_KEY, null);\n if (!$checker->checkLicenseKey()) // license key not confirmed by remote server\n {\n renderLicenseForm($checker->getMessage()); \n exit();\n } else { // license key verified! save it into the file\n file_put_contents(DATA_DIR . '/key.txt', $license_key);\n return $license_key;\n }\n}", "function generate_key()\n{\n $pool = \"qwertzupasdfghkyxcvbnm\";\n $pool .= \"23456789\";\n $pool .= \"WERTZUPLKJHGFDSAYXCVBNM\";\n srand ((double)microtime()*1000000);\n for($index = 0; $index < 10; $index++)\n {\n $akti .= substr($pool,(rand()%(strlen ($pool))), 1);\n }\n return $akti;\n}", "function check_today($player) {\n $found = 1;\n\n $last = trim(file_get_contents(_PWD . '/' . $player->steamid));\n if ($last != date('m/d/Y')) {\n $found = 0;\n }\n\n return $found;\n }", "abstract protected function generateKey();", "function checkTotp($secret, $key, $timedrift = 1);", "public function genTrackingKey()\n {\n if ($this->trackMails) {\n $trackingKey = Yii::$app->security->generateRandomString(32);\n $this->setTrackingKey($trackingKey);\n return $trackingKey;\n } else {\n return null;\n }\n }", "function refreshLocalKey() {\n\t\t\t$localKey = $this->settings[\"localkey\"];\n\t\t\t\n\t\t\t// Get the number of validation failures due to communication\n\t\t\t$numFails = $this->settings[\"numbervalidatefails\"];\n\t\n\t\t\t// Get the last time a revalidation was attempted\n\t\t\t$lastValidateAttempt = $this->settings[\"lastvalidateattempt\"];\n\t\t\tif ($lastValidateAttempt > 0) {\n\t\t\t\tif ($this->debug) echo \"<BR>Last remote validation was \";\n\t\t\t\tif ($this->debug) echo $this->dateDifference(time(),$this->settings[\"lastvalidateattempt\"]) . \" ago\"; \n\t\t\t} else {\n\t\t\t\tif ($numFails == 0) {\n\t\t\t\t\tif ($this->debug) echo \"<BR>No remote validate has been attempted before\";\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->debug) echo \"<BR>The last remote validationg failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif ($this->debug) echo \"<br>Connecting to remote server: \" . $this->remoteUrl;\n\t\t\t$productid = \"\";\n\t\n\t\t\t$args = array( 'license'=>$this->settings[\"licensekey\"], 'productid' => $this->productId, 'ip' => $_SERVER['SERVER_ADDR'], 'domain'=>parse_url(home_url('/'), PHP_URL_HOST), 'username'=>$this->settings[\"username\"],'useremail'=>$this->settings[\"useremail\"] ); \n\t\n\t\t\t$response = wp_remote_post( $this->remoteUrl, array(\n\t\t\t\t'timeout' => 45,\n\t\t\t\t'redirection' => 5,\n\t\t\t\t'httpversion' => '1.0',\n\t\t\t\t'blocking' => true,\n\t\t\t\t'headers' => array(),\n\t\t\t\t'body' => $args,\n\t\t\t\t'cookies' => array()\n\t\t\t) );\n\t\n\t\n\t\t\t// Check for issues\n\t\t\t$error = false;\n\t\t\t\n\t\t\tif( is_wp_error( $response ) ) {\n\t\t\t\tif ($this->debug) echo '<br>Something went wrong!';\n\t\t\t\tif ($this->debug) echo \"<pre>\" . print_r($response,1) . \"</pre>\";\n\t\t\t\t\n\t\t\t\tif ($this->debug) echo '<br>Something went wrong!';\n\t\t\t\tif ($this->debug) echo \"<pre>\" . print_r($response,1) . \"</pre>\";\n\t\t\t\t\n\t\t\t\t// Update the number of fails, if it's more than 24 hours since the last one, and if\n\t\t\t\t// admin has set a limit\n\t\t\t\t$numFails = $this->incrementOfflineFails();\n\t\t\t\t$result = \"\";\n\t\t\t\t\n\t\t\t\t$error = true;\n\t\t\t\t$errorMessage = $response->errors[\"http_request_failed\"][0];\n\t\t\t\t$this->updateSetting(\"lastvalidateresponse\", \"Problem connecting to ActivateWP License Server (\" . $response->errors[\"http_request_failed\"][0] . \")\");\n\t\t\t} else {\n\t\t\t\tif ($this->debug) echo '<br>HTTP request succeeded!';\n\t\t\t\tif ($response[\"response\"][\"code\"] <> 200) {\n\t\t\t\t\tif ($this->debug) echo '<br>HTTP code: ' . $response[\"response\"][\"code\"];\n\t\t\t\t\t$error = true;\n\t\t\t\t\t$numFails = $this->incrementOfflineFails();\n\t\t\t\t\t$errorMessage = \"Unable to reach remote server (Response code:\" . $response[\"response\"][\"code\"] . \")\";\n\t\t\t\t\t$this->updateSetting(\"lastvalidateresponse\", \"Problem connecting to ActivateWP License Server: \" . $errorMessage);\n\t\t\t\t} else {\n\t\t\t\t\t// Reset any errors\n\t\t\t\t\t$this->updateSetting(\"lastvalidateresponse\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t\n\t\t\t\n\t\t\tif (! $error) {\n\t\t\t\t// Get the body only\n\t\t\t\t$response = $response['body'];\n\t\t\t\tif ($this->debug) echo '<HR>Response from remote server:<blockquote><font color=\"red\"><pre>';\n\t\t\t\tif ($this->debug) print_r( $response );\n\t\t\t\tif ($this->debug) echo '</pre></font></blockquote><hr>';\n\t\t\t\t$result = substr($response, strpos($response, \"===\")+3);\n\t\t\t\tif ($this->debug) echo '<Hr>Encoded Result:<pre>';\n\t\t\t\tif ($this->debug) print_r( $result );\n\t\t\t\tif ($this->debug) echo '</pre><hr>';\n\t\t\t\t$localkey = base64_decode($result);\n\t\t\t\tif ($this->debug) echo '<Hr>Decoded Result:<pre>';\n\t\t\t\tif ($this->debug) print_r( $result );\n\t\t\t\tif ($this->debug) echo '</pre><hr>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\t// Save the time and number of files\n\t\t\t$this->updateSetting(\"lastvalidateattempt\", time());\n\t\t\t$this->updateSetting(\"numbervalidatefails\", $numFails);\n\t\t\treturn $localkey;\n\t\t}", "function generateRequestID()\n{\n date_default_timezone_set('America/Chicago');\n $currenttime = date(\"YmdHis\");\n $randomnumber = rand(0, 9999);\n return $currenttime.$randomnumber;\n}", "function sign($date) {\n $key = base64_decode('MIIEowIBAAKCAQEA5NmI8GIsupuvOMXR4yfs8hK2RUmX/CKlHmLEr/b1mPr/gx+fenafOSKoXs7OUvUxF/CR0EW6iUJvJ9lmTACTZFsTfF+mSJZ76dpuh6J8BQj9lpnH+AEp05LqLr2zvlzkksrjYSW4hfaZqfUZDk8YvGsdBqDpWrEykD16R5Jv5Iw/Y13Jd99F5zYU+Z3M+XdBSrFSaDwU5GeiOQVyl8q/Bt9gY7O1HfqYY9udXmAzPfEaZdCqCj7B8V8Sj7Wc92TZ/fHabZFKzfhVwfHCAzK4mQZ1be8snJd1f9R2peqjzBEINGdOnAnm0rGItKZJY91LMYi5H6Wh/Qh21CYY4Ne2wwIDAQABAoIBAEKXQg+goZ9TOfNtLJvKvFncNAmJVp5Zfm6PEuiZFfID52HCS+eYqNA5U4Dy8HqXOkfbCrLt90+Fc07HJcsrx7fGAK+KLZqlnzz3AH6bOzdD3HZ8HQH/ZKpZ76bWMH1ODnzgaLWWAlGI5kHcPgQ549q/2FxbakunkC0ElpZI+CIqWEf0zNfTXOpExMWx+FENntk/qpHijE+zcbh1/cy8Bsmj0WcXZ3aTDElG3XCC21rPd7zgrFeL6Sy26Br0eqxqddatghZHB5PhZYE4BYM3AlZTZVfuDHogXn4BXILTyV+oQHNUzHKjStfVryJnslnWVAF5whaXGm1fyRY3WBAEmuECgYEA+AivBccqnKfgB7BTDTUMCdt7v+vVbR7CEZc5/jCRy+N0R6NN/L/+LdAAjsodjzVmkLOUzPbZhw72hHXA63RijAhSDeg8IdCUY1YVygyr5KZpHRnn96XJOucPCCFWFfiToJ2Qz+JfZMBUt9HhsSWGS2jF2hUGjixhRwFwTd5xtYsCgYEA7DMe0bJeF336UtgrY9MNVC1sc/A8sEeYtlr47rcLlRDboaO9PRsuIMssxiZ/9uRkYP1FDmS3S8pgwg4UuoVUYHg5Tt95iq3aK0BRQnpKuGIerbBCwFUBZMwpP1DW3fMKtOQ5pjoV74tqR+df7gD0hWlfMFV8WUP9vXLa+XBcWqkCgYEA85sbw3IEsQ3UY9jTCSKzqy7NUQcgfGb8NmiwBa7QU08XUpDatMYgsAAdvCBYfeH11WL7X3+G0DZq+lfo3ZhWfbBiXtRb0t5YD2RqTCK75PtoO7PI95r1lAuB4PtU4Ile/R4kL3jnNj4MNupFX0Y6qu/BetqxsIt4E1QfZ+t1BNcCgYBrDiCB2t5at3al5eSEsjvwU0Y8pj5bh5fnzwPU7pIJVkK12IkFETSvGGeKyBhnxszYSPLruyp455lDWy55+8RqlRMkdJWaDYI86EHsZ5FGUPKmtqUKl3yyOvbXA8TfhDDuHCMk/F7E2+OoA26vaS9q6H+EYLqjmvV+0Hf/ZrX1QQKBgGd8r9wi+fPG3IgGXHBQjmnVgaPNsvQzBKFmHrER0/iLZuA9A2R5x7DxZdHUSRWaPADIaHiU1O9jbNJCk7Jtnqn7M85Q0SRsqZhA2+28/1bmqrTkQmT7T9Q4+hUEN+qehZx83BkRYaP1QWuH11UcRxFr+O3HNXlC9mAG/zt6HhuV');\n $sig = hash_hmac('SHA1', $date, $key, true);\n $sig = base64_encode($sig);\n return $sig;\n }", "function keymaker($id = ''){\n\t\t//look up of info unique to the user or id. It could include date/time to timeout keys.\n\t\t$secretkey='1RuL1HutysK98UuuhDasdfafdCrackThisBeeeeaaaatchkHgjsheIHFH44fheo1FhHEfo2oe6fifhkhs';\n\t\t$key=md5($id.$secretkey);\n\t\treturn $key;\n\t}", "function timezonecalculator_checkData($timeZoneTime) {\r\n\t//first check if the size of the timezones-array match\r\n\tif (sizeof($timeZoneTime)!=7)\r\n\t\treturn -1;\r\n\r\n\t//WordPress TimeZones Support\r\n\tif ($timeZoneTime[0]=='Local_WordPress_Time') {\r\n\t\t$timeZoneTime[0]=get_option('timezone_string');\r\n\t}\r\n\r\n\t//the timezone_id should contain at least one character\r\n\tif (strlen($timeZoneTime[0])<1)\r\n\t\treturn -2;\r\n\r\n\t//are the last two array-parameters 0 or 1?\r\n\t$mycheck=false;\r\n\tif ($timeZoneTime[5]==1 || $timeZoneTime[5]==0)\r\n\t\t$mycheck=true;\r\n\tif (!$mycheck)\r\n\t\treturn -3;\r\n\r\n\t$mycheck=false;\r\n\tif ($timeZoneTime[6]==1 || $timeZoneTime[6]==0)\r\n\t\t$mycheck=true;\r\n\tif (!$mycheck)\r\n\t\treturn -4;\r\n\r\n\t/*\r\n\tprevious-version check by the following assumption:\r\n\tif array-parameter [4] (offset in older versions) is numeric\r\n\t&& the value between -12.5 and 12.5 ==> old version\r\n\tthrow error\r\n\t*/\r\n\r\n\t//thanx 2 Darcy Fiander 4 updating the regex to match the half-hour offsets which is now used for old-version checks\r\n\tif (ereg(\"(^[-]?[0-9]{1,2}(\\\\.5)?$)\", $timeZoneTime[4]) && $timeZoneTime[4]>=-12.5 && $timeZoneTime[4]<=12.5) {\r\n\t\treturn -5;\r\n\t}\r\n\r\n\t//check if timezone_id exists by creating a new instance\r\n\t$dateTimeZone=@timezone_open($timeZoneTime[0]);\r\n\r\n\tif (!$dateTimeZone)\r\n\t\treturn -2;\r\n\telse return $dateTimeZone;\r\n}", "protected function _generateHash()\n {\n //$formattedDateTime = $datetime->format(\"Y-m-d H:i:s\");\n $formattedDateTime = $this->udate('Y-m-d H:i:s.u T');\n $hash = $this->_getHash($formattedDateTime);\n return $hash;\n }", "public function isRegenerated(): bool;", "protected function generateEncryptionKeyIfNeeded() {}", "private function _create_hash($key=''){\n\t\t$secret_key = 'gL0b3-E$sT4te'.date('m-d-y');\n\t\treturn md5($key.$secret_key);\n\t}", "function customcert_generate_code() {\n global $DB;\n\n $uniquecodefound = false;\n $code = random_string(10);\n while (!$uniquecodefound) {\n if (!$DB->record_exists('customcert_issues', array('code' => $code))) {\n $uniquecodefound = true;\n } else {\n $code = random_string(10);\n }\n }\n\n return $code;\n}", "protected function regenerateTokenIfNotNew()\n {\n if ($this->tokenExpiry !== null) {\n $this->regenerateToken();\n }\n }", "protected function _generateVerificationKey() {\n\t\treturn mt_rand(111111,999999);\n\t}", "function createSurferID() {\n srand((double)microtime() * 10000000);\n // Paranoia mode: Repeat until an unused id is found\n // (which a correct implementation of uniq!!id() should\n // grant anyway ...)\n do {\n $id = (string)md5(uniqid(rand()));\n } while ($this->existID($id, TRUE));\n return $id;\n }", "function validate_key($key,$mobile){\n $apiEncrypter = new ApiEncrypter();\n $d_key = $apiEncrypter->decrypt($key);\n return $d_key == $mobile ? true : false;\n}", "private function _generate_key(){\n $salt = base_convert(bin2hex($this->CI->security->get_random_bytes(64)), 16, 36);\n \n // If an error occurred, then fall back to the previous method\n if ($salt === FALSE){\n $salt = hash('sha256', time() . mt_rand());\n }\n \n $new_key = substr($salt, 0, config_item('rest_key_length'));\n while ($this->_key_exists($new_key));\n\n return $new_key;\n }", "function n_checkID($genid, $parms=NULL)\r\n{\r\n if (empty($genid)) return FALSE;\r\n if (preg_match('%^([a-z\\d]{6,8})$%i', $genid, $matches)) // base32 code\r\n $genid = base32_float($matches);\r\n\r\n if (is_array($parms)) {\r\n $service = trim($parms['service']);\r\n $timeAt = trim($parms['timeAt']);\r\n }\r\n else if (is_string($parms))\r\n $service = $parms;\r\n $service = preg_match(\"%^([a-z][a-z_]{2,})%i\", $service, $matches) ? strtoupper($matches[1]) : '';\r\n\r\n if (preg_match('%^([0]{0,1})([\\d])([\\d]{6})([\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%^([1])([\\d])([\\d]{5})([\\d][\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%^([2])([\\d])([\\d]{7})([\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%([3])([\\d])([\\d]{7})([\\d][\\d]{2})$%', $genid, $matcharr)) {\r\n $ntype = intval($matcharr[1]);\r\n $rn = intval($matcharr[2]);\r\n $id = $matcharr[3];\r\n $s2 = $matcharr[4];\r\n //if ($cf_debug) echo (\"n_checkID: ntype=$ntype, rn=$rn, id=$id\\n\");\r\n }\r\n\r\n if (strlen($s2)==3) { // with day-check\r\n $t = $s2{0};\r\n if ($timeAt!=='0' && $t!='0') {\r\n $time = strlen($timeAt) ? strtotime($timeAt) : time();\r\n if ($time <= 0) $time = time(); // invalid time\r\n $numTry = 0;\r\n while ($numTry < 2) {\r\n $parmarr = array(\r\n 'service' => $service,\r\n 'rn' => $rn,\r\n 'timeAt' => date('Y-m-d H:i:s', $time - 43200*$numTry),\r\n );\r\n $s = n_makeID($id, $parmarr, $ntype);\r\n //if ($cf_debug) echo (\"n_checkID: s=$s, msig=\".-strlen($s).\"\\n\");\r\n if ($s && preg_match(\"%\".substr($genid, -strlen($s)).\"$%\", $s))\r\n return $id;\r\n $numTry++;\r\n }\r\n return FALSE;\r\n }\r\n }\r\n\r\n $parmarr = array(\r\n 'service' => $service,\r\n 'rn' => $rn,\r\n 'timeAt' => '0',\r\n );\r\n $s = n_makeID($id, $parmarr, $ntype);\r\n //if ($cf_debug) echo (\"n_checkID: s=$s, msig=\".-strlen($s).\"\\n\");\r\n if (($ntype==0 && intval($s)==intval($genid))\r\n || ($s && preg_match(\"%\".substr($genid, -strlen($s)).\"$%\", $s)))\r\n return $id;\r\n\r\n return FALSE;\r\n}", "static function insertLookupKeyForBooking( $reservationId, $lookupKey, $payment_requested ) {\n global $wpdb;\n if (false === $wpdb->insert(\"wp_booking_lookup_key\",\n array( 'reservation_id' => $reservationId, 'lookup_key' => $lookupKey, 'payment_requested' => $payment_requested ),\n array( '%s', '%s', '%f' ))) {\n error_log($wpdb->last_error . \" executing sql: \" . $wpdb->last_query);\n throw new DatabaseException($wpdb->last_error);\n }\n return $wpdb->insert_id;\n }", "private function generateApiKey(){\n\n return md5(uniqid(rand(), true));\n\n }", "public function testCanadaDayBefore1879(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "public function check_class_register_deadline(){\n $sessionID = $this->input->post('class_session_id');\n // set correct timezone\n date_default_timezone_set(\"America/New_York\");\n // collect the current time \n $currentTime = date(\"h:i:s\");\n $currentDate = date(\"Y/m/d\");\n \n //search of session date\n $this->db->select('*');\n $this->db->where('class_session_id', $sessionID);\n $getSessionInfo = $this->db->get('class_sessions'); \n $fetchDate = $getSessionInfo->row(); \n $scheduledDate = $fetchDate->date;\n echo $scheduledDate; \n // check is the date is right\n \n if($currentDate == $scheduledDate ){\n \n // get session start time\n $fetchStartTime = $getSessionInfo->row();\n $scheduledStartTime = $fetchStartTime->start_time;\n // get session cut off time\n $fetchCutOffTime = $getSessionInfo->row();\n $scheduledCutOffTime = $fetchCutOffTime->cut_off_time; \n \n \n if($currentTime >= $scheduledStartTime && $currentTime < $scheduledCutOffTime){\n \n return true; \n \n \n }else{\n \n return false; \n \n }\n \n }else{\n \n echo \"This is the wrong day for the class session to be registered.\";\n \n }\n }", "function _tsuiseki_tracking_calculate_k($name, $expiration_time, $key) {\n $name = (string)trim($name);\n if (empty($name)) {\n trigger_error('Parameter $name not given!');\n }\n $expiration_time = (int)$expiration_time;\n if ($expiration_time <= 0) {\n trigger_error('Illegal value for parameter $expiration_time!');\n }\n $key = (string)trim($key);\n if (empty($key)) {\n trigger_error('Parameter $key not given!');\n }\n $data = $name . $expiration_time;\n return hash_hmac(TSUISEKI_TRACKER_HMAC_ALGORITHM, $data, $key);\n}", "function mswProdKeyGen() {\n $_SERVER['HTTP_HOST'] = (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : uniqid(rand(),1));\n $_SERVER['REMOTE_ADDR'] = (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] ? $_SERVER['REMOTE_ADDR'] : uniqid(rand(),1));\n if (function_exists('sha1')) {\n $c1 = sha1($_SERVER['HTTP_HOST'].date('YmdHis').$_SERVER['REMOTE_ADDR'].time());\n $c2 = sha1(uniqid(rand(),1).time());\n $prodKey = substr($c1.$c2,0,60);\n } elseif (function_exists('md5')) {\n $c1 = md5($_SERVER['HTTP_POST'].date('YmdHis').$_SERVER['REMOTE_ADDR'].time());\n $c2 = md5(uniqid(rand(),1),time());\n $prodKey = substr($c1.$c2,0,60);\n } else {\n $c1 = str_replace('.','',uniqid(rand(),1));\n $c2 = str_replace('.','',uniqid(rand(),1));\n $c3 = str_replace('.','',uniqid(rand(),1));\n $prodKey = substr($c1.$c2.$c3,0,60);\n }\n return strtoupper($prodKey);\n}", "function brathchick($d){\n\t$d=strtotime($d);\n\t$today=date(\"d-m-Y\");\n\t$today=strtotime($today);\n\t$defday=strtotime(\"1-1-1970\");\n\tif($d>$today||$d===$defday||$d===false)\n\t\treturn false;\n\telse \n\t\treturn true;\n}", "function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }", "function valid_date($sup,$inf='') {\n\tif (!isset($inf) or $inf == 0) {\n\t\t$inf = date('Y-m-d');\n\t}\n\n\t$defaultTimeZone=\"Europe/Paris\";\n\tif (date_default_timezone_get()!=$defaultTimeZone) date_default_timezone_set($defaultTimeZone);\n\t\n\t// DECOUPE DE LA DATE INF\n\t// VERIFIE date complete yyyy-mm-jj hh:mm:ss\n\tif (strpos($inf, \" \")===false) {\n\t\t$tinf = explode (\"-\", $inf);\n\t\t$tinfheure = array(date(\"H\"),date(\"i\"),date(\"s\"));\n\t}else {\n\t\t$z = explode(\" \",$inf);\n\t\t$tinf = explode (\"-\", $z[0]);\n\t\t$tinfheure = explode (\":\", $z[1]);\n\t}\n\n\t// DECOUPE DE LA DATE SUP\n\t// VERIFIE date complete yyyy-mm-jj hh:mm:ss\n\tif (strpos($sup, \" \")===false) {\n\t\t$tsup = explode (\"-\", $sup);\n\t\t$tsupheure = array(date(\"H\"),date(\"i\"),date(\"s\"));\n\t}else {\n\t\t$z = explode(\" \",$sup);\n\t\t$tsup = explode (\"-\", $z[0]);\n\t\t$tsupheure = explode (\":\", $z[1]);\n\t}\n\n\t$nowt = mktime($tinfheure[0],$tinfheure[1],$tinfheure[2], $tinf[1], $tinf[2], $tinf[0]);\n\t$supt = mktime($tsupheure[0],$tsupheure[1],$tsupheure[2], $tsup[1], $tsup[2], $tsup[0]);\n\tif ($supt >= $nowt) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\t\n}", "function getLocalKey() {\n\t\t\t$localKey = $this->settings[\"localkey\"];\n\t\t\t\n\t\t\t\n\t\t\tif ( (trim($localKey[0]) == \"\") || (!$this->isLocalKeyCurrent() ) ){\n\t\t\t\tif ($this->debug) echo \"<BR>Local Key has expired\"; // Get a new local key from the remote server\n\t\t\t\t$localKey = $this->refreshLocalKey();\n\t\t\t\t$localKeySplit = explode(\"|\", $localKey);\n\t\t\t\t$this->localKeySplit = $localKeySplit;\n\t\t\t\t$this->localKey = $localKey;\n\t\t\t\t$this->updateSetting(\"localkeysplit\", $localKeySplit);\n\t\t\t\t$this->updateSetting(\"localkey\", $localKey);\n\t\t\t\tif ($this->debug) echo \"<BR>Got new local key: $localKey\";\n\t\t\t\tif ($this->debug) echo \"<BR>Expires on \" . date(\"d-m-y H:i:s\", $localKeySplit[3]);\n\t\t\t} else {\n\t\t\t\tif ($this->debug) echo \"<BR>Got saved local key: $localKey\";\n\t\t\t\t$this->updateSetting(\"lastLocalValidate\", time());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn $localKey;\n\t\t\t\n\t\t}", "public function checkWalletExpiry() {\n\t\t$gsettings = Gsetting::first();\n\t\tif(!is_null($gsettings)) {\n\t\t\t$wallet_duration_days = $gsettings->wallet_duration_days;\n\t\t\ttry {\n\t\t\t\tif($wallet_duration_days) {\n\t\t\t\t\t$user_rec = DB::table('useraddresses')->where('user_id', Auth::user()->id)->where('is_archived', '0')->first();\n\t\t\t\t\tif(!is_null($user_rec)) {\n\t\t\t\t\t\t$old_address = $user_rec->address;\n\t\t\t\t\t\tLog::info(\"old_address: $old_address\");\n\t\t\t\t\t\t$addr_created_at = $user_rec->created_at;\n\t\t\t\t\t\t$created = new Carbon($addr_created_at);\n\t\t\t\t\t\t$now = \\Carbon::now();\n\t\t\t\t\t\t$difference = $created->diff($now)->days; //diff in days\n\t\t\t\t\t\tLog::info(\"difference days: $difference, wallet days: $wallet_duration_days\");\n\t\t\t\t\t\tif($difference >= $wallet_duration_days){\n\t\t\t\t\t\t\t//create new address\n\t\t\t\t\t\t\t$apiKey = $gsettings->block_btc_api_key;\n\t\t\t\t\t\t\t$pin = $gsettings->block_secret_pin;\n\t\t\t\t\t\t\t$version = 2; // the API version\n\t\t\t\t\t\t\t$block_io = new BlockIo($apiKey, $pin, $version);\n\t\t\t\t\t\t\t$address_label = uniqid(Auth::user()->username . \"_\");\n\t\t\t\t\t\t\t$res = $block_io->get_new_address(array('label' => $address_label));\n\t\t\t\t\t\t\t$arr_res = json_decode(json_encode($res), true);\n\t\t\t\t\t\t\tif(isset($arr_res['status']) && (strtolower($arr_res['status']) == \"success\")) {\n\t\t\t\t\t\t\t\tif(isset($arr_res['data']['address']) && $arr_res['data']['address']) {\n\t\t\t\t\t\t\t\t\t$user_btc_address = $arr_res['data']['address'];\n\t\t\t\t\t\t\t\t\t$uaret = Useraddresses::create([\n\t\t\t\t\t\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t\t\t\t\t\t'address' => $user_btc_address,\n\t\t\t\t\t\t\t\t\t\t'address_label' => $address_label,\n\t\t\t\t\t\t\t\t\t\t'is_archived' => 0\n\t\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!is_null($uaret) && $uaret) {\n\t\t\t\t\t\t\t\t\t\t//archive record in DB\n\t\t\t\t\t\t\t\t\t\t$user_arc = Useraddresses::where('address', '=', $old_address);\n\t\t\t\t\t\t\t\t\t\t$user_arc->update(array('is_archived' => 1));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//archive the address using api\n\t\t\t\t\t\t\t\t\t\t$res_arc = $block_io->archive_address(array('addresses' => \"{$old_address}\"));\n\t\t\t\t\t\t\t\t\t\tLog::info(\"old address - $old_address - archived\");\n\t\t\t\t\t\t\t\t\t\tLog::info(\"new address created:\" . $user_btc_address);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$msg = \"Wallet address: $old_address has been archived for security. You new Wallet address is now: $user_btc_address\";\n\t\t\t\t\t\t\t\t\t\tsend_email(Auth::user()->email, Auth::user()->username, 'Wallet Address Updated', $msg);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(\\Exception $e) {\n\t\t\t\tLog::info(\"Exception occurred.\" . $e->getMessage());\n\t\t\t\treturn back()->with('alert', 'Exception occurred' . $e->getMessage());\n\t\t\t}\n\t\t}\n\t}", "function v1_check_db_cn($name, $key, $code, $stime, $etime, $owners, &$error) {\n\t\n\tglobal $warnings;\n\t\n\t// Format times\n\tif (empty($stime)) {\n\t\t$stime=\"0000-00-00 00:00:00\";\n\t}\n\tif (empty($etime)) {\n\t\t$etime=\"9999-12-31 23:59:59\";\n\t}\n\n\t// If already in database, send a warning\n\t$rows=v1_get_id_cn($key, $code, $owners); // Get cn_id, cn_stime, cn_etime from this function \n\t\n\t\n\tforeach ($rows as $row) {\n\t\t// Check time\n\n\t\t// Format times\n//\t\tif (empty($row[$key.'_stime'])) { Nang changed on 09-feb-2012 \n\t\tif (empty($row['cn_stime'])) {\n\t\t\t$cmp_stime=\"0000-00-00 00:00:00\";\n\t\t}\n\t\telse {\n//\t\t\t$cmp_stime=$row[$key.'_stime']; Nang changed on 09-feb-2012 \n\t\t\t$cmp_stime=$row['cn_stime'];\n\t\t}\n//\t\tif (empty($row[$key.'_etime'])) { Nang changed on 09-feb-2012 \n\t\tif (empty($row['cn_etime'])) {\n\t\n\t\t\t$cmp_etime=\"9999-12-31 23:59:59\";\n\t\t}\n\t\telse {\n//\t\t\t$cmp_etime=$row[$key.'_etime']; Nang changed on 09-feb-2012 \n\t\t\t$cmp_etime=$row['cn_etime'];\n\t\t}\n\t\t\n\t\t// If start time is same, warning only\n\t\tif ($stime==$cmp_stime) {\n\t\t\t// Warning: already in database\n\t\t\t$warning_msg=$name.\" code=\\\"\".$code.\"\\\"\";\n\t\t\t// 1st owner\n\t\t\tif (!empty($owners[0])) {\n\t\t\t\t$warning_msg.=\" owner1=\\\"\".$owners[0]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 2nd owner\n\t\t\tif (!empty($owners[1])) {\n\t\t\t\t$warning_msg.=\" owner2=\\\"\".$owners[1]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 3rd owner\n\t\t\tif (!empty($owners[2])) {\n\t\t\t\t$warning_msg.=\" owner3=\\\"\".$owners[2]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t$warning_msg.=\" startTime=\\\"\".$stime.\"\\\"\";\n\t\t\tarray_push($warnings, $warning_msg);\n\t\t}\n\t\telse {\n\t\t\t// No error = only if end time strictly before compared start time OR start time strictly after compared end time\n\t\t\tif (strcmp($stime, $cmp_etime)<=0 && strcmp($etime, $cmp_stime)>=0) {\n\t\t\t\t$error=\"&lt;\".$name.\" code=\\\"\".$code.\"\\\" owner1=\\\"\".$owners[0]['code'].\"\\\"&gt;, the timeframe [\".$stime.\", \".$etime.\"] overlaps with existing data in database [\".$cmp_stime.\", \".$cmp_etime.\"]\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "public function testKeyGeneratorWithNoCookie()\n {\n $localisationCookieIdGenerator = new LocalisationCookieIdGenerator();\n\n $request = new Request();\n\n $id = $localisationCookieIdGenerator->generate($request);\n $this->assertEquals('', $id);\n }", "function check_availability($post = array()){\n\t\t$result = array('result' => \"failed\", 'message' => 'Error has been occured. Please try again later.');\n\t\tif(is_array($post) && sizeof($post) > 0){ //kena besar dari kosong, kalau kurang ada error.\n\t\t\t$end_time = date(\"H:i\", strtotime($post['booking_time'] . ' +'.$post['duration'] . ' hour')); //dapatkan end time\n\t\t\t$booking_date_time = date(\"Y-m-d\", strtotime(datepicker2mysql($post['booking_date']))) . ' ' . $post['booking_time'].':00'; //dapatkan date and time. eg: 2017-11-09 23:00\n\t\t\t$booking_date_time_end = date(\"Y-m-d H:i:s\", strtotime($booking_date_time . ' +'.$post['duration'] . ' hour')); //dapatkan end time sekali date. eg: 2017-11-10 01:00 (beza dia kat tarikh)\n\t\t\t\n\t\t\t/* 1. dia check start time dalam masa operation hour ke tak\n\t\t\t or \n\t\t\t 2. dia check end time in between 3am-8am\n\t\t\t 3. kalau true, keluar result\n\t\t\t */\n\t\t\tif((strtotime($post['booking_time']) >= strtotime(\"03:00\") && strtotime($post['booking_time']) < strtotime(\"08:00\")) ||\n\t\t\t(strtotime($end_time) > strtotime(\"03:00\") && strtotime($end_time) < strtotime(\"08:00\"))){\n\t\t\t\t$result['message'] = \"Court is unavailable. Operation hour is from 8:00 AM until 3:00 AM\";\n\t\t\t}\n\t\t\t//check booking date, kalau sebelum dari current time, keluar result.\n\t\t\telse if(strtotime($booking_date_time) < strtotime(date(\"Y-m-d H:i:s\"))){\n\t\t\t\t$result['message'] = \"The time is already passed. Please choose another time.\";\n\t\t\t}\n\t\t\t//ni baru check database\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t/* ini query nak check availability dalam database.\n\t\t\t\t 1. kalau masa start tu in between masa yang dah booking\n\t\t\t\t 0r\n\t\t\t\t 2. end time dia habis dalam masa orang yang dah booking\n\t\t\t\t 3. check status \n\t\t\t\t 4. check court id dulu baru 1, 2, 3\n\t\t\t\t*/\n\t\t\t\t$query_chk = $this->db->query(\"SELECT * FROM `ef_booking` \"\n\t\t\t\t\t\t\t\t\t\t\t. \"WHERE `court_id` = \" . $this->db->escape($post['court_id']) . \" \"\n\t\t\t\t\t\t\t\t\t\t\t. \"AND ((`booking_date_time` <= \" . $this->db->escape($booking_date_time) . \" AND `booking_date_time_end` > \" . $this->db->escape($booking_date_time) . \") \"\n\t\t\t\t\t\t\t\t\t\t\t. \"OR (`booking_date_time` < \" . $this->db->escape($booking_date_time_end) . \" AND `booking_date_time_end` >= \" . $this->db->escape($booking_date_time_end) . \")) \"\n\t\t\t\t\t\t\t\t\t\t\t. \"AND `status` != 'C'\");\n\t\t\t\t//kalau ada result, maksudnya dah reserved. \n\t\t\t\tif($query_chk->num_rows() > 0){\n\t\t\t\t\t$result['message'] = \"We're sorry, court is unavailable (Already reserved). Please check on another court/date/time.\";\n\t\t\t\t}\n\t\t\t\t//kumpul data\n\t\t\t\telse{\n\t\t\t\t\t$row_court = $this->court_m->get_single($post['court_id']);\n\t\t\t\t\t$rate_per_hour = 80.00;\n\t\t\t\t\t$result['booking_details'] = array(\n\t\t\t\t\t\t'booking_date_time_view' => date(\"d/m/Y g:i A\", strtotime($booking_date_time)),\n\t\t\t\t\t\t'booking_date_time_end_view' => date(\"d/m/Y g:i A\", strtotime($booking_date_time . ' +'.$post['duration'] . ' hour')),\n\t\t\t\t\t\t'booking_date_time' => date(\"Y-m-d H:i:s\", strtotime($booking_date_time)),\n\t\t\t\t\t\t'booking_date_time_end' => date(\"Y-m-d H:i:s\", strtotime($booking_date_time . ' +'.$post['duration'] . ' hour')),\n\t\t\t\t\t\t'date' => date(\"l, jS F Y\", strtotime($booking_date_time)),\n\t\t\t\t\t\t'start_end' => date(\"g:i A\", strtotime($booking_date_time)) . ' - ' . date(\"g:i A\", strtotime($booking_date_time_end)),\n\t\t\t\t\t\t'duration_view' => $post['duration'] . ' ' . ($post['duration'] > 1 ? 'Hours' : 'Hour'),\n\t\t\t\t\t\t'duration' => $post['duration'],\n\t\t\t\t\t\t'amount' => number_format($rate_per_hour * $post['duration'], 2, \".\", \"\"),\n\t\t\t\t\t\t'court_id' => $post['court_id'],\n\t\t\t\t\t\t'court_name' => isset($row_court) !== false ? $row_court->court_name : $post['court_id']\n\t\t\t\t\t);\n\t\t\t\t\t$result['encrypted_booking'] = encrypt_data($result['booking_details']);\n\t\t\t\t\t$result['result'] = \"success\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function testGenerateFormatWithoutReplaceChar()\n {\n $key = Keys::Generate(\"hdjas-skajdkasj-dj938-8848\");\n }", "public function test() {\r\n $this->vkdata = date(\"Y-m-d H:i:s\");\r\n\r\n }", "public function getRandomKey($cargo_id, $dealer_id) {\n //echo 'dealer id: '.$dealer_id;\n // GENERACION Y ASIGNACION DE USUARIOS EXONERADOS DE LOS CLIENTES GENERADOS\n $connection = @mysql_connect('localhost', 'root', 'k143c89?4Fg&2')\n or die('Could not connect to database');\n mysql_select_db('callcenter')\n or die('Could not select database');\n\n $array_ids = array();\n\n //$dealer_id = $this->getConcesionarioDealerId($id_responsable);\n $sql = \"SELECT gr.*,u.status_asesor FROM grupoconcesionariousuario gr \n INNER JOIN usuarios u ON u.id = gr.usuario_id \n WHERE (u.cargo_id = {$cargo_id} OR u.cargo_adicional = {$cargo_id}) AND u.status_asesor = 'ACTIVO' AND gr.concesionario_id = {$dealer_id}\";\n $res = mysql_query($sql) or die(\"Could not execute query1\");\n //die($sql); \n //die('count: ' . mysql_num_rows($res));\n if (mysql_num_rows($res) > 0) {\n //die('enter not null');\n while($row = mysql_fetch_array($res,MYSQL_ASSOC)) {\n $array_ids[] = $row['usuario_id'];\n //echo 'usuario id: '.$row['usuario_id'];\n }\n //print_r($array_ids);die();\n // ID DEL ASESOR A SER ASIGNADO CLIENTE\n $random_key = $array_ids[array_rand($array_ids)];\n // ID DEL ASESOR EN TABLA usuarios PONEMOS ESTADO INACTIVO\n $sqlupd = \"UPDATE usuarios SET status_asesor='INACTIVO' WHERE id={$random_key}\";\n //die('sql: '.$sqlupd);\n $res2 = mysql_query($sqlupd) or die(\"Could not execute query update\");\n } else {\n //die('enter else');\n $sql2 = \"SELECT gr.*,u.status_asesor FROM grupoconcesionariousuario gr \n INNER JOIN usuarios u ON u.id = gr.usuario_id \n WHERE (u.cargo_id = {$cargo_id} OR u.cargo_adicional = {$cargo_id}) AND u.status_asesor = 'INACTIVO' AND gr.concesionario_id = {$dealer_id}\";\n //die('sql empty: '.$sql2);\n $res2 = mysql_query($sql2) or die(\"Could not execute query2\");\n //die('count: ' . mysql_num_rows($res2));\n if(mysql_num_rows($res2) == 0){\n return 0;\n } \n while($row2 = mysql_fetch_array($res2)) {\n $usuario_id = $row2['usuario_id'];\n $sqlupd2 = \"UPDATE usuarios SET status_asesor='ACTIVO' WHERE id={$usuario_id}\";\n $res3 = mysql_query($sqlupd2) or die(\"Could not execute query update\");\n }\n $sql3 = \"SELECT gr.*,u.status_asesor FROM grupoconcesionariousuario gr \n INNER JOIN usuarios u ON u.id = gr.usuario_id \n WHERE (u.cargo_id = {$cargo_id} OR u.cargo_adicional = {$cargo_id}) AND u.status_asesor = 'ACTIVO' AND gr.concesionario_id = {$dealer_id}\";\n $res4 = mysql_query($sql3) or die(\"Could not execute query3\");\n while($row3 = mysql_fetch_array($res4)) {\n $array_ids[] = $row3['usuario_id'];\n }\n // ID DEL ASESOR A SER ASIGNADO CLIENTE\n $random_key = $array_ids[array_rand($array_ids)];\n // ID DEL ASESOR EN TABLA usuarios PONEMOS ESTADO INACTIVO\n $sqlupd3 = \"UPDATE usuarios SET status_asesor='ACTIVO' WHERE id={$random_key}\";\n //die('$sqlupd3: '.$sqlupd3);\n $res5 = mysql_query($sqlupd3) or die(\"Could not execute query4\");\n }\n return $random_key;\n }", "public function testGenerateUniqueKeyTrue()\n {\n $generator = new UniqueJobIdentifierGenerator(true);\n $unique = 'c1af4ce5c9773ce30d8cc6d1e0e7d699';\n\n $this->assertEquals('uniqueValue', $generator->generateUniqueKey(\n 'name',\n 'params',\n 'uniqueValue',\n 'method'\n ));\n $this->assertEquals($unique, $generator->generateUniqueKey(\n 'name',\n 'params',\n false,\n 'method'\n ));\n $this->assertEquals($unique, $generator->generateUniqueKey(\n 'name',\n 'params',\n null,\n 'method'\n ));\n $this->assertEquals($unique, $generator->generateUniqueKey(\n 'name',\n 'params',\n '',\n 'method'\n ));\n }", "static public function key_is_correct($api_key = '') {\n\n\t\treturn preg_match('/^[a-z\\d]{3,15}$|^$/', $api_key);\n\n\t}", "private function validateReviewerKey(){\n\t\treturn true;\n\t}", "function __validToken($token_created_at) {\n $expired = strtotime($token_created_at) + 86400;\n $time = strtotime(\"now\");\n if ($time < $expired) {\n return true;\n }\n return false;\n }", "private static function isKeyDateField($key){\n\t\t$dateFields = array('EXPIRATION_DATE', \n\t\t\t\t\t\t\t'operationDate',\n\t\t\t\t\t\t\t'currentPeriodStart', \n\t\t\t\t\t\t\t'currentPeriodEnd',\n\t\t\t\t\t\t\t'dateCharge');\n\n\t\tforeach($dateFields as $field){\n\t\t\tif($field === $key){\n\t\t\t\treturn true;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }", "function _gensesskey() {\n # with compliments to \"ripat at lumadis dot be\" from php.net online docs\n $acceptedChars = 'azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN0123456789';\n $max = strlen($acceptedChars)-1;\n $key = null;\n for ($i = 0; $i < 64; $i++) {\n $key .= $acceptedChars{mt_rand(0, $max)};\n }\n return $key;\n }", "abstract protected function isExpired();", "public function check_hash_expiry_valid($hash_expiry){\n \t$current_date = new DateTime();\n\t\t$hash_expiry = new DateTime($hash_expiry);\n\t\t$interval = $current_date->diff($hash_expiry); //currentdate - hashexpiry\n\n\t\t//get elapsed\n\t\t$elapsed_day = $interval->format('%a');\n\t\t$elapsed_hour = $interval->format('%h');\n\n\t\tif($elapsed_day <= 1){\n\t\t\t$hrOneDay = ($elapsed_day == 1 ? 24:0);\n\t\t\t$total_elapsed_hour = $hrOneDay + $elapsed_hour;\n\n\t\t\tif($total_elapsed_hour <= 24){\n\t\t\t\t//return \"Valid:: \".$elapsed_day .\" day, \" . $elapsed_hour .\" hours\";\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\t//return \"ExpiredE:: \".$elapsed_day .\" day, \" . $elapsed_hour .\" hours\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t//return \"ExpiredDay:: \".$elapsed_day .\" day, \" . $elapsed_hour .\" hours\";\n\t\t\treturn FALSE;\n\t\t}\n }", "function generateKeyReference($table, $conn){\n\n //ambil id terakhir di database lalu ditambah 1 untuk nomor\n\n //Tentukan code dan pilih id di table\n if ($table == \"tipe_sawah\") {\n $code = \"TSW\";\n $sql = \"select id_tipe_sawah from tipe_sawah ORDER BY id_tipe_sawah DESC LIMIT 1\";\n } elseif ($table == \"bekas_sawah\") {\n $code = \"BSW\";\n $sql = \"select id_bekas_sawah from bekas_sawah ORDER BY id_bekas_sawah DESC LIMIT 1\";\n } elseif ($table == \"irigasi_sawah\") {\n $code = \"ISW\";\n $sql = \"select id_irigasi_sawah from irigasi_sawah ORDER BY id_irigasi_sawah DESC LIMIT 1\";\n }\n\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n\n if ($table == \"tipe_sawah\") {\n $mykey = $row['id_tipe_sawah'];\n } elseif ($table == \"bekas_sawah\") {\n $mykey = $row['id_bekas_sawah'];\n } elseif ($table == \"irigasi_sawah\") {\n $mykey = $row['id_irigasi_sawah'];\n }\n\n $breake = explode(\"-\", $mykey);\n\n $num = $breake[1] + 1;\n $threeNum = sprintf(\"%03d\", $num);\n\n $key = $code . \"-\" . $threeNum;\n\n // echo $key;\n return $key;\n}", "function getReattemptDate($reattempt_date, $parameters)\n\t{\n\t\t$holidays = Fetch_Holiday_List();\n\t\t$pdc = new Pay_Date_Calc_3($holidays);\n\t\t$today = date('Y-m-d');\n\n\t\t$date_pair = array();\n\t\t$date_pair['event'] = '';\n\t\t$date_pair['effective'] = '';\n\t\t\n\t\tswitch($reattempt_date)\n\t\t{\n\t\t\t// Re-Attempt the next business day\n\t\t\tcase 'immediate':\n\t\t\t\tif(Has_Batch_Closed())\n\t\t\t\t{\n\t\t\t\t\t$date_pair['event'] = $pdc->Get_Next_Business_Day($today);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$date_pair['event'] = $today;\n\t\t\t\t}\n\t\t\t\t$date_pair['effective'] = $pdc->Get_Next_Business_Day($date_pair['event']);\n\t\t\t\tbreak;\n\n\t\t\t// Since HMS & Impact get their returns at the end of the day this is almost always going to\n\t\t\t// be the same as 'immediate'.\n\t\t\tcase '1 day':\n\t\t\t\t$date_pair['event'] = $pdc->Get_Next_Business_Day($today);\n\t\t\t\t$date_pair['effective'] = $pdc->Get_Next_Business_Day($date_pair['event']);\n\t\t\t\tbreak;\n\n\t\t\tcase '2 days':\n\t\t\tcase '3 days':\n\t\t\tcase '4 days':\n\t\t\tcase '5 days':\n\t\t\tcase '6 days':\n\t\t\tcase '7 days':\n\t\t\tcase '8 days':\n\t\t\tcase '9 days':\n\t\t\tcase '10 days':\n\t\t\t\t$days = trim(substr($reattempt_date, 0, 2));\n\t\t\t\t$date_pair['event'] = $pdc->Get_Business_Days_Forward($today, $days);\n\t\t\t\t$date_pair['effective'] = $pdc->Get_Next_Business_Day($date_pair['event']);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'next pay day or 15 days':\n\n\t \t\t$next_paydate = Get_Next_Payday(date(\"Y-m-d\"), $parameters->info, $parameters->rules);\n\t\t\t\t$fortnight_n_change = $pdc->Get_Calendar_Days_Forward(date('Y-m-d'), 15);\t\t\n \t\t\n\t\t\t\tif(strtotime($fortnight_n_change) < strtotime($next_paydate['effective']))\n\t\t\t\t{\n\t\t\t\t\t$date_pair['effective'] = $pdc->Get_Closest_Business_Day_Forward($fortnight_n_change);\n\t\t\t\t\t$date_pair['event'] = $pdc->Get_Business_Days_Backward($fortnight_n_change,1);\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$date_pair = $next_paydate;\n\t\t\t\t}\n\n\t\t\tbreak;\n\t\n\t\t\tcase 'next friday':\n\t\t\t\tif (Has_Batch_Closed()) \n\t\t\t\t{\n\t\t\t\t\t$date = strtotime(date('Y-m-d') . ' +2 day');\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$date = strtotime(date('Y-m-d') . ' +1 day');\n\t\t\t\t}\n\t\t\t\twhile ($date_pair['effective'] == '')\n\t\t\t\t{\t\n\t\t\t\t\tif(date('w',$date) == 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($pdc->Is_Holiday($date))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$date_pair['effective'] = $pdc->Get_Business_Days_Backward($date,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$date_pair['effective'] = date('Y-m-d',$date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$date_pair['event'] = $pdc->Get_Business_Days_Backward($date_pair['effective'],1);\n\t\t\t\t\t}\n\t\t\t\t\t$date = strtotime(date('Y-m-d',$date) . ' +1 day');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase '15th or 30th':\n\t\t\n\t\t\t\tif (Has_Batch_Closed()) \n\t\t\t\t{\n\t\t\t\t\t$date = strtotime(date('Y-m-d') . ' +2 day');\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$date = strtotime(date('Y-m-d') . ' +1 day');\n\t\t\t\t}\n\t\t\t\twhile ($date_pair['effective'] == '')\n\t\t\t\t{\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(date('j',$date) == 15 || date('j',$date) == 30)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ($pdc->isBusinessDay($date)) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$date_pair['effective'] = date('Y-m-d',$date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$date_pair['effective'] = $pdc->Get_Business_Days_Backward($date,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$date_pair['event'] = $pdc->Get_Business_Days_Backward($date_pair['effective'],1);\n\t\t\t\t\t}\n\t\t\t\t\t$date = strtotime(date('Y-m-d',($date)) . ' +1 day');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'none':\n\t\t\t\t$date_pair = null;\n\t\t\t\tbreak;\n\t\t\t// Re-Attempt on the customer's next pay day (Default)\n\t\t\tcase 'next pay day':\n\t\t\tdefault: \n\t\t\t\t$date_pair = Get_Next_Payday(date(\"Y-m-d\"), $parameters->info, $parameters->rules);\n\t\t\t\tbreak;\n\t\t}\n\t\t$this->Log(\"Scheduling reattempt for {$date_pair['event']} - {$date_pair['effective']} based on the rule '{$reattempt_date}'\");\n\t\treturn $date_pair;\n\t\t\n\t}", "function IfExists($holidaycode) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM `specialdates` WHERE RateCode='$holidaycode'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }", "public function getNewTCE() {}", "private function validate_booking(): bool {\n\t $this->errors = array();\n\n // Clear data using test_input function\n foreach ($this->request->post as $key => $value) {\n $this->request->post[$key] = self::test_input($this->request->post[$key]);\n }\n\n // Time\n if(!(preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/\", $this->request->post[\"time\"]))){\n array_push($this->errors,$this->language->get('time_error'));\n }\n\n // Date\n $temp = new DateTime();\n\n // Create date object (without time)\n $date = DateTime::createFromFormat('Y-m-d', $this->request->post[\"date\"]);\n\n // Remove time from datetime string\n $now = DateTime::createFromFormat(\"Y-m-d\", $temp->format(\"Y-m-d\"));\n\n // Extract data\n $year = $date->format(\"Y\");\n $month = $date->format(\"m\");\n $day = $date->format(\"d\");\n\n if($date < $now){\n array_push($this->errors,$this->language->get('date_past_error'));\n }\n else if(!checkdate($month,$day,$year)) {\n //$this->errors[\"date\"] = $this->language->get('date_error');\n array_push($this->errors,$this->language->get('date_value_error'));\n }\n\n //TODO: REMOVE\n return count($this->errors) == 0;\n }", "function _get_input_date($stub,$get_also=false)\n{\n\t$timezone=post_param('timezone',get_users_timezone());\n\tif ($get_also)\n\t{\n//\t\tif (either_param_integer($stub,0)==0) return NULL; // NULL was chosen\t\tDoesn't work like this now\n\n\t\t$year=either_param_integer($stub.'_year',NULL);\n\t\tif (is_null($year)) return NULL;\n\t\t$month=either_param_integer($stub.'_month',NULL);\n\t\tif (is_null($month)) return NULL;\n\t\t$day=either_param_integer($stub.'_day',NULL);\n\t\tif (is_null($day)) return NULL;\n\t\t$hour=either_param_integer($stub.'_hour',NULL);\n\t\t$minute=either_param_integer($stub.'_minute',NULL);\n\t} else\n\t{\n//\t\tif (post_param_integer($stub,0)==0) return NULL; // NULL was chosen\t\tDoesn't work like this now\n\n\t\t$year=post_param_integer($stub.'_year',NULL);\n\t\tif (is_null($year)) return NULL;\n\t\t$month=post_param_integer($stub.'_month',NULL);\n\t\tif (is_null($month)) return NULL;\n\t\t$day=post_param_integer($stub.'_day',NULL);\n\t\tif (is_null($day)) return NULL;\n\t\t$hour=post_param_integer($stub.'_hour',NULL);\n\t\t$minute=post_param_integer($stub.'_minute',NULL);\n\t}\t\n\n\tif (!checkdate($month,$day,$year)) warn_exit(do_lang_tempcode('INVALID_DATE_GIVEN'));\n\n\tif (is_null($hour))\n\t{\n\t\tif (strpos($stub,'end')!==false)\n\t\t{\n\t\t\t$hour=23;\n\t\t\t$minute=59;\n\t\t} else\n\t\t{\n\t\t\t$hour=0;\n\t\t\t$minute=0;\n\t\t}\n\t}\n\n\t$time=mktime($hour,$minute,0,$month,$day,$year);\n\tif (($year>=1970) || (@strftime('%Y',@mktime(0,0,0,1,1,1963))=='1963')) // Only try and do timezone conversion if we can do proper maths this far back\n\t{\n\t\t$amount_forward=tz_time($time,$timezone)-$time;\n\t\t$time=$time-$amount_forward;\n\t}\n\n\treturn $time;\n}", "function check_deadline_24h($date) {\n // return false is there is no due date\n if ($date === '') {\n return false;\n }\n\n $currTimestamp= time();\n $secondsLeft = $date - $currTimestamp;\n $hoursLeft = floor($secondsLeft / 3600);\n\n return $hoursLeft < 24;\n}", "function check($auction_id, $end_time, $data, $smartAutobids = false) {\n\t$autobid = mysql_fetch_array(mysql_query(\"SELECT * FROM autobids WHERE auction_id = $auction_id\"), MYSQL_ASSOC);\n\n\tif(!empty($autobid)) {\n\t\tif($autobid['end_time'] == $end_time) {\n\t\t\tif($autobid['deploy'] <= date('Y-m-d H:i:s')) {\n\t\t\t\t// lets place the bid!\n\t\t\t\tplaceAutobid($auction_id, $data, $smartAutobids, time() - $end_time);\n\t\t\t\tmysql_query(\"DELETE FROM autobids WHERE auction_id = $auction_id\");\n\n\t\t\t\t$auction = mysql_fetch_array(mysql_query(\"SELECT end_time FROM auctions WHERE id = $auction_id\"), MYSQL_ASSOC);\n\t\t\t\t$end_time = $auction['end_time'];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tmysql_query(\"DELETE FROM autobids WHERE auction_id = $auction_id\");\n\t\t}\n\t}\n\n\t$str_end_time = strtotime($end_time);\n\t$timeDifference = $str_end_time - time();\n\t$randomTime = rand(3, $timeDifference);\n\t$deploy = date('Y-m-d H:i:s', $str_end_time - $randomTime);\n\n\tmysql_query(\"INSERT INTO autobids (deploy, end_time, auction_id) VALUES ('$deploy', '$end_time', '$auction_id')\");\n\n\treturn $data;\n}", "function generateCode(){\n $base=\"abcdefghijklmnopkrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-\";\n $i=0;\n $c=\"\";\n while ($i<6){\n $c.=$base[rand(0,strlen($base)-1)];\n $i++;\n }\n if (validate::existCode($c))\n return generateCode();\n return $c;\n}", "public function final_booking_random(){\n\t\t$seatno = $this->input->post('seatno');\n\t\t$passenger = $this->TicketModel->add_customer($this->input->post());\n\t\t$p_id = array(\n\t\t\t'p_id' => $passenger->p_id,\n\t\t\t'username' => $passenger->fname.' '.$passenger->lname,\n\t\t\t'cnic' => $passenger->cnic,\n\t\t\t'gender' => $passenger->gender,\n\t\t\t'seatno' => $seatno,\n\t\t\t'state' => 1\n\t\t);\n\t\t$this->session->set_userdata($p_id);\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/nav');\n\t\t$this->load->view('seatbooking/final_check');\n\t\t$this->load->view('layout/footer');\n\t}", "public function it_should_have_a_release_date_for_france()\n {\n // key is case sensitive\n $this->getReleaseDates()->shouldHaveKey('France');\n }", "function validateItinerary($input=''){\n\t\t$date_format = 'Y-m-d';\n\t\t$input = trim($input);\n\t\t$time = strtotime($input);\n\n\t\t$is_valid = date($date_format, $time) == $input;\n\n\t\treturn $is_valid;\n\t\t\n\t}", "function CreateTravelRate() {\r\n $conn = conn();\r\n $sql = \"INSERT INTO `travelrates`(`TravelCode`, `TravelAmount`, `Modified`, `ModifiedBy`) \r\n VALUES ('$this->TravCode','$this->TravRate',NOW(),'$this->ModifiedBy')\";\r\n if ($conn->exec($sql)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n $conn = NULL;\r\n }", "function sperahid() {\n\t\t// we don't need to set StoreCard to true if the card hasn't expired and also\n\t\t// we need to set the HPP to use the stored card instead of asking for a new one and\n\t\t// we probably just go ahead and charge the stored card, and only use HPP if the stored card\n\t\t// fails and we mark the stored card inactive or delete it on failure and just go with the new one on the transaction\n\t\t// results\n\n\t\t$StoreCard = (isset($_REQUEST['StoreCard']) && $_REQUEST['StoreCard'] == 'true') ? true : false;\n\n\t\t$amountDue = $_REQUEST['amountDue'];\n\n\t\t$this->load->library('protectpayapi');\n\n\t\t$applicationEnv = ENVIRONMENT;\n\n\n\t\t$parsedAccountUrlPrefix = $_SESSION['accountUrlPrefix'];\n\n\t\t$databaseName = $parsedAccountUrlPrefix . '_' . ENVIRONMENT;\n\n\t\t/** @var CI_DB_mysql_driver $primaryDatabase */\n\t\t$primaryDatabase = $this->load->database('primary', TRUE);\n\n\t\t$params = [\n\t\t\t'primaryDatabase' => $primaryDatabase,\n\t\t];\n\t\t$this->load->library('account', $params);\n\n\t\t$params = [\n\t\t\t'databaseName' => $databaseName,\n\t\t\t'primaryDatabase' => $primaryDatabase];\n\n\t\t$this->load->library('propay_api', $params);\n\n\t\t$data = [\n\t\t\t\"Amount\" => (int) $amountDue, //convert to cents\n\t\t\t\"AuthOnly\" => false,\n\t\t\t\"AvsRequirementType\" => 3,\n\t\t\t\"CardHolderNameRequirementType\" => 2,\n\t\t\t\"CssUrl\" => \"https://spera-\" . $applicationEnv . \".s3-us-west-2.amazonaws.com/pmi.css\",\n\t\t\t\"CurrencyCode\" => \"USD\",\n\t\t\t\"InvoiceNumber\" => $_SESSION['accountUrlPrefix'],\n\t\t\t\"MerchantProfileId\" => PROTECT_PAY_MERCHANT_PROFILE_ID,\n\t\t\t\"OnlyStoreCardOnSuccessfulProcess\" => $StoreCard,\n\t\t\t\"PayerAccountId\" => PROTECT_PAY_PAYER_ACCOUNT_ID,\n\t\t\t\"ProcessCard\" => true,\n\t\t\t\"Protected\" => false,\n\t\t\t\"SecurityCodeRequirementType\" => 1,\n\t\t\t\"StoreCard\" => $StoreCard,\n\t\t];\n\n\t\tif ($_REQUEST['paymentType'] == 'card') {\n\t\t\t$data[\"PaymentTypeId\"] = \"0\";\n\t\t} else if ($_REQUEST['paymentType'] == 'ach') {\n\t\t\t$data[\"PaymentTypeId\"] = \"1\";\n\t\t}\n\n\t\t$result = $this->protectpayapi\n\t\t\t->setApiBaseUrl(PROTECT_PAY_API_BASE_URL)\n\t\t\t->setBillerId(PROTECT_PAY_BILLER_ID)\n\t\t\t->setAuthToken(PROTECT_PAY_AUTH_TOKEN)\n\t\t\t->setHostedTransactionData($data)\n\t\t\t->createHostedTransaction()\n\t\t\t->getCreatedHostedTransactionInfo();\n\t\t$responseObject = json_decode($result);\n\n\t\tif ( $responseObject ) {\n\t\t\t$_SESSION['paymentType'] = $_REQUEST['paymentType'];\n\t\t\t$_SESSION['HostedTransactionIdentifier'] = $responseObject->HostedTransactionIdentifier;\n\t\t\t$_SESSION['merchantProfileId'] = PROTECT_PAY_MERCHANT_PROFILE_ID;\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode([\n\t\t\t'success' => true,\n\t\t\t'message' => $amountDue, //'Hosted Transaction Identifier Created Successfully.',\n\t\t\t'HostedTransactionIdentifier' => $_SESSION['HostedTransactionIdentifier']\n\t\t]);\n\n\t\tdie();\n\t}", "function get_ttl() {\n $dayofweek = (int) date('w', strtotime('now')); \n // use 1 for monday, 7 for sunday\n if($dayofweek == 0) {\n $dayofweek = 7;\n }\n // assign TTL based on current day (17 backups)\n $ttl_map = [\n 1 => 7, // one week\n 2 => 7, // one week\n 3 => 7, // one week\n 4 => 7, // one week\n 5 => 7, // one week\n 6 => 28, // four weeks\n 7 => 56 // two months \n ];\n \n return $ttl_map[$dayofweek];\n}", "function get_ttl() {\n $dayofweek = (int) date('w', strtotime('now')); \n // use 1 for monday, 7 for sunday\n if($dayofweek == 0) {\n $dayofweek = 7;\n }\n // assign TTL based on current day (17 backups)\n $ttl_map = [\n 1 => 7, // one week\n 2 => 7, // one week\n 3 => 7, // one week\n 4 => 7, // one week\n 5 => 7, // one week\n 6 => 28, // four weeks\n 7 => 56 // two months \n ];\n \n return $ttl_map[$dayofweek];\n}", "public function clean_expired_keys()\n {\n }", "private function generateApiKey() {\n return md5(uniqid(rand(), true));\n }", "private function generateApiKey() {\n return md5(uniqid(rand(), true));\n }", "public function generateForKey($key, $time)\n {\n if ($secret = $this->client->getAppSecretForKey($key)) {\n return $this->generate($key, $secret, $time);\n }\n }", "function generate_token()\n {\n $this->load->helper('security');\n $res = do_hash(time().mt_rand());\n $new_key = substr($res,0,config_item('rest_key_length'));\n return $new_key;\n }", "function generateId(){\n $a = date('Ymd');\n $b = rand(1000, 9999);\n $c = rand(100, 999);\n $d = $a.$b.$c;\n if(strlen($d) !== 15){\n return str_pad($d, 15, '0', STR_PAD_RIGHT);\n }\n return $d;\n}", "function almost_expired($jwt) {\n //$ALMOST_EXPIRED_RENEW = 3600;\n $almost_expired_gap = ALMOST_EXPIRED_GAP;\n\n // if we use class we dont need to repeat get configuration\n $config = Factory::fromFile('config/config-moorecloud.php', true);\n $secretKey = base64_decode($config->get('jwt')->get('key'));\n $algorithm = $config->get('jwt')->get('algorithm');\n JWT::$leeway = 60; \n $decoded = JWT::decode($jwt,\n $secretKey,\n [$algorithm]\n );\n $decoded_array = (array) $decoded;\n \n $expire = $decoded_array['exp'];\n $gap = $expire - time();\n if ($gap > 0 && $gap <= $almost_expired_gap) {\n echo \"need renew\";\n return true;\n } else {\n echo \"good token\";\n }\n\n return false;\n}", "function generate_fingerprint() \n\t{\n\t\t//We don't use the ip-adress, because it is subject to change in most cases\n// \t\tforeach(array('ACCEPT_CHARSET', 'ACCEPT_ENCODING', 'ACCEPT_LANGUAGE', 'USER_AGENT') as $name) {\n// \t\t\t$key[] = empty($_SERVER['HTTP_'. $name]) ? NULL : $_SERVER['HTTP_'. $name];\n// \t\t}\n// \t\t//Create an MD5 has and return it\n// \t\treturn md5(implode(\"\\0\", $key));\n\t\t$secure_word = 'a39ccdef11305d5999dbccddcf4';\n\t\treturn md5($secure_word.$_SERVER['HTTP_USER_AGENT']);\t\t\n\t}", "private function _checkPk() {\n\t\t$result = false;\n\t\t$private_key = Mage::helper ( 'masterpass' )->checkPrivateKey ();\n\t\tif (! $private_key) {\n\t\t\tMage::getSingleton ( 'core/session' )->addError ( Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' ) );\n\t\t\t// save long access token\n\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t$longAccessToken = null;\n\t\t\t$customerData->setData ( 'longtoken', $longAccessToken );\n\t\t\t\n\t\t\t$customerData->save ();\n\t\t\t// $this->_redirect('checkout/cart');\n\t\t\t// $this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());\n\t\t\t$result = true;\n\t\t}\n\t\treturn $result;\n\t}", "function eddenvato_verify_license($key){\n\n\t// Setup Call\n\t$envato_apikey = get_option('eddenvato-api-key');\n\t$envato_username = get_option('eddenvato-user-name');\n\t$license_to_check = $key;\n\treturn wp_remote_get( 'http://marketplace.envato.com/api/edge/'.$envato_username.'/'.$envato_apikey.'/verify-purchase:'.$license_to_check.'.json' );\n\n}", "public function checkreferemailandkey($email,$key){\n\t\t$this->db->where('ReferedTo', $email);\n\t\t$this->db->where('UniqueKey', $key);\n\t\t$query=$this->db->get('tbl_bvpoint_data');\n\t\tif($query->num_rows()==1){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "function match_key($key, $email, $dbString){\r\n $m = new Mongo($dbString);\r\n $db = $m->users;\r\n $reset_coll = $db->user_reset_password;\r\n $cursor = $reset_coll->find(array('email_label' => $email, 'key' => $key, \"is_active\" => '1'));\r\n if($cursor->count() == 0 || $cursor->count() > 1) return false;\r\n foreach ($cursor as $obj) {\r\n if($obj['key_generated_on'] >= (time() - 86400)){\r\n $reset_coll->update(array('email_label' => $email, \"is_active\" => '1'),array('$set' => array('is_active' => '0')));\r\n return true;\r\n }\r\n }\r\n}", "function generate_key()\n\t{\n\t\treturn $this->key_prefix . md5( $this->key_prefix . microtime() . uniqid() . 'teamps' );\n\t}", "function recurringdowntime_generate_sid()\n{\n return md5(uniqid(microtime()));\n}", "function obtener_sal()\n{\n\treturn uniqid('', true);\n}", "public function validateTokenTime($token) {\n \t// get token validation\n \tif(Reset::where('token', $token)->count() > 0) {\n\t \t$reset = Reset::where('token', $token)->first();\n\n\t \tdate_default_timezone_set('UTC'); \n\t $date_two = date('Y-m-d H:i:s ', time());\n\n\t $minutes = round((strtotime($date_two) - strtotime($reset->updated_at)) / 60,2);\n\t $hours = round((strtotime($date_two) - strtotime($reset->updated_at))/(60*60));\n\n\t if($hours >= 24) {\n\t return \"expired\";\n\t } else {\n\t return \"working\";\n\t }\n\t } else {\n\t \treturn \"working\";\n\t }\n }", "function check_formkey($formkey)\r\n\t{\r\n\t\t$code = decrypt($formkey);\r\n\t\t\r\n\t\treturn (($code >= 1199116800 && REQUEST_TIME - $code <= FORMKEY_TIMEOUT) ? true : false);\r\n\t\t\r\n\t}", "private function createToken()\n {\n $this->token = md5(time().uniqid());\n return true;\n }", "private function _validate_key($endpoint,$key)\n\t{\n\t\tif($row = $this->db->where('key',strtoupper($key))->get('nct_api_keys')->row())\n\t\t{\n\t\t\tif($row->max_allowed > $row->tot_curr_requests)\n\t\t\t{\n\t\t\t\t$this->key_id = $row->id;\n\t\t\t\tif($row->enabled)\n\t\t\t\t{\n\t\t\t\t\treturn $row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.62814796", "0.5932315", "0.5902009", "0.5747457", "0.5605034", "0.5410524", "0.5351025", "0.533453", "0.53118414", "0.5281884", "0.5247038", "0.5219282", "0.51786476", "0.51527965", "0.51453763", "0.51430696", "0.5138113", "0.51230687", "0.5116224", "0.511188", "0.51069486", "0.5097141", "0.50745136", "0.505952", "0.50553834", "0.505202", "0.5049677", "0.5041175", "0.5038763", "0.5035395", "0.5029879", "0.5022013", "0.50068027", "0.4996357", "0.49841958", "0.49841362", "0.49805778", "0.496221", "0.49610367", "0.49568683", "0.49548745", "0.49300188", "0.49283445", "0.49136055", "0.4903826", "0.49033442", "0.489289", "0.48908693", "0.48764786", "0.48734403", "0.48724666", "0.48698872", "0.48673034", "0.4865883", "0.48600465", "0.4857083", "0.485514", "0.48492905", "0.4836521", "0.48364472", "0.48333463", "0.48333463", "0.4828433", "0.48241305", "0.48160052", "0.48156852", "0.4809288", "0.48025495", "0.47999445", "0.47911164", "0.47909665", "0.47890332", "0.47794715", "0.47743854", "0.4768231", "0.47590297", "0.47553438", "0.47547337", "0.47529078", "0.4752687", "0.4752687", "0.47511414", "0.47383097", "0.47383097", "0.47324178", "0.47278124", "0.47248", "0.4723108", "0.47163406", "0.47149065", "0.47097307", "0.47080463", "0.47069937", "0.470315", "0.46978444", "0.46936685", "0.46910548", "0.46839347", "0.46828896", "0.46794218" ]
0.6601664
0
this function looks up the BSV and Dealer keys and verifies they are valid before continuing. It will return the dealer key only if this is the first call being made by this dealer and we've verified they exist in our tables
function verifyCaller( $vars ) { global $db; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifyDealerKey( $dealerkey, $accountnumber )\n{\nglobal $db;\nglobal $requestvars;\n\nif ( $db->db_connect_id )\n\t{\n\t$query = \"select DealerID, DealerKey, IPAddress, Active \n\t\t\t\t\tfrom DealerCredentials where\n\t\t\t\t\tAccountNumber='$accountnumber' \";\n\n\tif ( !$result = $db->sql_query( $query ) )\n\t\t{\n\t\tRestLog( \"Error\" );\n\t\tdie(RestUtils::sendResponse(500, \"Error: 16535 There was a problem finding dealer record\"));\n\t\t}\n\n\t$row = $db->sql_fetchrow($result);\n\n\t//08.20.2015 ghh - if the query returns nothing,that means that there is not \n\t//a valid dealer key for that location and one needs to be created\n\tif ( $row[ 'IPAddress' ] != '' && $row[ 'IPAddress' ] != $SERVER['REMOVE_ADDR' ] )\n\t\t{\n\t\tRestLog( \"Error Not Authorized From This IP Address\" );\n\t\tdie(RestUtils::sendResponse(401, 'Error 16536 Bad Location'));\n\t\t}\n\n\t\n\t//08.20.2015 ghh - here we deal with an inactive dealer trying to work with \n\t//the system\n\tif ( $row[ 'Active' ] == 0 )\n\t\t{\n\t\tRestLog( \"Error Account Is Inactive\" );\n\t\tdie(RestUtils::sendResponse(401, 'Error 16537 Inactive Account'));\n\t\t}\n\n\n\t//08.20.2015 ghh - now we see if they have a valid key\n\tif ( isset( $row[ 'DealerKey' ] ) && $row[ 'DealerKey' ] != $dealerkey )\n\t\t{\n\t\tRestLog( \"Error Dealer Key is Invalid Query:\".$query.\"\\n $row[DealerKey] != $dealerkey\" );\n\t\tdie(RestUtils::sendResponse(401, 'Error 16538 Bad Dealer Key'));\n\t\t}\n\n\t//08.20.2015 ghh - if we got this far and don't have a dealer key at all\n\t//then we need to generate one here.\n\tif ( !isset( $row[ 'DealerKey' ] ) )\n\t\t{\n\t\t$uuid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t// 32 bits for \"time_low\"\n\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n\t\t// 16 bits for \"time_mid\"\n\t\tmt_rand( 0, 0xffff ),\n\n\t\t// 16 bits for \"time_hi_and_version\",\n\t\t// four most significant bits holds version number 4\n\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\n\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t// 8 bits for \"clk_seq_low\",\n\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\n\t\t// 48 bits for \"node\"\n\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n\t\t);\n\n\t\t//08.20.2015 ghh - save the new dealerkey into the dealer table\n\t\t$query = \"update DealerCredentials set DealerKey='$uuid' \n\t\t\t\t\t\twhere DealerID=$row[DealerID]\";\n\n\t\tif (!$result = $db->sql_query($query))\n\t\t\t{\n\t\t\tRestLog(\"Error in query: $query\\n\".$db->sql_error());\n\t\t\tRestUtils::sendResponse(500, 'Error 16539 Problem updating key'); //Internal Server Error\n\t\t\treturn false;\n\t\t\t}\n\n\t\t\n\t\treturn $uuid;\n\t\t}\n\n\t//08.20.2015 ghh - if the query does return something, we need to evaluate\n\t//if the dealer key that it returns is a match to the dealer key that is passed\n\t//in\n\t$requestvars[ 'DealerID' ] = $row[ 'DealerID' ];\n\tif ($dealerkey == $row['DealerKey'])\n\t\treturn $dealerkey;\n\t}\nelse\n\t{\n\tRestLog( \"Error\" );\n\tdie(RestUtils::sendResponse(500, 'Error 16540 Internal Database problem.'));\n\t}\n\n}", "public function getRandomKey($cargo_id, $dealer_id) {\n //echo 'dealer id: '.$dealer_id;\n // GENERACION Y ASIGNACION DE USUARIOS EXONERADOS DE LOS CLIENTES GENERADOS\n $connection = @mysql_connect('localhost', 'root', 'k143c89?4Fg&2')\n or die('Could not connect to database');\n mysql_select_db('callcenter')\n or die('Could not select database');\n\n $array_ids = array();\n\n //$dealer_id = $this->getConcesionarioDealerId($id_responsable);\n $sql = \"SELECT gr.*,u.status_asesor FROM grupoconcesionariousuario gr \n INNER JOIN usuarios u ON u.id = gr.usuario_id \n WHERE (u.cargo_id = {$cargo_id} OR u.cargo_adicional = {$cargo_id}) AND u.status_asesor = 'ACTIVO' AND gr.concesionario_id = {$dealer_id}\";\n $res = mysql_query($sql) or die(\"Could not execute query1\");\n //die($sql); \n //die('count: ' . mysql_num_rows($res));\n if (mysql_num_rows($res) > 0) {\n //die('enter not null');\n while($row = mysql_fetch_array($res,MYSQL_ASSOC)) {\n $array_ids[] = $row['usuario_id'];\n //echo 'usuario id: '.$row['usuario_id'];\n }\n //print_r($array_ids);die();\n // ID DEL ASESOR A SER ASIGNADO CLIENTE\n $random_key = $array_ids[array_rand($array_ids)];\n // ID DEL ASESOR EN TABLA usuarios PONEMOS ESTADO INACTIVO\n $sqlupd = \"UPDATE usuarios SET status_asesor='INACTIVO' WHERE id={$random_key}\";\n //die('sql: '.$sqlupd);\n $res2 = mysql_query($sqlupd) or die(\"Could not execute query update\");\n } else {\n //die('enter else');\n $sql2 = \"SELECT gr.*,u.status_asesor FROM grupoconcesionariousuario gr \n INNER JOIN usuarios u ON u.id = gr.usuario_id \n WHERE (u.cargo_id = {$cargo_id} OR u.cargo_adicional = {$cargo_id}) AND u.status_asesor = 'INACTIVO' AND gr.concesionario_id = {$dealer_id}\";\n //die('sql empty: '.$sql2);\n $res2 = mysql_query($sql2) or die(\"Could not execute query2\");\n //die('count: ' . mysql_num_rows($res2));\n if(mysql_num_rows($res2) == 0){\n return 0;\n } \n while($row2 = mysql_fetch_array($res2)) {\n $usuario_id = $row2['usuario_id'];\n $sqlupd2 = \"UPDATE usuarios SET status_asesor='ACTIVO' WHERE id={$usuario_id}\";\n $res3 = mysql_query($sqlupd2) or die(\"Could not execute query update\");\n }\n $sql3 = \"SELECT gr.*,u.status_asesor FROM grupoconcesionariousuario gr \n INNER JOIN usuarios u ON u.id = gr.usuario_id \n WHERE (u.cargo_id = {$cargo_id} OR u.cargo_adicional = {$cargo_id}) AND u.status_asesor = 'ACTIVO' AND gr.concesionario_id = {$dealer_id}\";\n $res4 = mysql_query($sql3) or die(\"Could not execute query3\");\n while($row3 = mysql_fetch_array($res4)) {\n $array_ids[] = $row3['usuario_id'];\n }\n // ID DEL ASESOR A SER ASIGNADO CLIENTE\n $random_key = $array_ids[array_rand($array_ids)];\n // ID DEL ASESOR EN TABLA usuarios PONEMOS ESTADO INACTIVO\n $sqlupd3 = \"UPDATE usuarios SET status_asesor='ACTIVO' WHERE id={$random_key}\";\n //die('$sqlupd3: '.$sqlupd3);\n $res5 = mysql_query($sqlupd3) or die(\"Could not execute query4\");\n }\n return $random_key;\n }", "function createKey(){\n\t$strKey = md5(microtime());\n\t\n\t//check to make sure this key isnt already in use\n\t$resCheck = mysql_query(\"SELECT count(*) FROM downloads WHERE downloadkey = '{$strKey}' LIMIT 1\");\n\t$arrCheck = mysql_fetch_assoc($resCheck);\n\tif($arrCheck['count(*)']){\n\t\t//key already in use\n\t\treturn createKey();\n\t}else{\n\t\t//key is OK\n\t\treturn $strKey;\n\t}\n}", "private function _validate_key($endpoint,$key)\n\t{\n\t\tif($row = $this->db->where('key',strtoupper($key))->get('nct_api_keys')->row())\n\t\t{\n\t\t\tif($row->max_allowed > $row->tot_curr_requests)\n\t\t\t{\n\t\t\t\t$this->key_id = $row->id;\n\t\t\t\tif($row->enabled)\n\t\t\t\t{\n\t\t\t\t\treturn $row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function checkKey($keyValue,$keyArray,$deckArray) {\r\n // Count how many of each card are in our key array\r\n $valueCount = array_count_values($keyArray);\r\n if (array_key_exists($keyValue, $valueCount) == true) {\r\n $keyCount = $valueCount [$keyValue];\r\n $maxInDeck = $deckArray [$keyValue] [3];\r\n if ($keyCount > $maxInDeck) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n Else {\r\n return 2;\r\n }\r\n }", "function getAPIKeyPairForUserForTransactionSourceAndKeyType($accountID, $transactionSourceID, $keyTypeID, $decryptionKey, $dbh)\n\t{\n\t\t$responseObject\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['foundAPIKeyPair']\t\t\t\t\t\t\t\t\t\t= false;\n\t\t$responseObject['keyTypeID']\t\t\t\t\t\t\t\t\t\t\t= $keyTypeID;\n\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getAPIKeyPairForUserForTransactionSourceAndKeyType\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\tAES_DECRYPT(encryptedAPIKey, UNHEX(SHA2(:decryptionKey,512))) AS decryptedAPIKey,\n\tAES_DECRYPT(encryptedAPISecret, UNHEX(SHA2(:decryptionKey,512))) AS decryptedAPISecret,\n\tUserAPIKeys.FK_ExchangeTileID\nFROM\n\tUserAPIKeys\nWHERE\n\tFK_AccountID = :accountID AND\n\tFK_TransactionSourceID = :transactionSourceID AND\n\tFK_APIKeyTypeID = :apiKeyTypeID\");\n\n\t\t\t$getAPIKeyPairForUserForTransactionSourceAndKeyType -> bindValue(':decryptionKey', $decryptionKey);\n\t\t\t$getAPIKeyPairForUserForTransactionSourceAndKeyType -> bindValue(':accountID', $accountID);\n\t\t\t$getAPIKeyPairForUserForTransactionSourceAndKeyType -> bindValue(':transactionSourceID', $transactionSourceID);\n\t\t\t$getAPIKeyPairForUserForTransactionSourceAndKeyType -> bindValue(':apiKeyTypeID', $keyTypeID);\n\t\t\t\t\t\t\n\t\t\tif ($getAPIKeyPairForUserForTransactionSourceAndKeyType -> execute() && $getAPIKeyPairForUserForTransactionSourceAndKeyType -> rowCount() > 0)\n\t\t\t{\n\t\t\t\t$row \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $getAPIKeyPairForUserForTransactionSourceAndKeyType -> fetchObject();\n\t\t\t\t$responseObject['foundAPIKeyPair']\t\t\t\t\t\t\t\t= true;\n\t\t\t\t$responseObject['APIKey']\t\t\t\t\t\t\t\t\t\t= $row ->decryptedAPIKey;\n\t\t\t\t$responseObject['APISecret']\t\t\t\t\t\t\t\t\t= $row ->decryptedAPISecret;\t\n\t\t\t\t$responseObject['ExchangeTileID']\t\t\t\t\t\t\t\t= $row ->FK_ExchangeTileID;\t\t\n\t\t\t}\n\t\t}\n\t catch (PDOException $e) \n\t {\n\t \t$responseObject['resultMessage']\t\t\t\t\t\t\t\t\t= \"Error: Unable to retrieve the API key data for user because of a database error: \".$e -> getMessage();\n\t\t}\n\t\t\n\t\treturn $responseObject;\n\t}", "abstract protected function driverKey();", "public function candidate_key()\n\t{\n\t\tif (!$this->loaded()) return FALSE;\n\t\treturn $this->name;\n\t}", "public function getCandidateKey()\n {\n return $this->candidateKey;\n }", "function updateXeroAPIKeys($chamberId, $consumerKey, $consumerSecret) {\r\n $this->db->beginTransaction();\r\n $sql = $this->db->prepare( \"SELECT COUNT(chamberID) FROM CHAMBER_API_KEYS WHERE chamberID=:chamber_id\" );\r\n $sql->execute( array(\r\n 'chamber_id' => $chamberId,\r\n ));\r\n $existing = $sql->fetch( PDO::FETCH_ASSOC );\r\n // If there is an existing entry update it\r\n if( $existing['COUNT(chamberID)'] > 0) {\r\n $sql = $this->db->prepare(\"UPDATE CHAMBER_API_KEYS SET xero_key=:consumer_key, xero_secret=:consumer_secret WHERE chamberID=:chamber_id\");\r\n if ( $sql->execute( array(\r\n 'chamber_id' => $chamberId,\r\n 'consumer_key' => $consumerKey,\r\n 'consumer_secret' => $consumerSecret,\r\n )))\r\n {\r\n $this->db->commit();\r\n return true;\r\n }\r\n else {\r\n $this->db->rollBack();\r\n return false;\r\n }\r\n }\r\n // If there is no existing entry create one\r\n else {\r\n $sql = $this->db->prepare( \"INSERT INTO CHAMBER_API_KEYS (chamberID, xero_key, xero_secret) VALUES (:chamber_id, :consumer_key, :consumer_secret)\" );\r\n if ( $sql->execute( array(\r\n 'chamber_id' => $chamberId,\r\n 'consumer_key' => $consumerKey,\r\n 'consumer_secret' => $consumerSecret,\r\n )))\r\n {\r\n $this->db->commit();\r\n return true;\r\n }\r\n else {\r\n $this->db->rollBack();\r\n return false;\r\n }\r\n }\r\n }", "function checkKeys($tab, $randStr) {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM $tab\");\n $query -> execute();\n $keyExists = false;\n while($row = $query->fetch(PDO::FETCH_ASSOC)) {\n if($row['keyAccess'] == $randStr) {\n $keyExists = true;\n break;\n } else {\n $keyExists = false;\n }\n }\n return $keyExists;\n }", "function GetDBTableKeys()\n\t{\n\t\tglobal $dal_info;\n\t\tif( !array_key_exists($this->infoKey, $dal_info) || !is_array($dal_info[ $this->infoKey ]) )\n\t\t\treturn array();\n\t\t\n\t\t$ret = array();\n\t\tforeach($dal_info[ $this->infoKey ] as $fname=>$f)\n\t\t{\n\t\t\tif( @$f[\"key\"] )\n\t\t\t\t$ret[] = $fname;\n\t\t}\n\t\treturn $ret;\n\t}", "public function verifyKeys() {\n $data = $this->getClientInformation();\n $result = $this->updateSite($data);\n // lastResponseCode will either be TRUE, REQUEST_ERROR, AUTH_ERROR, or\n // NETWORK_ERROR.\n return $this->lastResponseCode === TRUE ? TRUE : $this->lastResponseCode;\n }", "function checkIfKeyTableExists($sek_title_db, $relationship)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n if ($relationship == 1) {\r\n /*\r\n * Check if table exists\r\n */\r\n $sek_title_db = APP_TABLE_PREFIX . 'record_search_key_' . $sek_title_db;\r\n\r\n $stmt = \" SELECT count(*) as cnt\r\n FROM information_schema.tables\r\n WHERE table_schema = \" . $db->quote(APP_SQL_DBNAME) . \"\r\n AND table_name = \" . $db->quote($sek_title_db);\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return 0;\r\n }\r\n return $res['cnt'];\r\n\r\n } else {\r\n\r\n /*\r\n * Check if column exists\r\n */\r\n $table_name = APP_TABLE_PREFIX . 'record_search_key';\r\n $column_name = 'rek_' . $sek_title_db;\r\n\r\n $stmt = \" SELECT count(*) as cnt\r\n FROM information_schema.columns\r\n WHERE table_schema = \" . $db->quote(APP_SQL_DBNAME) . \"\r\n AND table_name = \" . $db->quote($table_name) . \"\r\n AND column_name = \" . $db->quote($column_name);\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return 0;\r\n }\r\n\r\n return $res['cnt'];\r\n }\r\n }", "function check_originator($clean_data = false)\n{\n $timenow = date(\"U\");\n if (($timenow - $clean_data[\"appheader\"][\"transmissiondatetime\"]) > 3600) {\n return false;\n }\n \n \n \n $conn = conn();\n $clean_data[\"privatekeypair\"] = false;\n \n if ($clean_data[\"appheader\"][\"key\"] == \"newlatcherinstallation\") {\n return $clean_data;\n }\n \n if ($result = mysqli_query($conn, \"SELECT * FROM session WHERE key='\" . $clean_data[\"appheader\"][\"key\"] . \"' LIMIT 1\")) {\n while ($row = mysqli_fetch_array($result)) {\n $clean_data[\"privatekeypair\"] = $row[\"key\"];\n }\n mysqli_free_result($result);\n }\n \n mysqli_close($conn);\n \n if ($clean_data[\"privatekeypair\"] === false) {\n return false;\n }\n \n return $clean_data;\n}", "static function insertLookupKeyForBooking( $reservationId, $lookupKey, $payment_requested ) {\n global $wpdb;\n if (false === $wpdb->insert(\"wp_booking_lookup_key\",\n array( 'reservation_id' => $reservationId, 'lookup_key' => $lookupKey, 'payment_requested' => $payment_requested ),\n array( '%s', '%s', '%f' ))) {\n error_log($wpdb->last_error . \" executing sql: \" . $wpdb->last_query);\n throw new DatabaseException($wpdb->last_error);\n }\n return $wpdb->insert_id;\n }", "public function getBusinessKey();", "private function check_key_valid() {\n $license = get_transient('wcis_license');\n\n // if key doesn't exist, abort\n if(!isset($license['key']) ) { return false; }\n\n // if valid, return success\n if(isset($license['valid']) && $license['valid'] === true) {\n $msg = __('API Connected!', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color: #4caf50;\">' . $msg . '</span>';\n }\n else {\n $msg = __('Invalid API Key. Is there empty space before / after it?', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color:#f44336;\">' . $msg . '</span>';\n }\n\n return $license['valid'];\n }", "public function valid()\n {\n return isset($this->drivers[$this->key()]);\n }", "private function getRegistrationKey()\r\n\t\t{\t\r\n\t\t\t$request = \"SELECT * FROM `licensekey` WHERE registerkey='\".$this->logInfos['registrationKey'].\"'\";\r\n\t\t\t$request = mysql_query($request);\r\n\t\t\t$result = mysql_fetch_assoc($request);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}", "function check_key($id_questions,$auth_token,$msg_auth_failed)\n{\n\t$found_key = check_question_keys($id_questions,$auth_token);\n\t\n\tif (empty($found_key))\n\t{\n\t\tdie($msg_auth_failed);\n\t}\n\t\n\treturn $found_key;\n\t\n}", "public function verify_user($playerId, $playerKey) {\n try {\n // Check for a user with this id\n $query = 'SELECT name_ingame, status FROM player_view WHERE id = :id';\n $statement = self::$conn->prepare($query);\n $statement->execute(array(':id' => $playerId));\n $fetchResult = $statement->fetchAll();\n\n // Make sure that user ID exists and is waiting to be verified\n if (count($fetchResult) != 1) {\n $this->message = 'Could not lookup user ID ' . $playerId;\n return NULL;\n }\n $username = $fetchResult[0]['name_ingame'];\n $status = $fetchResult[0]['status'];\n if ($status != 'UNVERIFIED') {\n $this->message = 'User with ID ' . $playerId . ' is not waiting to be verified';\n return NULL;\n }\n\n // Find the verification key for the specified user ID\n $query = 'SELECT verification_key FROM player_verification WHERE player_id = :player_id';\n $statement = self::$conn->prepare($query);\n $statement->execute(array(':player_id' => $playerId));\n $fetchResult = $statement->fetchAll();\n\n if (count($fetchResult) != 1) {\n $this->message = 'Could not find verification key for user ID ' . $playerId;\n return NULL;\n }\n $databaseKey = $fetchResult[0]['verification_key'];\n\n // Now check that the provided key matches the one in the database\n if ($playerKey != $databaseKey) {\n $this->message = 'Wrong verification key! Make sure you pasted the URL from the e-mail exactly.';\n return NULL;\n }\n\n // Everything checked out okay. Activate the account\n $query = 'UPDATE player ' .\n 'SET status_id = (SELECT ps.id FROM player_status ps WHERE ps.name = \"ACTIVE\") ' .\n 'WHERE id = :id';\n $statement = self::$conn->prepare($query);\n $statement->execute(array(':id' => $playerId));\n $this->message = 'Account activated for player ' . $username . '!';\n $result = TRUE;\n return $result;\n\n } catch (Exception $e) {\n $errorData = $statement->errorInfo();\n $this->message = 'User create failed: ' . $errorData[2];\n return NULL;\n }\n }", "protected function processChecksum() {\r\n if ($this->checksumValue === false) { // Calculate the checksum only once\r\n $this->calculateChecksum();\r\n }\r\n\r\n if ($this->checksumValue !== false) {\r\n return $this->keys[$this->checksumValue];\r\n }\r\n\r\n return false;\r\n }", "function check_lti2_key() {\n global $PDOX, $CFG;\n\n if ( ! isset($_SESSION['id']) ) return 'You are not logged in.';\n $row = $PDOX->rowDie(\n \"SELECT request_id, user_id, admin, state, lti\n FROM {$CFG->dbprefix}key_request\n WHERE user_id = :UID AND lti = 2 LIMIT 1\",\n array(\":UID\" => $_SESSION['id'])\n );\n\n if ( $row === false ) {\n return 'You have not requested a key for this service.';\n }\n\n if ( $row['state'] == 0 ) {\n return 'You key has not yet been approved. '.$row['admin'];\n }\n\n if ( $row['state'] != 1 ) {\n return 'Your key request was not approved. '.$row['admin'];\n }\n\n if ( $row['lti'] != 2 ) {\n return 'Your did not request an LTI 2.0 key. '.$row['admin'];\n }\n\n return true;\n}", "public static function getNewTrackingKey() {\n\t\n\t\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\t\t\n\t\t// try up to 100 times to guess a unique key\n\t\tfor($i=0; $i<100; $i++) {\n\t\t\t$key = '';\n\t\t\tfor($j=0; $j<32; $j++)\t// generate a random 32 char alphanumeric string\n\t\t\t\t$key .= substr($chars,rand(0,strlen($chars)-1), 1);\n\t\t\n\t\t\tif(X2Model::model('Contacts')->exists('trackingKey=\"'.$key.'\"'))\t// check if this key is already used\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn $key;\n\t\t}\n\t\treturn null;\n\t}", "private function _getKey() {\n if (is_array($this->_keys) && count($this->_keys) > 0) {\n return $this->_keys[0];\n }\n\n return false;\n }", "private function _fetch_primary_key()\n {\n if($this->primaryKey == NULl)\n {\n $this->primaryKey = $this->db->query(\"SHOW KEYS FROM `\".$this->_table.\"` WHERE Key_name = 'PRIMARY'\")->row()->Column_name;\n }\n }", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function insert_voucher_details(){\r\n\t\t\r\n\t\t$tblVoucherHead_data = array(\r\n\t\t\t\t//'intVoucherReferenceID' => 'Primary key Auto generate',\r\n\t\t\t\t'strVoucherReferenceNo' => '',\r\n\t\t\t\t'strVoucherHeadPrefix' => '',\r\n\t\t\t\t'dtVoucerHeadDate' => '',\r\n\t\t\t\t'strVoucherHeadAccountID' => '',\r\n\t\t\t\t'strVoucherHeadAgainstAccountID' => '',\r\n\t\t\t\t'strVoucherHeadBankName' => '',\r\n\t\t\t\t'strVoucherHeadBankDrawnBranch' => '',\r\n\t\t\t\t'tintVoucherHeadBankChequeType' => '',\r\n\t\t\t\t'strVoucherHeadBankChequeNumber' => '',\r\n\t\t\t\t'dtVoucherHeadBankChequeDate' => '',\r\n\t\t\t\t'strVoucherHeadNarration' => '',\r\n\t\t\t\t'intObjectID' => '',\r\n\t\t\t\t'strDatabaseName' => '',\r\n\t\t\t\t'intBranchID' => '',\r\n\t\t\t\t'strAction' => '',\r\n\t\t\t\t'strImportStatus' => '',\r\n\t\t\t\t'strMerchantID' => '',\r\n\r\n\t\t\t);\r\n\r\n\t\t$tblVoucherDetail_data = array(\r\n\t\t\t\t'intVoucherReferenceID' => '',\r\n\t\t\t\t'intVoucherReferenceDetailID' => '',\r\n\t\t\t\t'tintVoucherDetailEntryfor' => '',\r\n\t\t\t\t'intVoucherNewReferenceID' => '',\r\n\t\t\t\t'strVoucherDetailAccountID' => '',\r\n\t\t\t\t'strVoucherDetailAgainstAccountID' => '',\r\n\t\t\t\t'strVoucherDetailNarration' => '',\r\n\t\t\t\t'decVoucherDetailTotalAmt' => '',\r\n\t\t\t\t'strVoucherDetailTotalAmtType' => '',\r\n\t\t\t\t'decVoucherDetailTDSon' => '',\r\n\t\t\t);\r\n\t}", "public static function getNewTrackingKey() {\n\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\n // try up to 100 times to guess a unique key\n for ($i = 0; $i < 100; $i++) {\n $key = '';\n for ($j = 0; $j < 32; $j++) {// generate a random 32 char alphanumeric string\n $key .= substr($chars, rand(0, strlen($chars) - 1), 1);\n }\n\n // check if this key is already used\n if (X2Model::model('Contacts')->exists('trackingKey=\"' . $key . '\"')) {\n continue;\n } else {\n return $key;\n }\n }\n return null;\n }", "private function validateReviewerKey(){\n\t\treturn true;\n\t}", "function check_pk($key_id)\n\t{\n\t\t$pubkey = false;\n\t\t$subkey = false;\n\n\t\tif (false == $list = $this->get_list($key_id))\n\t\t{\n\t\t\t// no key found\n\t\t\treturn 3;\n\t\t}\n\t\telse foreach ($list as $row)\n\t\t{\n\t\t\t// check for base key usability\n\t\t\tif ($row[0] == 'pub')\n\t\t\t{\n\t\t\t\tif ( ($row[1] != 'r' && $row[1] != 'e') &&\t\t\t\t\t// check for revocation/expiry status\n\t\t\t\t($row[5] < time() && ($row[6] == '' || $row[6] > time())) )\t// check creation and expiration dates\n\t\t\t\t{\n\t\t\t\t\t$pubkey = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check for subkey presence and usability\n\t\t\telse if ($row[0] == 'sub')\n\t\t\t{\n\t\t\t\tif ( ($row[1] != 'r' && $row[1] != 'e') &&\t\t\t\t\t// check for revocation/expiry status\n\t\t\t\t(str_contains($row[11], 'e')) &&\t\t\t\t\t\t// check that subkey is intended for encryption\n\t\t\t\t($row[5] < time() && ($row[6] == '' || $row[6] > time())) )\t// check creation and expiration dates\n\t\t\t\t{\n\t\t\t\t\t$subkey = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// return codes\n\t\tif ($pubkey === false) return 2;\t// public key is unusable\n\t\tif ($subkey === false) return 1;\t// key is not suitable for encryption\n\t\t// key is okay\n\t\treturn 0;\n\t}", "private function getEncryptionKeys(){\n\t\treturn $this->cryptokeys;\n\t\t/*\n\t\treturn array('REGISTRATION'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'EMAIL'=> \tarray(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t32,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'PROFILE'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t*/\n\t\t\n\t\t\t\t\t \t\t\t\n\t}", "function pk_key() {\r\n\t\t$c = 0;\r\n\t\tfor($i = 0; $i < count ( $this->fields ); $i ++) {\r\n\t\t\tif ($this->fields [$i] ['PK'] == 'yes') {\r\n\t\t\t\t$pk_key [$c] = $this->fields [$i] ['VAR'];\r\n\t\t\t\t$c ++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $pk_key;\r\n\t}", "function generateKeyReference($table, $conn){\n\n //ambil id terakhir di database lalu ditambah 1 untuk nomor\n\n //Tentukan code dan pilih id di table\n if ($table == \"tipe_sawah\") {\n $code = \"TSW\";\n $sql = \"select id_tipe_sawah from tipe_sawah ORDER BY id_tipe_sawah DESC LIMIT 1\";\n } elseif ($table == \"bekas_sawah\") {\n $code = \"BSW\";\n $sql = \"select id_bekas_sawah from bekas_sawah ORDER BY id_bekas_sawah DESC LIMIT 1\";\n } elseif ($table == \"irigasi_sawah\") {\n $code = \"ISW\";\n $sql = \"select id_irigasi_sawah from irigasi_sawah ORDER BY id_irigasi_sawah DESC LIMIT 1\";\n }\n\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n\n if ($table == \"tipe_sawah\") {\n $mykey = $row['id_tipe_sawah'];\n } elseif ($table == \"bekas_sawah\") {\n $mykey = $row['id_bekas_sawah'];\n } elseif ($table == \"irigasi_sawah\") {\n $mykey = $row['id_irigasi_sawah'];\n }\n\n $breake = explode(\"-\", $mykey);\n\n $num = $breake[1] + 1;\n $threeNum = sprintf(\"%03d\", $num);\n\n $key = $code . \"-\" . $threeNum;\n\n // echo $key;\n return $key;\n}", "public function ensure_keys_are_actually_active () {\n $already_active = (array)$this->get_activated_products();\n $products = $this->get_detected_products();\n if ( 0 < count( $already_active ) ) {\n foreach ( $already_active as $k => $v ) {\n //** Only look through activated plugins */\n if( !array_key_exists( $k, $products ) ) {\n continue;\n }\n $deactivate = true;\n \n if ( !empty( $already_active[ $k ][2] ) ) {\n //** Get license and activation email */\n $data = base64_decode( $already_active[ $k ][2] );\n $data = explode( '::', $data );\n $license_key = isset( $data[0] ) ? trim( $data[0] ) : '';\n $activation_email = isset( $data[1] ) ? trim( $data[1] ) : '';\n\n //** Do request */\n $response = $this->api->status( array(\n 'product_id' \t=> $already_active[ $k ][0],\n 'instance' \t\t=> $already_active[ $k ][1],\n 'email' => trim($activation_email),\n 'licence_key' => trim($license_key),\n ), false, false );\n \n //** Do not deactivate if cannot reach UD */\n if ( $response === false ) {\n continue;\n }\n if( is_array( $response ) && !empty( $response[ 'status_check' ] ) && $response[ 'status_check' ] == 'active' ) {\n $deactivate = false;\n }\n }\n if( $deactivate ) {\n $this->deactivate_product( $k, true );\n }\n }\n }\n }", "public function validKeys()\n\t{\n\t\treturn array_merge($this->keysOnlyUsedDuringCreation(), $this->statKeys());\n\t}", "public function valid() {\n return isset($this->keys[$this->index]);\n }", "function checkResetKey($username, $key) {\n $attcount = $this->getAttempt($_SERVER['REMOTE_ADDR']);\n if ($attcount[0]->count >= MAX_ATTEMPTS) {\n $auth_error[] = $this->lang['resetpass_lockedout'];\n $auth_error[] = sprintf($this->lang['resetpass_wait'], WAIT_TIME);\n return false;\n } else {\n if (strlen($username) == 0) {\n return false;\n } elseif (strlen($username) > MAX_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($username) < MIN_USERNAME_LENGTH) {\n return false;\n } elseif (strlen($key) == 0) {\n return false;\n } elseif (strlen($key) < RANDOM_KEY_LENGTH) {\n return false;\n } elseif (strlen($key) > RANDOM_KEY_LENGTH) {\n return false;\n } else {\n $query = $this->db->select(\"SELECT resetkey FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $count = count($query);\n if ($count == 0) {\n $this->logActivity(\"UNKNOWN\", \"AUTH_CHECKRESETKEY_FAIL\", \"Username doesn't exist ({$username})\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_username_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n } else {\n $db_key = $query[0]->resetkey;\n if ($key == $db_key) {\n return true;\n } else {\n $this->logActivity($username, \"AUTH_CHECKRESETKEY_FAIL\", \"Key provided is different to DB key ( DB : {$db_key} / Given : {$key} )\");\n $this->addAttempt($_SERVER['REMOTE_ADDR']);\n $auth_error[] = $this->lang['checkresetkey_key_incorrect'];\n $attcount[0]->count = $attcount[0]->count + 1;\n $remaincount = (int) MAX_ATTEMPTS - $attcount[0]->count;\n $auth_error[] = sprintf($this->lang['checkresetkey_attempts_remaining'], $remaincount);\n return false;\n }\n }\n }\n }\n }", "protected function checkKeyExists()\n {\n if (empty($this->key)) {\n throw new InvalidArgumentException('Please set the primary key using key() method.');\n }\n }", "protected function _generateKey()\n {\n $key = '';\n ksort($this->_keyData); //so that the order of the array doesn't matter in the key that is generated.\n foreach ($this->_keyData as $i => $val) {\n //\"clean\" the data some\n if (is_numeric($val)) {\n $val = (float)$val;\n //force it to be 4 decimal places every single time, and use thousands\n //seperator, just because we can and we need all numbers to be uniform\n //so they look the same even after getting sent to the database and coming back again.\n $val = number_format($val, 4, '.', ',');\n } else {\n $val = trim($val);\n }\n //NOTE: May need to do further \"cleaning\" to ensure value always stays\n //the same even after getting sent to and from the DB... if so do that\n //cleaning here, NOT outside of this class... we need 1 solution in 1\n //place, not 20 different solutions...\n\n $key = \"$i:_:{$key}:_:$val\";\n }\n //If debug enabled, show what the key is before hash, so we can troubleshoot\n //problems caused by the key changing when trying to decrypt.\n if (self::DEBUG) {\n trigger_error('DEBUG CRYPT: Key used before hash=' . $key);\n }\n $this->_keyString = sha1($key);\n }", "function checkBuyBids()\n{\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from BestBidOffer\n $indexQry = \"SELECT * FROM BuyBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in BuyBids DB\n $BuyBidsTickers = getBuyBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($BuyBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your buy bids DB\n foreach($BuyBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] <= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Buy function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n buyStock($tempArray);\n //delete the IndexNo of this record in BuyBestBidOffer Table\n deleteFromBuyBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "abstract public function getIsValidKey($name);", "public function getBidLeaderID()\n\t{\n\t\t$dbhandle = db_connect();\n\t\t$stmt = $dbhandle->stmt_init();\n\t\t\t\n\t\t$stmt->prepare(\"SELECT BidderID FROM BidHistory WHERE TaskID = ? ORDER BY BidAmount LIMIT 1\");\n\t\t$stmt->bind_param(\"i\", $this->taskid);\n\t\t$stmt->execute();\n\t\t\n\t\t$stmt->store_result();\n\t\t$stmt->bind_result($outBidderID);\n\t\t$stmt->fetch();\n\t\t\n\t\t$stmt->close();\n\t\t$dbhandle->close();\n\t\t\n\t\tif(isset($outBidderID))\n\t\t\treturn $outBidderID;\n\t\telse\n\t\t\treturn NULL;\n\t}", "private function _populateDealerAccount()\n {\n return $this->dealer_account->create(\n $this->dealerAccountData['name'], \n $this->dealerAccountData['branch_ID'],\n $this->dealerAccountData['promotor_ID']\n ); \n }", "function _verify(){\n $e = \"\";\n if (isset($_POST['verder'])) {\n foreach($_POST as $key=>$value){\n if($key== 'verder') continue;\n $value = validate($value);\n if(!$this->_existsInDatabase($value)){\n $e = \"ID komt niet voor in Database\";\n }\n }\n }\n return $e;\n }", "protected function generateEncryptionKeyIfNeeded() {}", "public function _setupKey() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\t// Key has already been expanded in Crypt_RC2::setKey():\n\t\t// Only the first value must be altered.\n\t\t$l = unpack( 'Ca/Cb/v*', $this->key );\n\t\tarray_unshift( $l, $this->pitable[ $l['a'] ] | ( $l['b'] << 8 ) );\n\t\tunset( $l['a'] );\n\t\tunset( $l['b'] );\n\t\t$this->keys = $l;\n\t}", "function updateMailChimpAPIKey($chamberID, $APIkey) {\r\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $this->db->beginTransaction();\r\n $sql = $this->db->prepare( \"SELECT COUNT(chamberID) FROM CHAMBER_API_KEYS WHERE chamberID=:chamber_id\" );\r\n $sql->execute( array(\r\n 'chamber_id' => $chamberID,\r\n ));\r\n $existing = $sql->fetch( PDO::FETCH_ASSOC );\r\n // If there is an existing entry update it\r\n if( $existing['COUNT(chamberID)'] > 0) {\r\n $sql = $this->db->prepare(\"UPDATE CHAMBER_API_KEYS SET mailchimp=:mailchimp_key WHERE chamberID=:chamber_id\");\r\n if ( $sql->execute( array(\r\n 'chamber_id' => $chamberID,\r\n 'mailchimp_key' => $APIkey,\r\n )))\r\n {\r\n $this->db->commit();\r\n return true;\r\n }\r\n else {\r\n $this->db->rollBack();\r\n return false;\r\n }\r\n }\r\n // If there is no existing entry create one\r\n else {\r\n $sql = $this->db->prepare( \"INSERT INTO CHAMBER_API_KEYS (chamberID, mailchimp) VALUES (:chamber_id, :mailchimp_key)\" );\r\n if ( $sql->execute( array(\r\n 'chamber_id' => $chamberID,\r\n 'mailchimp_key' => $APIkey,\r\n )))\r\n {\r\n $this->db->commit();\r\n return true;\r\n }\r\n else {\r\n $this->db->rollBack();\r\n return false;\r\n }\r\n }\r\n }", "function checkSellBids()\n{\n echo \"IM AT SELL BIDS\";\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from SellBidOffer\n $indexQry = \"SELECT * FROM SellBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in SellBids DB\n $SellBidsTickers = getSellBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($SellBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your sell bids DB\n foreach($SellBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] >= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Sell function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n sellStock($tempArray);\n //delete the IndexNo of this record in SellBestBidOffer Table\n deleteFromSellBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "public function valid()\n {\n return isset($this->keys[$this->pointer]);\n }", "public function generateKey()\n {\n do\n {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while ($this->keyExists($newKey));\n\n return $newKey;\n }", "public function key() {\n\t\tif (count($this->keys) === 1) {\n\t\t\treturn reset($this->keys);\n\t\t}\n\t\tthrow new Exception(T([\n\t\t\t'en' => \"Single primary key required for \" . static::class,\n\t\t\t'ru' => \"Требуется одиночный основной ключ для \" . static::class,\n\t\t]));\n\t}", "public function fetchLicenseKey()\n {\n try {\n $license = $this->db->fetchQuery(\"SELECT license_key FROM license WHERE id=:keyId\", [\":keyId\" => intval($_POST['kid'])]);\n if (!$license) {\n throw new InvalidLicenseException(\"No License Key Available.\", 401);\n }\n $this->response = [\"license\" => $this->_fetchLicensePublicKey($license['license_key'])];\n } catch (InvalidLicenseException $e) {\n throw new InvalidLicenseException($e->getMessage(), $e->getCode());\n } catch (\\Exception $e) {\n throw new InvalidLicenseException(\"Unable to Fetch License Key.\", 500);\n }\n }", "public function getSellerAvailableGoodsId()\n {\n return $this->seller_available_goods_id;\n }", "public function valid()\n\t{\n\t\treturn array_key_exists($this->_idx, $this->_keys);\n\t}", "public function firstKey();", "function validateInvitationSecret(){\n $invitation=MedicalGroupInvitation::find('all',array('conditions' => array('(user_id=? or email=?) and secret=? and active=1',$this->user_id,$this->email,$this->secret)));\n if(!empty($invitation)){\n foreach($invitation as $invt){\n return $invt->id;\n }\n }\n else{\n return false;\n }\n }", "function getLocalKey() {\n\t\t\t$localKey = $this->settings[\"localkey\"];\n\t\t\t\n\t\t\t\n\t\t\tif ( (trim($localKey[0]) == \"\") || (!$this->isLocalKeyCurrent() ) ){\n\t\t\t\tif ($this->debug) echo \"<BR>Local Key has expired\"; // Get a new local key from the remote server\n\t\t\t\t$localKey = $this->refreshLocalKey();\n\t\t\t\t$localKeySplit = explode(\"|\", $localKey);\n\t\t\t\t$this->localKeySplit = $localKeySplit;\n\t\t\t\t$this->localKey = $localKey;\n\t\t\t\t$this->updateSetting(\"localkeysplit\", $localKeySplit);\n\t\t\t\t$this->updateSetting(\"localkey\", $localKey);\n\t\t\t\tif ($this->debug) echo \"<BR>Got new local key: $localKey\";\n\t\t\t\tif ($this->debug) echo \"<BR>Expires on \" . date(\"d-m-y H:i:s\", $localKeySplit[3]);\n\t\t\t} else {\n\t\t\t\tif ($this->debug) echo \"<BR>Got saved local key: $localKey\";\n\t\t\t\t$this->updateSetting(\"lastLocalValidate\", time());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn $localKey;\n\t\t\t\n\t\t}", "private function getApikey($id){\n // If yes, then OK. else show only bank account details.\n\n $apiKey = false;\n\n if($id) {\n\n $this->load->model('donations_meta');\n $rec = $this->donations_meta->ci_join('donation_ads.donation_id, donations_meta.dm_value, donations_meta.dm_key', 'donation_ads', 'donations_meta',\n 'donation_ads.donation_id = donations_meta.donation_id', 'donation_ads.donation_id', $id);\n\n if (isset($rec[0])) {\n // $rec has record\n $username = $rec[0]['dm_value'];\n\n $this->load->model('user');\n $rec = $this->user->getRecord($username, 'username');\n\n if (!$rec) {\n // It means user changed his / her username.\n // This is Design Flaw.\n // Best apporach was that we save userid instead of username at time of saving Cause and Cause Meta\n die('Internal Server Error Occured. Err 10001');\n }\n\n $uid = $rec->uid;\n\n\n $rec = $this->user->ci_join('users_meta.um_key, users_meta.um_title, users_meta.um_value',\n 'users', 'users_meta', 'users.uid = users_meta.fk_uid', 'users.uid', $uid);\n\n //echo '<tt><pre>' . var_export($rec, true) . '</pre></tt>'; exit;\n\n if(is_array($rec) && !empty($rec)){\n foreach($rec as $key => $value){\n if(is_array($value) && isset($value['um_key'])){\n\n if($value['um_key'] === 'stripe_secret_live_api_key'){\n $apiKey = $value['um_value'];\n }\n\n }\n }\n }\n }else {\n // DB Record not found\n //print_r(json_encode($rec));\n\n $apiKey = false;\n }\n }\n\n\n\n return $apiKey;\n }", "function SetupKeyValues($key) {\r\n\t\t$arrKeyFlds = explode($GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"], $key);\r\n\t\tif (count($arrKeyFlds) >= 1) {\r\n\t\t\t$this->Id_Proveedor->setFormValue($arrKeyFlds[0]);\r\n\t\t\tif (!is_numeric($this->Id_Proveedor->FormValue))\r\n\t\t\t\treturn FALSE;\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function get_server_secret_key($link, $data, $address) // Colorize: green\n { // Colorize: green\n $res = \"\"; // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"SELECT\" // Colorize: green\n . \" secret_key\" // Colorize: green\n . \" FROM \" . DB_TABLE_SERVERS // Colorize: green\n . \" WHERE address = '\" . $link->real_escape_string($address) . \"'\"; // Colorize: green\n // Ignore PhpAlignmentVerifier [END] // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $result = $link->query($sql); // Colorize: green\n die_if_sql_failed($result, $link, $data, $sql); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n if ($result->num_rows == 1) // Colorize: green\n { // Colorize: green\n $res = $result->fetch_row()[0]; // Colorize: green\n $result->close(); // Colorize: green\n } // Colorize: green\n else // Colorize: green\n { // Colorize: green\n $result->close(); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $error_details = \"Access violation\"; // Colorize: green\n error_log($error_details); // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Access error\"; // Colorize: green\n $data[\"details\"] = $error_details; // Colorize: green\n // Colorize: green\n die(json_encode($data)); // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return $res; // Colorize: green\n }", "public function hasPregeneratedKeysAvailable()\n {\n return $this->pregenerated_keys_available !== null;\n }", "function checkForCryptoWallet($liuAccountID, $userAccountID, $cryptoWalletIDValue, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t// to replace\n\t\t\n\t\terrorLog(\"Wallet ID = $cryptoWalletIDValue\");\n\t\t\n\t\t$cryptoWallet\t\t\t\t\t= null;\n\t\t$walletID\t\t\t\t\t\t= 0;\n\t\t$walletType\t\t\t\t\t\t= 1;\n\t\t$walletTypeName\t\t\t\t\t= \"Coinbase\";\n\t\t$assetType\t\t\t\t\t\t= 1;\n\t\t$assetTypeName\t\t\t\t\t= \"BTC\";\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getCryptoWalletRecord\t\t= $dbh -> prepare(\"SELECT\n\tCryptoWallets.walletID,\n\tCryptoWallets.FK_AccountID,\n\tCryptoWallets.FK_AuthorID,\n\tCryptoWallets.FK_AssetTypeID,\n\tCryptoWallets.FK_WalletTypeID,\n\tCryptoWallets.creationDate,\n\tCryptoWallets.sid,\n\tAssetTypes.assetTypeLabel,\n\tAES_DECRYPT(WalletTypes.encryptedWalletTypeLabel, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AS walletTypeLabel\nFROM\n\tCryptoWallets\n\tINNER JOIN AssetTypes ON CryptoWallets.FK_AssetTypeID = AssetTypes.assetTypeID AND AssetTypes.languageCode = 'EN'\n\tINNER JOIN WalletTypes ON CryptoWallets.FK_WalletTypeID = WalletTypes.walletTypeID AND WalletTypes.languageCode = 'EN'\nWHERE\n\tCryptoWallets.encryptedCryptoWalletIDValue = AES_ENCRYPT(:cryptoWalletIDValue, UNHEX(SHA2('b9Gf98252c8!0aea1f(31c4c753d351',512))) AND\n\tCryptoWallets.FK_AccountID = :accountID\");\n\n\t\t\t$getCryptoWalletRecord -> bindValue(':cryptoWalletIDValue', $cryptoWalletIDValue);\n\t\t\t$getCryptoWalletRecord -> bindValue(':accountID', $userAccountID);\n\t\t\t\t\t\t\n\t\t\tif ($getCryptoWalletRecord -> execute() && $getCryptoWalletRecord -> rowCount() > 0)\n\t\t\t{\n\t\t\t\t$row \t\t\t\t\t= $getCryptoWalletRecord -> fetchObject();\n\t\t\t\t\n\t\t\t\t$walletID\t\t\t\t= $row->walletID; \n\t\t\t\t$accountID\t\t\t\t= $row->FK_AccountID;\n\t\t\t\t$authorID\t\t\t\t= $row->FK_AuthorID;\n\t\t\t\t$assetType\t\t\t\t= $row->FK_AssetTypeID;\n\t\t\t\t$assetTypeName\t\t\t= $row->assetTypeLabel;\n\t\t\t\t$walletType\t\t\t\t= $row->FK_WalletTypeID;\n\t\t\t\t$walletTypeName\t\t\t= $row->assetTypeLabel;\n\t\t\t\t$creationDate\t\t\t= $row->walletTypeLabel;\n\t\t\t\t$sid\t\t\t\t\t= $row->sid;\n\t\t\t\t\n\t\t\t\t$cryptoWallet\t\t\t= new CryptoWallet($walletID, $accountID, $authorID, $cryptoWalletIDValue, $assetType, $assetTypeName, $walletType, $walletTypeName, $creationDate, $sid);\t\n\t\t\t\t\n\t\t\t\t$createWallet\t\t\t= 0;\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($walletID == 0)\n\t\t\t{\n\t\t\t\t$walletID\t\t\t\t= createCryptoWalletRecord($userAccountID, $liuAccountID, $cryptoWalletIDValue, $assetType, 1, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\n\t\t\t\tif ($walletID > 0)\n\t\t\t\t{\n\t\t\t\t\t$cryptoWallet\t\t= new CryptoWallet($walletID, $userAccountID, $liuAccountID, $cryptoWalletIDValue, $assetType, $assetTypeName, $walletType, $walletTypeName, $globalCurrentDate, $sid);\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t catch (PDOException $e) \n\t {\n\t \t$cryptoWallet \t\t\t\t= null;\t\n\t\t\t\n\t\t\terrorLog($e -> getMessage());\n\t\n\t\t\tdie();\n\t\t}\n\t\t\n\t\treturn $cryptoWallet;\t\t\n\t}", "public function CheckActivationKeyExists( )\n\t\t{\n\t\t\t$dataArray = array(\n \"activationKey\"=>$this->activationKey\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/CheckActivationKeyExists/123\", \"json\" );\n \n return $response;\n\t\t}", "function getMailChimpAPIKey($chamberID) {\r\n $sql = $this->db->prepare(\"SELECT mailchimp FROM CHAMBER_API_KEYS WHERE chamberID=:chamber_id\");\r\n $sql->execute(array(\r\n 'chamber_id' => $chamberID,\r\n ));\r\n $result = $sql->fetch( PDO::FETCH_ASSOC );\r\n return $result['mailchimp'];\r\n }", "function GetKey() { return( $this->key ); }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "function loadSurferData() {\n if (!(isset($this->surfer) && is_array($this->surfer) && count($this->surfer) > 0)) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_auth.php');\n if ($surferId = $this->authUser->getSurferId()) {\n if (include_once(PAPAYA_INCLUDE_PATH.'system/base_pluginloader.php')) {\n $surferConnectorGUID = '06648c9c955e1a0e06a7bd381748c4e4';\n if ($surferObj = base_pluginloader::getPluginInstance($surferConnectorGUID, $this)) {\n if ($this->surfer = $surferObj->getNameById($surferId)) {\n // since getNameById doesn't include the surfer_id in the array, we put it there\n $this->surfer['surfer_id'] = $surferId;\n return TRUE;\n } else {\n $this->addMsg(MSG_ERROR, $this->_gt('Could not load surfer details.'));\n }\n } else {\n $this->addMsg(MSG_ERROR, $this->_gt('Could not load initialize surfer object.'));\n }\n } else {\n $this->addMsg(MSG_ERROR, $this->_gt('Could not load initialize plugin loader.'));\n }\n } else {\n $this->addMsg(MSG_ERROR, $this->_gt('Could not determine surfer id for this user.'));\n }\n return FALSE;\n } else {\n return TRUE;\n }\n }", "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "protected function getLookupTableKey()\n\t{\n\t\t$key = $this->getValueObject()->getKey();\n\t\t$name = $this->getName();\n\n\t\tif($key != '' && $name != '')\n\t\t{\n\t\t\treturn md5($this->getValueObject()->getKey() . $this->getName());\n\t\t}\n\n\t\tthrow new \\RedisTools\\Exception(\"Could not generate key for lookup table because key '$key' and/or name '$name' are empty.\");\n\t}", "public function valid()\n {\n return array_key_exists($this->index, $this->keys);\n }", "function checkBankOptions(){\n $resultId = tep_db_query(\"SELECT configuration_id FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n if (!$aResult ){\n $resultId = tep_db_query(\"INSERT INTO \". TABLE_CONFIGURATION .\"(configuration_title, configuration_key, configuration_value) \n VALUES ( 'Issuer Refresh', 'MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH',0)\");\n }\n $resultId = tep_db_query(\"SELECT configuration_value FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n $iIssuerRefresh = (int) $aResult['configuration_value'];\n if ($iIssuerRefresh < time()) {\n $this->cacheBankOptions();\n }\n \n }", "public static function generateKey()\n {\n do {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while (self::keyExists($newKey));\n\n return $newKey;\n }", "function twispay_tw_get_staging_private_key() {\n // Wordpress database refference\n global $wpdb;\n $table_name = $wpdb->prefix . 'twispay_tw_configuration';\n\n $staging_key = $wpdb->get_results( \"SELECT staging_key FROM $table_name\" );\n\n if ( $staging_key ) {\n return $staging_key[0]->staging_key;\n }\n else {\n return '';\n }\n}", "function GetPK($table) {\n $this->query = \"SELECT PK FROM metatabla WHERE lower(Nombre)='\".strtolower($table).\"'\";\n\n $this->consulta($this->query);\n if ($this->num_rows() > 0) { \n $this->rs01 = $this->fetch_row();\n $pk = $this->rs01[0];\n $this->cerrarConsulta();\n return $pk;\n }else{\n return false;\n }\t\n\t}", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"gjd_id\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"gjd_id\"]);\n\t\t\telseif (isset($_GET[\"gjd_id\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"gjd_id\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "function check_key($key)\n {\n $this->db->where('reset_code', $key);\n $result = $this->db->get('users'); \n if($result->num_rows() > 0)\n {\n foreach($result->result() as $row)\n {\n return $row;\n }\n }\n else\n {\n return false;\n }\n }", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"IDXDAFTAR\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"IDXDAFTAR\"]);\n\t\t\telseif (isset($_GET[\"IDXDAFTAR\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"IDXDAFTAR\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function verifyActivationKey($activationKey)\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\tYii::log(\"FALLO UBICANDO EL ACTIVERECORD DEL USUARIO con la llave de activación: \".$activationKey, \"warning\", \"system.*\");\n\t\t\treturn self::ERROR_AKEY_INVALID;\n\t\t}\n\t\t$result = $record->llave_activacion === $activationKey ? self::ERROR_AKEY_NONE : self::ERROR_AKEY_INVALID;\n\n\t\tYii::log(\"Resultados para el usuario: \".$record->usuario.\" y correo: \".$record->correo.\" con la llave de activación: \".$record->llave_activacion.\" y la llave de activación proporcionada: \".$activationKey.\" con el resultado: \".$result, \"warning\", \"system.*\");\n\n\t\treturn $result;\n\t}", "public function checkreferemailandkey($email,$key){\n\t\t$this->db->where('ReferedTo', $email);\n\t\t$this->db->where('UniqueKey', $key);\n\t\t$query=$this->db->get('tbl_bvpoint_data');\n\t\tif($query->num_rows()==1){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getGatewayKey ();", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function hasRowKey(){\n return $this->_has(2);\n }", "public function _getBalanceKeyData($k){\n if(is_null($this->BalanceData)) $this->_loadBalance();\n\n // Check if key is founded\n if(!array_key_exists($k, $this->BalanceData)) throw new Exception(\"Error : \".$k.\" not exist in Balance (\".$this->_getType().\")\", 1);\n\n // Return associate value\n return $this->BalanceData[$k];\n }", "public function isApiKeyConfigured()\n {\n $public_key = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/bitcoin/public_key'));\n $private_key = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/bitcoin/private_key'));\n return (!empty($private_key) && !empty($public_key));\n }", "private function _api_key_exists()\n {\n $apikey = Apikey::where('secret', '=', $this->_key)->first();\n if (!$apikey) {\n return false;\n }\n return true;\n }", "public function hasKey() {\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }", "public function hasRowKey(){\n return $this->_has(1);\n }" ]
[ "0.726981", "0.53779465", "0.5141148", "0.5110204", "0.5096737", "0.5084592", "0.5074501", "0.5045683", "0.50277686", "0.5006753", "0.49917585", "0.49458095", "0.49036673", "0.48341447", "0.4834028", "0.48287803", "0.48055184", "0.48003405", "0.47899505", "0.47843626", "0.4779122", "0.4738273", "0.4737622", "0.4718246", "0.4708262", "0.46901712", "0.46848422", "0.46743646", "0.4665946", "0.4659149", "0.46557444", "0.46500844", "0.46464956", "0.46415183", "0.46389636", "0.46325693", "0.46271446", "0.46270242", "0.46209726", "0.46208552", "0.46126226", "0.46074736", "0.46004415", "0.45992774", "0.4593367", "0.45874947", "0.45779482", "0.45774058", "0.45769694", "0.45689777", "0.45689192", "0.4567607", "0.4565634", "0.45655563", "0.4561151", "0.45583686", "0.45503527", "0.45441484", "0.45431125", "0.4528141", "0.45250893", "0.4523431", "0.4523169", "0.4519618", "0.45133647", "0.4498473", "0.44925985", "0.44910926", "0.44910926", "0.44910926", "0.44910926", "0.44910926", "0.44910926", "0.44910926", "0.44910926", "0.44910926", "0.4488165", "0.44862032", "0.44707084", "0.44701242", "0.44679368", "0.44633412", "0.4456278", "0.44554323", "0.44519636", "0.4451529", "0.44459403", "0.44366723", "0.44361156", "0.44327837", "0.44274804", "0.44274804", "0.44274804", "0.44274804", "0.4417324", "0.44167143", "0.44119492", "0.44081116", "0.44039273", "0.44039273", "0.44039273" ]
0.0
-1
01.23.2013 naj recursive function for putting addslashes on all json elements
function cleanJSON($data) { //01.23.2013 naj - can handle json as either an object or an associative array foreach ($data as $key => $value) { if (is_object($value) || is_array($value)) $temp = cleanJSON($value); else $temp = addslashes($value); if (is_object($data)) $data->$key = $temp; else $data[$key] = $temp; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InjectSlashes($value) {\r\n if (is_array($value)) {\r\n reset($value);\r\n while (list($key, $val) = each($value))\r\n $value[$key] = InjectSlashes($val);\r\n return $value;\r\n }\r\n return addslashes($value);\r\n}", "private function addSlashesDeep($value) {\n\t\t$value = is_array($value) ? array_map(array($this,'addSlashesDeep'), $value) : addslashes($value);\n\t\treturn $value;\n\t}", "function my_addslashes($array) {\n\n\tforeach ( $array as $var => $value ) :\n\t\tif ( is_array($value) ) :\n\t\t\t$array[$var] = my_addslashes($value);\n\t\telse :\n\t\t\tif ( substr($value, -1) != '/' ) :\n\t\t\t\t$array[$var] = $value . '/';\n\t\t\tendif;\n\t\tendif;\n\tendforeach;\n\t\n\treturn $array;\n}", "function escapeJsonString($value) {\n $escapers = array(\"\\\\\", \"/\", \"\\\"\", \"\\0\", \"\\u\", \" \", \"\\n\", \"\\r\", \"\\t\", \"\\x08\", \"\\x0c\");\n $replacements = array(\"\\\\\\\\\", \"\\\\/\", \"\\\\\\\"\", \" \", \"\", \" \", \"\\\\n\", \"\\\\r\", \"\\\\t\", \"\\\\f\", \"\\\\b\");\n $result = str_replace($escapers, $replacements, $value);\n return $result;\n }", "function tincanlaunch_myjson_encode($obj) {\n return str_replace('\\\\/', '/', json_encode($obj));\n}", "function json_encode_unescaped($arr)\n{\n\tarray_walk_recursive($arr, function (&$item, $key) { if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); });\n\treturn mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\n\n}", "function ExtendedAddslash(&$params)\n\t{ \n\t foreach ($params as &$var) {\n\t // check if $var is an array. If yes, it will start another ExtendedAddslash() function to loop to each key inside.\n\t is_array($var) ? ExtendedAddslash($var) : $var=addslashes($var);\n\t }\n\t}", "function json($value){\n return json_encode($value , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);\n}", "function JsonUnescaped($data)\n {\n return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }", "function _json_encode($data) {\n\t\treturn json_encode($data);\n\t\treturn json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);\n\t}", "function js_escape($value)\n{\n return Zend_Json::encode($value);\n}", "function array_add_slashes($array) {\n\tif (is_array($array)) {\n\t\tforeach ($array as $key => $value) {\n\t\t\tif (!is_array($value)) {\n\t\t\t\t$value = addslashes($value);\n\t\t\t\t$key = addslashes($key);\n\t\t\t\t$new_arr[$key] = $value;\n\t\t\t}\n\t\t\tif (is_array($value)) {\n\t\t\t\t$new_arr[$key] = array_add_slashes($value);\n\t\t\t}\n\t\t}\n\t}\n\treturn $new_arr;\n}", "function wp_slash( $value ) {\n\tif ( is_array( $value ) ) {\n\t\tforeach ( $value as $k => $v ) {\n\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t$value[$k] = wp_slash( $v );\n\t\t\t} else {\n\t\t\t\t$value[$k] = addslashes( $v );\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$value = addslashes( $value );\n\t}\n\n\treturn $value;\n}", "function tf_addslashes_deep_keys($value) {\r\n static $magic_quotes = null;\r\n if ($magic_quotes === null) {\r\n $magic_quotes = get_magic_quotes_gpc();\r\n }\r\n\r\n if ( is_array($value) ) {\r\n if ($magic_quotes) {\r\n $new_value = array();\r\n foreach ($value as $key=>$value) {\r\n $new_value[ is_string($key) ? addslashes($key) : $key ] = tf_addslashes_deep_keys($value);\r\n }\r\n $value = $new_value;\r\n unset($new_value);\r\n } else {\r\n $value = array_map('tf_addslashes_deep_keys', $value);\r\n }\r\n } elseif ( is_object($value) ) {\r\n $vars = get_object_vars( $value );\r\n foreach ($vars as $key=>$data) {\r\n $value->{$key} = tf_addslashes_deep_keys( $data );\r\n }\r\n } elseif ( is_string( $value ) ) {\r\n $value = addslashes($value);\r\n }\r\n\r\n return $value;\r\n }", "private function add_slashes($data) {\r\n\t\treturn addslashes ( $data );\r\n\t}", "function encodeEscaped($jsonString) {\n $jsonString = str_replace('\\\\\\\\', '<LJ_BACKSLASH>', $jsonString);\n $jsonString = str_replace('\\\\\"', '<LJ_QUOTE>', $jsonString);\n $jsonString = str_replace('\\\\:', '<LJ_COLON>', $jsonString);\n $jsonString = str_replace('\\\\,', '<LJ_COMMA>', $jsonString);\n $jsonString = str_replace('\\\\[', '<LJ_SQ_BRACKET_L>', $jsonString);\n $jsonString = str_replace('\\\\]', '<LJ_SQ_BRACKET_R>', $jsonString);\n $jsonString = str_replace('\\\\{', '<LJ_BRACE_L>', $jsonString);\n $jsonString = str_replace('\\\\}', '<LJ_BRACE_R>', $jsonString);\n return $jsonString;\n }", "function removeSlashes($data){\n foreach($data as $key => $value){\n $data[$key] = stripslashes($value);\n }\n}", "function prepare_json_output($data) {\n\treturn indent_json_string(preg_replace(';\\\\\\/;', '/', json_encode($data)));\n}", "function ss_addslashes($args) {\n\tif( !defined('MAGIC_QUOTES_GPC') ) define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());\n\tif( !MAGIC_QUOTES_GPC ) { \n\t\tif( is_array($args) ) {\n\t\t\tforeach($args as $key => $val) {\n\t\t\t\t$args[$key] = ss_addslashes($val);\n\t\t\t}\t\t\n\t\t} else {\n\t\t\t$args = addslashes($args);\n\t\t}\n\t}\n\treturn $args;\n}", "function addslashes_array( $value ){\n\t$value = is_array( $value ) ? array_map( 'addslashes_array', $value ) : addslashes( $value );\n\n\treturn $value;\n}", "function EliminateSlashes($value) {\r\n if (is_array($value)) {\r\n reset($value);\r\n while (list($key, $val) = each($value))\r\n $value[$key] = EliminateSlashes($val);\r\n return $value;\r\n }\r\n return stripslashes($value);\r\n}", "function magicSlashes($element) {\r\n if (is_array($element))\r\n return array_map(array(\"INIT\", \"magicSlashes\"), $element);\r\n else\r\n return addslashes($element);\r\n }", "static function altJsonEncode($data)\n {\n return str_replace(\"'\", \"&#39;\", json_encode($data));\n }", "function fix_slashes($arr='')\n\t{\n\t\tif (is_null($arr) || $arr == '') return null;\n\t\tif (!get_magic_quotes_gpc()) return $arr;\n\t\treturn is_array($arr) ? array_map('fix_slashes', $arr) : stripslashes($arr);\n\t}", "function stripslashesDeep( $data)\r\n {\r\n return is_array($data) ? array_map( 'stripslashesDeep', $data) : stripslashes($data) ;\r\n }", "function addSlashesToArray($thearray){\r\n\r\n\tif(get_magic_quotes_runtime() || get_magic_quotes_gpc()){\r\n\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string(stripslashes($value));\r\n\r\n\t} else\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string($value);\r\n\r\n\treturn $thearray;\r\n\r\n}", "function stripslashes_nested($v)\n\t{\n\t\tif (is_array($v)) {\n\t\t\treturn array_map('stripslashes_nested', $v);\n\t\t} else {\n\t\t\treturn stripslashes($v);\n\t\t}\n\t}", "public static function addSlashesExtended(&$arr_r)\n {\n if (is_array($arr_r)) {\n foreach ($arr_r as &$val) {\n is_array($val) ? self::addSlashesExtended($val) : $val = addslashes($val);\n }\n unset($val);\n } else {\n $arr_r = addslashes($arr_r);\n }\n return $arr_r;\n }", "function do_magic_quotes_gpc(&$ar) {\n if (!is_array($ar)) return false;\n\n foreach ($ar as $key => $value) {\n if (is_array($ar[$key])) {\n do_magic_quotes_gpc($ar[$key]);\n } else {\n $ar[$key] = addslashes($value);\n }\n }\n\n reset($ar);\n}", "public function addSlashes(&$value){\nreturn $value = \"'$value'\";\n}", "function stripslashes_recursive($value) {\n\t\t$value = is_array($value) ? array_map(array($this, 'stripslashes_recursive'), $value) : stripslashes($value);\n\t\treturn $value;\n\t}", "function stripSlashesDeep($value) \n{\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "function json_readable_encode($in, $indent_string = \" \", $indent = 0, Closure $_escape = null)\n{\n if (version_compare(PHP_VERSION, '5.4.0') >= 0) {\n $ret = json_encode($in, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);\n $ret = preg_replace(\"/\\[\\s+\\]/\", \"\", $ret);\n return preg_replace(\"/\\{\\s+\\}/\", \"\", $ret);\n }\n\n if (__CLASS__ && isset($this))\n {\n $_myself = array($this, __FUNCTION__);\n }\n elseif (__CLASS__)\n {\n $_myself = array('self', __FUNCTION__);\n }\n else\n {\n $_myself = __FUNCTION__;\n }\n\n if (is_null($_escape))\n {\n $_escape = function ($str)\n {\n return str_replace(\n array('\\\\', '\"', \"\\n\", \"\\r\", \"\\b\", \"\\f\", \"\\t\", '\\\\\\\\u'),\n array('\\\\\\\\', '\\\\\"', \"\\\\n\", \"\\\\r\", \"\\\\b\", \"\\\\f\", \"\\\\t\", '\\\\u'),\n $str);\n };\n }\n\n $out = '';\n\n // TODO: format value (unicode, slashes, ...)\n if((!is_array($in)) && (!is_object($in)))\n return json_encode($in);\n\n // see http://stackoverflow.com/a/173479\n $is_assoc = array_keys($in) !== range(0, count($in) -1);\n\n foreach ($in as $key=>$value)\n {\n\tif($is_assoc) {\n\t $out .= str_repeat($indent_string, $indent + 1);\n\t $out .= \"\\\"\".$_escape((string)$key).\"\\\": \";\n\t}\n\telse {\n\t $out .= str_repeat($indent_string, $indent + 1);\n\t}\n\n\tif ((is_object($value) || is_array($value)) && (!count($value))) {\n\t $out .= \"[]\";\n\t}\n elseif (is_object($value) || is_array($value))\n {\n $out .= call_user_func($_myself, $value, $indent_string, $indent + 1, $_escape);\n }\n else\n {\n $out .= json_encode($value);\n }\n\n $out .= \",\\n\";\n }\n\n if (!empty($out))\n {\n $out = substr($out, 0, -2);\n }\n\n if($is_assoc) {\n $out = \"{\\n\" . $out;\n $out .= \"\\n\" . str_repeat($indent_string, $indent) . \"}\";\n }\n else {\n $out = \"[\\n\" . $out;\n $out .= \"\\n\" . str_repeat($indent_string, $indent) . \"]\";\n }\n\n return $out;\n}", "function stripslashes_deep($value) {\r\n\tif ( is_array($value) ) {\r\n\t\t$value = array_map('stripslashes_deep', $value);\r\n\t} elseif ( is_object($value) ) {\r\n\t\t$vars = get_object_vars( $value );\r\n\t\tforeach ($vars as $key=>$data) {\r\n\t\t\t$value->{$key} = stripslashes_deep( $data );\r\n\t\t}\r\n\t} else {\r\n\t\t$value = stripslashes($value);\r\n\t}\r\n\treturn $value;\r\n}", "function indent_json_string($json) {\n\t// nicked from http://www.daveperrett.com/articles/2008/03/11/format-json-with-php/\n\t$result = '';\n $pos = 0;\n $strLen = strlen($json);\n $indentStr = ' ';\n $newLine = \"\\n\";\n $prevChar = '';\n $outOfQuotes = true;\n\n for ($i=0; $i<=$strLen; $i++) {\n\n\t // Grab the next character in the string.\n\t $char = substr($json, $i, 1);\n\n\t // Are we inside a quoted string?\n\t if ($char == '\"' && $prevChar != '\\\\') {\n\t\t $outOfQuotes = !$outOfQuotes;\n\n\t\t // If this character is the end of an element,\n\t\t // output a new line and indent the next line.\n \n\t } else if(($char == '}' || $char == ']') && $outOfQuotes) {\n\t\t $result .= $newLine;\n\t\t $pos --;\n\t\t for ($j=0; $j<$pos; $j++) {\n\t\t\t $result .= $indentStr;\n \n\t\t }\n \n\t }\n\n\t // Add the character to the result string.\n\t $result .= $char;\n\n\t // If the last character was the beginning of an element,\n\t // output a new line and indent the next line.\n\t if (($char == ',' || $char == '{' || $char == '[') && $outOfQuotes) {\n\t\t $result .= $newLine;\n\t\t if ($char == '{' || $char == '[') {\n\t\t\t $pos ++;\n \n\t\t }\n\n\t\t for ($j = 0; $j < $pos; $j++) {\n\t\t\t $result .= $indentStr;\n \n\t\t }\n\t }\n\n\t $prevChar = $char;\n }\n\n return $result;\n}", "function stripSlashesDeep($value)\n{\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "function alternate_json_encode($a = false) {\n\n\t// Replacing special chartacers: It's dangerous to go alone! Take this - http://php.net/manual/en/regexp.reference.unicode.php\n\t// And this: http://www.codeproject.com/Articles/37735/Searching-Modifying-and-Encoding-Text\n\t$jsonReplaces = array(\n\t\tarray(\"\\\\\", \"/\", \"\\n\", \"\\t\", \"\\r\", \"\\b\", \"\\f\", '\"', \"\\0\", \"\\v\", \"\\e\", chr(194).chr(155), chr(26), chr(1), chr(31), chr(3), chr(8)),\n\t\tarray('\\\\\\\\', '\\\\/', '\\\\n', '\\\\t', '\\\\r', '\\\\b', '\\\\f', '\\\"', '\\u0000', '\\u000b','\\u001b', '\\u009b', '\\u001a', '\\u0001', '\\u001f', '\\u0003', '\\u0008')\n\t);\n\n\tif (is_null($a))\n\t\treturn 'null';\n\tif ($a === false)\n\t\treturn 'false';\n\tif ($a === true)\n\t\treturn 'true';\n\tif (is_scalar($a)) {\n\t\tif (is_float($a)) {\n\t\t\t// Always use \".\" for floats.\n\t\t\treturn floatval(str_replace(\",\", \".\", strval($a)));\n\t\t}\n\n\t\tif (is_string($a) && isset($jsonReplaces)) {\n\t\t\treturn '\"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '\"';\n\t\t}\n\t\telse {\n\t\t\treturn $a;\n\t\t}\n\t}\n\tif ($a instanceof JsonSerializable) {\n\t\treturn alternate_json_encode($a->jsonSerialize());\n\t}\n\t$isList = true;\n\tfor ($i = 0, reset($a); $i < count($a); $i++, next($a)) {\n\t\tif (key($a) !== $i) {\n\t\t\t$isList = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\t$result = array();\n\tif ($isList) {\n\t\tforeach ($a as $v)\n\t\t\t$result[] = alternate_json_encode($v);\n\t\treturn '[' . join(',', $result) . ']';\n\t} else {\n\t\tforeach ($a as $k => $v)\n\t\t\t$result[] = alternate_json_encode(''.$k) . ':' . alternate_json_encode($v);\n\t\treturn '{' . join(',', $result) . '}';\n\t}\n}", "function stripslashes_deep($value)\r\n{\r\n\treturn is_array($value)?array_map('stripslashes_deep',$value):stripslashes($value);\r\n}", "function atk_stripslashes(&$var)\n{\n\tif (is_array($var))\n\t{\n\t\tforeach (array_keys($var) as $key)\n\t\t{\n\t\t\tatk_stripslashes($var[$key]);\n\t\t}\n\t}\n\telse\n\t{\n\t\t$var = stripslashes($var);\n\t}\n}", "function my_json_encode($var) {\n switch (gettype($var)) {\n case 'boolean':\n return $var ? 'true' : 'false'; // Lowercase necessary!\n case 'integer':\n case 'double':\n return $var;\n case 'resource':\n case 'string':\n return '\"'. str_replace(array(\"\\r\", \"\\n\", \"<\", \">\", \"&\"),\n //array('\\r', '\\n', '\\x3c', '\\x3e', '\\x26'),\n array('\\r', '\\n', '\\u003C', '\\u003E', '\\u0026'), \n \t\t\t\t\t\t addslashes($var)) .'\"';\n case 'array':\n // Arrays in JSON can't be associative. If the array is empty or if it\n // has sequential whole number keys starting with 0, it's not associative\n // so we can go ahead and convert it as an array.\n if (empty ($var) || array_keys($var) === range(0, sizeof($var) - 1)) {\n $output = array();\n foreach ($var as $v) {\n $output[] = my_json_encode($v);\n }\n return '[ '. implode(', ', $output) .' ]';\n }\n // Otherwise, fall through to convert the array as an object.\n case 'object':\n $output = array();\n foreach ($var as $k => $v) {\n $output[] = my_json_encode(strval($k)) .': '. my_json_encode($v);\n }\n return '{ '. implode(', ', $output) .' }';\n default:\n return 'null';\n }\n}", "private function json_encode_wi_single_quotes( $phpArray )\n {\n // Moves php array to a JSON array\n $jsonData = json_encode( $phpArray );\n // Replace all double quotes with single quotes\n $jsonData = str_replace( '\"', \"'\", $jsonData );\n // Decode HTML special chars\n $jsonData = htmlspecialchars_decode( $jsonData );\n//$this->pObj->dev_var_dump( $phpArray, $jsonData );\n\n return $jsonData;\n }", "public function addSlash(){\n $this->firstname = addslashes($this->firstname);\n $this->lastname = addslashes($this->lastname);\n $this->company = addslashes($this->company);\n $this->country = addslashes($this->country);\n $this->place = addslashes($this->place);\n $this->street = addslashes($this->street);\n $this->description = addslashes($this->description); \n }", "function JsonPrettyPrinted($data)\n {\n return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);\n }", "function stripSlashesDeep($value) {\r\n $value = is_array($value) ? array_map('cleanInputs', $value) : stripslashes($value);\r\n return $value;\r\n}", "function rf_convert_vc_json($value)\n{\n $value = str_replace('``','\"', $value);\n $value = preg_replace('/`\\}`/', ']',$value);\n $value = preg_replace('/`\\{`/','[',$value);\n return htmlspecialchars($value);\n}", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "function h_json_encode($arr)\n{\n\tarray_walk_recursive($arr, function (&$item, $key) {\n\t\tif (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\n\t});\n\t$arrReturn = str_replace(\"\\'\", \"'\", mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8'));\n\treturn $arrReturn;\n}", "function stripslashes_deep($value)\n{\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n return $value;\n}", "function stripslashes_deep($value)\n{\n $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);\n\n return $value;\n}", "function nice_addslashes($string)\n{\n // if magic quotes is on the string is already quoted, just return it\n if(MAGIC_QUOTES)\n return $string;\n else\n return addslashes($string);\n}", "function stripslashes_deep($value) {\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n return $value;\n}", "function stripSlashesDeep($value) {\n\t$value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n\treturn $value;\n}", "function tf_stripslashes_deep_keys($value) {\r\n static $magic_quotes = null;\r\n if ($magic_quotes === null) {\r\n $magic_quotes = get_magic_quotes_gpc();\r\n }\r\n\r\n if ( is_array($value) ) {\r\n if ($magic_quotes) {\r\n $new_value = array();\r\n foreach ($value as $key=>$value) {\r\n $new_value[ is_string($key) ? stripslashes($key) : $key ] = tf_stripslashes_deep_keys($value);\r\n }\r\n $value = $new_value;\r\n unset($new_value);\r\n } else {\r\n $value = array_map('tf_stripslashes_deep_keys', $value);\r\n }\r\n } elseif ( is_object($value) ) {\r\n $vars = get_object_vars( $value );\r\n foreach ($vars as $key=>$data) {\r\n $value->{$key} = tf_stripslashes_deep_keys( $data );\r\n }\r\n } elseif ( is_string( $value ) ) {\r\n $value = stripslashes($value);\r\n }\r\n\r\n return $value;\r\n }", "function unfck($v) {\n return is_array($v) ? array_map('unfck', $v) : addslashes($v);\n}", "function stripslashes_array($data) {\r\n if (is_array($data)){\r\n foreach ($data as $key => $value){\r\n $data[$key] = stripslashes_array($value);\r\n }\r\n return $data;\r\n } else {\r\n return stripslashes($data);\r\n }\r\n }", "function my_json_encode($input) {\n\t$ret = \"\";\n\n\t// Check to see if it is an array\n\tif(is_array($input)) {\n\t\t// Then see if we are doing a normal array\n\t\tif(!is_assoc($input)) {\n\t\t\tif(count($input) == 0) $ret = \"[]\";\n\t\t\telse {\n\t\t\t\t$ret = \"[\";\n\t\t\t\tforeach($input as $val) {\n\t\t\t\t\t$ret .= my_json_encode($val).',';\n\t\t\t\t}\n\t\t\t\t$ret = substr($ret, 0, -1).']';\n\t\t\t}\n\n\t\t// Or an object\n\t\t} else {\n\t\t\tif(count($input) == 0) $ret = \"{}\";\n\t\t\telse {\n\t\t\t\t$ret = \"{\";\n\t\t\t\tforeach($input as $key=>$val) {\n\t\t\t\t\t$ret .= '\"'.$key.'\":'.my_json_encode($val).',';\n\t\t\t\t}\n\t\t\t\t$ret = substr($ret, 0, -1).'}';\n\t\t\t}\n\t\t}\n\t// true or false\n\t} else if($input === true || $input === false || $input == \"true\" || $input == \"false\") {\n\t\t$ret = ($input === true || $input == \"true\")?\"true\":\"false\";\n\n\t// numbers 0-9\n\t} else if(preg_match(\"/[0-9]*/\", $input, $match) && $match[0] == $input && $input != \"\") {\n\t\t$ret = $input;\n\n\t// Strings (or anything else)\n\t} else {\n\t\t$ret = '\"'.str_replace(Array('\"',\"\\r\",\"\\n\"), Array('\\\"', '\\r', '\\n'), $input).'\"';\n\t}\n\n\treturn $ret;\n}", "function json_text_filter($datajson) {\n\n /*\n This is to help accomodate encoding issues, eg invalid newlines. See:\n http://forum.jquery.com/topic/json-with-newlines-in-strings-should-be-valid#14737000000866332\n http://stackoverflow.com/posts/17846592/revisions\n */\n $datajson = preg_replace('/[ ]{2,}|[\\t]/', ' ', trim($datajson));\n //$data = str_replace(array(\"\\r\", \"\\n\", \"\\\\n\", \"\\r\\n\"), \" \", $data);\n //$data = preg_replace('!\\s+!', ' ', $data);\n //$data = str_replace(' \"', '\"', $data);\n\n $datajson = preg_replace('/,\\s*([\\]}])/m', '$1', utf8_encode($datajson));\n\n\n /*\n This is to replace any possible BOM \"Byte order mark\" that might be present\n See: http://stackoverflow.com/questions/10290849/how-to-remove-multiple-utf-8-bom-sequences-before-doctype\n and\n http://stackoverflow.com/questions/3255993/how-do-i-remove-i-from-the-beginning-of-a-file\n */\n // $bom = pack('H*','EFBBBF');\n // $datajson = preg_replace(\"/^$bom/\", '', $datajson);\n $datajson = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $datajson);\n\n return $datajson;\n\n}", "function json_fixer($data = '')\r\n\t{\r\n\t\tif(is_string($data))\r\n\t\t{\r\n\t\t\treturn mb_convert_encoding($data, 'UTF-8', 'UTF-8');\r\n\t\t}\r\n\t\telseif(is_array($data))\r\n\t\t{\r\n\t\t\t$output\t\t\t\t\t\t\t\t\t= array();\r\n\t\t\t\r\n\t\t\tforeach($data as $key => $val)\r\n\t\t\t{\r\n\t\t\t\t$output[$key]\t\t\t\t\t\t= json_fixer($val);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $output;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $data;\r\n\t\t}\r\n\t}", "function prli_json_encode($json_array)\n {\n $json_str = '';\n\n if(is_array($json_array))\n {\n if($this->prli_array_type($json_array) == 'array')\n {\n $first = true;\n $json_str .= \"[\";\n foreach($json_array as $item)\n {\n if(!$first)\n $json_str .= \",\";\n\n if(is_numeric($item))\n $json_str .= (($item < 0)?\"\\\"$item\\\"\":$item);\n else if(is_array($item))\n $json_str .= $this->prli_json_encode($item);\n else if(is_string($item))\n $json_str .= '\"'.$item.'\"';\n else if(is_bool($item))\n $json_str .= (($item)?\"true\":\"false\");\n\n $first = false;\n }\n $json_str .= \"]\";\n }\n else if($this->prli_array_type($json_array) == 'hash')\n {\n $first = true;\n $json_str .= \"{\";\n foreach($json_array as $key => $item)\n {\n if(!$first)\n $json_str .= \",\";\n\n $json_str .= \"\\\"$key\\\":\";\n\n if(is_numeric($item))\n $json_str .= (($item < 0)?\"\\\"$item\\\"\":$item);\n else if(is_array($item))\n $json_str .= $this->prli_json_encode($item);\n else if(is_string($item))\n $json_str .= \"\\\"$item\\\"\";\n else if(is_bool($item))\n $json_str .= (($item)?\"true\":\"false\");\n\n $first = false;\n }\n $json_str .= \"}\";\n }\n }\n\n return $json_str;\n }", "function stripslashes_deep($value) {\n\t$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);\n\treturn $value;\n}", "function addslashes_strings_only($value)\n {\n }", "function smartaddslashes($str) {\n\t\tif ( get_magic_quotes_gpc() == false ) {\n\t\t\t$str = addslashes( $str );\n\t\t}\n\t\treturn $str;\n\t}", "public static function escapeJsonString($value)\n {\n $escapers = array('\"', '/');\n $replacements = array('\\\"', '\\/');\n return str_replace($escapers, $replacements, $value);\n }", "function acf_json_encode($json)\n{\n}", "function pretty_json($json){\r\n\t$result = '';\r\n\t$pos = 0;\r\n\t$strLen = strlen($json);\r\n\t$indentStr = '&nbsp;&nbsp;&nbsp;&nbsp;';\r\n\t$newLine = \"<br>\";\r\n\t$prevChar = '';\r\n\t$outOfQuotes = true;\r\n\tfor($i = 0; $i <= $strLen; $i++){\r\n\t\t$char = substr($json, $i, 1);\r\n\t\tif($char == '\"' && $prevChar != '\\\\'){\r\n\t\t\t$outOfQuotes = !$outOfQuotes;\r\n\t\t}elseif(($char == '}' || $char == ']') && $outOfQuotes){\r\n\t\t\t$result .= $newLine;\r\n\t\t\t$pos --;\r\n\t\t\tfor($j = 0; $j < $pos; $j++){\r\n\t\t\t\t$result .= $indentStr;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$result .= $char;\r\n\t\tif(($char == ',' || $char == '{' || $char == '[') && $outOfQuotes){\r\n\t\t\t$result .= $newLine;\r\n\t\t\tif($char == '{' || $char == '['){\r\n\t\t\t\t$pos ++;\r\n\t\t\t}\r\n\t\t\tfor($j = 0; $j < $pos; $j++){\r\n\t\t\t\t$result .= $indentStr;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$prevChar = $char;\r\n\t}\r\n\treturn $result;\r\n}", "function stripslashes_deep($value) {\n\tif ( is_array($value) ) {\n\t\t$value = array_map('stripslashes_deep', $value);\n\t} elseif ( is_object($value) ) {\n\t\t$vars = get_object_vars( $value );\n\t\tforeach ($vars as $key=>$data) {\n\t\t\t$value->{$key} = stripslashes_deep( $data );\n\t\t}\n\t} else {\n\t\t$value = stripslashes($value);\n\t}\n\n\treturn $value;\n}", "public function json($data){\n\tif(is_array($data)){\n\t\treturn json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n\t}\n}", "function cf_json_encode($data) {\n// for some unknown reason.\n// \t\tif(function_exists('json_encode')) { return json_encode($data); }\n// \t\telse { return cfjson_encode($data); }\n\t\treturn cfjson_encode($data);\n\t}", "function pretty_json($json, $ret= \"\\n\", $ind=\"\\t\") {\n $beauty_json = '';\n $quote_state = FALSE;\n $level = 0; \n $json_length = strlen($json);\n for ($i = 0; $i < $json_length; $i++)\n { \n $pre = '';\n $suf = '';\n switch ($json[$i])\n {\n case '\"': \n $quote_state = !$quote_state; \n break;\n case '[': \n $level++; \n break;\n case ']':\n $level--; \n $pre = $ret;\n $pre .= str_repeat($ind, $level); \n break;\n case '{':\n if ($i - 1 >= 0 && $json[$i - 1] != ',')\n {\n $pre = $ret;\n $pre .= str_repeat($ind, $level); \n } \n $level++; \n $suf = $ret; \n $suf .= str_repeat($ind, $level); \n break;\n case ':':\n $suf = ' ';\n break;\n case ',':\n if (!$quote_state)\n { \n $suf = $ret; \n $suf .= str_repeat($ind, $level);\n }\n break;\n case '}':\n $level--; \n\n case ']':\n $pre = $ret;\n $pre .= str_repeat($ind, $level);\n break;\n }\n $beauty_json .= $pre.$json[$i].$suf;\n }\n return $beauty_json;\n }", "function stripslashes_deep($value) {\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n\n return $value;\n}", "function _format_json($json, $html = false) {\n $tabcount = 0;\n $result = '';\n $inquote = false;\n $ignorenext = false;\n if ($html) {\n $tab = \" \";\n $newline = \"<br/>\";\n } else {\n $tab = \"\\t\";\n $newline = \"\\n\";\n }\n for($i = 0; $i < strlen($json); $i++) {\n $char = $json[$i];\n if ($ignorenext) {\n $result .= $char;\n $ignorenext = false;\n } else {\n switch($char) {\n case '{':\n $tabcount++;\n $result .= $char . $newline . str_repeat($tab, $tabcount);\n break;\n case '}':\n $tabcount--;\n $result = trim($result) . $newline . str_repeat($tab, $tabcount) . $char;\n break;\n case ',':\n $result .= $char . $newline . str_repeat($tab, $tabcount);\n break;\n case '\"':\n $inquote = !$inquote;\n $result .= $char;\n break;\n case '\\\\':\n if ($inquote) $ignorenext = true;\n $result .= $char;\n break;\n default:\n $result .= $char;\n }\n }\n }\n return $result;\n}", "function wp_json_encode($data, $options = 0, $depth = 512)\n {\n }", "function JSONoutputString($array){\n\t\t return json_encode($array, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);\n\t\t //return json_encode($array, 0);\n\t}", "function jsonPretty($obj) {\n return jsonEncode($obj, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n}", "function stripslashes_deep($value) {\n\tif ( is_array($value) ) {\n\t\t$value = array_map('stripslashes_deep', $value);\n\t} elseif ( is_object($value) ) {\n\t\t$vars = get_object_vars( $value );\n\t\tforeach ($vars as $key=>$data) {\n\t\t\t$value->{$key} = stripslashes_deep( $data );\n\t\t}\n\t} elseif ( is_string( $value ) ) {\n\t\t$value = stripslashes($value);\n\t}\n\n\treturn $value;\n}", "function my_json_encode($arr) {\n array_walk_recursive($arr, function (&$item, $key) { if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); });\n return mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\n}", "private function _add_magic_quotes( $array ) {\n foreach ( (array) $array as $k => $v ) {\n if ( is_array( $v ) ) {\n $array[$k] = $this->_add_magic_quotes( $v );\n } elseif (is_string($v)) {\n $array[$k] = addslashes( $v );\n }\n }\n return $array;\n }", "function arrayStripslashes(&$array) {\n if (!is_array($array)) {\n return;\n }\n foreach ($array as $k => $v) {\n if (is_array($array[$k])) {\n arrayStripslashes($array[$k]);\n } else {\n $array[$k] = stripslashes($array[$k]);\n }\n }\n return $array;\n}", "function fix_POST_slashes() {\n\tglobal $fixed_POST_slashes;\n\tif (!$fixed_POST_slashes and get_magic_quotes_gpc()) {\n\t\t$fixed_POST_slashes = true;\n\t\tforeach ($_POST as $key => $val) {\n\t\t\tif (gettype($val) == \"array\") {\n\t\t\t\tforeach ($val as $i => $j) {\n\t\t\t\t\t$val[$i] = stripslashes($j);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$_POST[$key] = stripslashes($val);\n\t\t\t}\n\t\t}\n\t}\n}", "function ldap_slashes($str){\n $illegal=array(\"(\",\")\",\"#\"); // the + character has problems too, but it's an illegal character\n \n $legal=array();\n foreach ($illegal as $id => $char){ $legal[$id]=\"\\\\\".$char; } //make up the array of legal chars\n \n $str=str_replace($illegal,$legal,$str); //replace them\n return ($str);\n }", "static function json_encode(array $input) {\n\n\t\t$replaced = array();\n\n\t\tforeach ($input as $key => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t$replaced['\"%'.$key.'%\"'] = self::json_encode($value);\n\t\t\t\t$input[$key] = '%'.$key.'%';\n\t\t\t} else if (strpos($value, 'function(') === 0) {\n\t\t\t\t$replaced['\"%'.$key.'%\"'] = $value;\n\t\t\t\t$input[$key] = '%'.$key.'%';\n\t\t\t}\n\t\t}\n\n\t\t$output = json_encode($input);\n\n\n\t\t$output = str_replace(array_keys($replaced), $replaced, $output);\n\n\t\treturn $output;\n\t}", "function array_stripslashes(&$array) {\n if(!is_array($array)) return;\n foreach($array as $k => $v) {\n if(is_array($array[$k])) {\n array_stripslashes($array[$k]);\n } else {\n $array[$k] = stripslashes($array[$k]);\n } // if\n } // foreach\n return $array;\n }", "function json_encode2($arr){\r\n\tarray_walk_recursive($arr, function (&$item, $key) {\r\n\t\tif (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\r\n\t});\r\n\treturn mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\r\n}", "function strip_slashes($stdObject_or_array_or_string)\n {\n static $level = 0;\n static $processed_objects = array();\n $level++;\n $processed_objects[] = $stdObject_or_array_or_string;\n if (is_string($stdObject_or_array_or_string)) {\n $stdObject_or_array_or_string = str_replace(\"\\\\'\", \"'\", str_replace('\\\\\"', '\"', str_replace(\"\\\\\\\\\", \"\\\\\", $stdObject_or_array_or_string)));\n } elseif (is_object($stdObject_or_array_or_string) && !in_array($stdObject_or_array_or_string, $processed_objects)) {\n foreach (get_object_vars($stdObject_or_array_or_string) as $key => $val) {\n if ($val != $stdObject_or_array_or_string && $key != '_mapper') {\n $stdObject_or_array_or_string->{$key} = $this->strip_slashes($val);\n }\n }\n $processed_objects[] = $stdObject_or_array_or_string;\n } elseif (is_array($stdObject_or_array_or_string)) {\n foreach ($stdObject_or_array_or_string as $key => $val) {\n if ($key != '_mixins') {\n $stdObject_or_array_or_string[$key] = $this->strip_slashes($val);\n }\n }\n }\n $level--;\n if ($level == 0) {\n $processed_objects = array();\n }\n return $stdObject_or_array_or_string;\n }", "function json_cb(&$item, $key) { \n if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); \n}", "public function prase_json1(){\n\t\t\t$stry=\"{\";\n\t\t\n\t\t\t$stry=$stry.\"\\\"\".$this->xml->getName().\"\\\"\".\":{\";\n\t\t\t$bg=$this->xml->children();\n\t\t\n\t\t\t\n\t\t\tforeach ($bg[1]->children() as $ff){\n\t\t\t$stry=$stry.\"\\\"\".$ff->getName().\"\\\":\\\"\".$ff.\"\\\",\";\t}\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t$stry=substr($stry,0,strlen($stry)-1);\n\t\t\n\t\t$stry.=\"},\";\n\t\t\n\t\t$stry=substr($stry,0,strlen($stry)-1);\n\t\t$stry.=\"}\";\n\t\t\t\n\t\t\t\n\t\treturn $stry;\n\t\t\t\n\t\t\t\n\t}", "function stripslashes_deep( $values ) {\n\t\tif (is_array($values)) {\n\t\t\tforeach ($values as $key => $value)\n\t\t\t\t$values[$key] = stripslashes_deep($value);\t\t\t\n\t\t} else \n\t\t\t$values = stripslashes($values);\t\t\n\t\treturn $values;\n\t}", "function fs_prep_data_for_json($assoc_tree, $root_name=null) {\n $results = array(\n '_node_name' => ($root_name === null\n ? ''\n : $root_name),\n 'children' => array(),\n );\n if (is_array($assoc_tree)) {\n foreach ($assoc_tree as $key => $subtree) {\n $results['children'][] = fs_prep_data_for_json(\n $subtree, $key\n );\n }\n }\n return $results;\n }", "function stripslashes_deep($value)\n {\n }", "function to_json($data): string\n {\n return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);\n }", "private function json($data){\n\t\tif(is_array($data)){\n\t\t\tif (getParameter('f')) {\n\t\t\t\tswitch(getParameter('f')){\n\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\treturn json_encode($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"pjson\":\n\t\t\t\t\t\tif(defined(JSON_PRETTY_PRINT))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\treturn json_encode($data, JSON_PRETTY_PRINT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\treturn json_encode($data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return $data;\n\t\t}\n\t}", "private function formatJson($json) {\n\n $result = '';\n $pos = 0;\n $strLen = strlen($json);\n $indentStr = ' ';\n $newLine = \"\\n\";\n $prevChar = '';\n $outOfQuotes = true;\n\n for ($i=0; $i<=$strLen; $i++) {\n\n // Grab the next character in the string.\n $char = substr($json, $i, 1);\n\n // Are we inside a quoted string?\n if ($char == '\"' && $prevChar != '\\\\') {\n $outOfQuotes = !$outOfQuotes;\n\n // If this character is the end of an element,\n // output a new line and indent the next line.\n } else if(($char == '}' || $char == ']') && $outOfQuotes) {\n $result .= $newLine;\n $pos --;\n for ($j=0; $j<$pos; $j++) {\n $result .= $indentStr;\n }\n }\n\n // Add the character to the result string.\n $result .= $char;\n\n // If the last character was the beginning of an element,\n // output a new line and indent the next line.\n if (($char == ',' || $char == '{' || $char == '[') && $outOfQuotes) {\n $result .= $newLine;\n if ($char == '{' || $char == '[') {\n $pos ++;\n }\n\n for ($j = 0; $j < $pos; $j++) {\n $result .= $indentStr;\n }\n }\n\n $prevChar = $char;\n }\n\n return $result;\n }", "function stripslashes_deep($value)\r\n {\r\n $value = is_array($value) ?\r\n array_map('stripslashes_deep', $value) :\r\n stripslashes($value);\r\n \r\n return $value;\r\n }", "private function indent($json) {\n\n\t\t$result = '';\n\t\t$pos = 0;\n\t\t$strLen = strlen($json);\n\t\t$indentStr = ' ';\n\t\t$newLine = \"\\n\";\n\t\t$prevChar = '';\n\t\t$outOfQuotes = true;\n\n\t\tfor ($i=0; $i<=$strLen; $i++) {\n\n\t // Grab the next character in the string.\n\t\t\t$char = substr($json, $i, 1);\n\n\t // Are we inside a quoted string?\n\t\t\tif ($char == '\"' && $prevChar != '\\\\') {\n\t\t\t\t$outOfQuotes = !$outOfQuotes;\n\n\t // If this character is the end of an element, \n\t // output a new line and indent the next line.\n\t\t\t} else if(($char == '}' || $char == ']') && $outOfQuotes) {\n\t\t\t\t$result .= $newLine;\n\t\t\t\t$pos --;\n\t\t\t\tfor ($j=0; $j<$pos; $j++) {\n\t\t\t\t\t$result .= $indentStr;\n\t\t\t\t}\n\t\t\t}\n\n\t // Add the character to the result string.\n\t\t\t$result .= $char;\n\n\t // If the last character was the beginning of an element, \n\t // output a new line and indent the next line.\n\t\t\tif (($char == ',' || $char == '{' || $char == '[') && $outOfQuotes) {\n\t\t\t\t$result .= $newLine;\n\t\t\t\tif ($char == '{' || $char == '[') {\n\t\t\t\t\t$pos ++;\n\t\t\t\t}\n\n\t\t\t\tfor ($j = 0; $j < $pos; $j++) {\n\t\t\t\t\t$result .= $indentStr;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$prevChar = $char;\n\t\t}\n\n\t\treturn $result;\n\t}", "function _put_safe_slashes ($text = \"\") {\n\t\t$text = str_replace(\"'\", \"&#039;\", trim($text));\n\t\t$text = str_replace(\"\\\\&#039;\", \"\\\\'\", $text);\n\t\t$text = str_replace(\"&#039;\", \"\\\\'\", $text);\n\t\tif (substr($text, -1) == \"\\\\\" && substr($text, -2, 1) != \"\\\\\") {\n\t\t\t$text .= \"\\\\\";\n\t\t}\n\t\treturn $text;\n\t}", "function DoStripSlashes($fieldValue) {\n if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { \n if (is_array($fieldValue) ) { \n return array_map('DoStripSlashes', $fieldValue); \n } else { \n return trim(stripslashes($fieldValue)); \n } \n } else { \n return $fieldValue; \n } \n}", "function json_serialize($input)\n{\n $input = rc_utf8_clean($input);\n\n // sometimes even using rc_utf8_clean() the input contains invalid UTF-8 sequences\n // that's why we have @ here\n return @json_encode($input);\n}", "function adds_trim($item) {\n\treturn addslashes(trim($item));\n}" ]
[ "0.6961355", "0.6804579", "0.6766977", "0.66607076", "0.6621491", "0.6612269", "0.6589584", "0.65824825", "0.6558479", "0.65082455", "0.64936495", "0.64591336", "0.6455566", "0.6438995", "0.64380836", "0.635974", "0.6356298", "0.6344938", "0.6323798", "0.63103193", "0.6292526", "0.6272298", "0.6155863", "0.6150729", "0.61468726", "0.6134462", "0.61163646", "0.6092059", "0.6087606", "0.60812956", "0.6073838", "0.60609597", "0.60602725", "0.60597193", "0.60512835", "0.6048787", "0.6048427", "0.6046484", "0.604538", "0.6029965", "0.60095054", "0.60077375", "0.60018706", "0.59988743", "0.5981767", "0.5967022", "0.5955923", "0.5955923", "0.59519035", "0.5951861", "0.59514946", "0.59416586", "0.5933077", "0.5918202", "0.59140027", "0.5904037", "0.58738995", "0.5841426", "0.58390456", "0.58019334", "0.57980853", "0.5795129", "0.57910883", "0.5780896", "0.5778908", "0.5776187", "0.57651836", "0.57646364", "0.575063", "0.5748453", "0.5747706", "0.5744095", "0.57380134", "0.5735217", "0.5723185", "0.5713769", "0.5712666", "0.57099", "0.57094866", "0.57031804", "0.56975895", "0.56959766", "0.56899947", "0.5688712", "0.5685369", "0.5667161", "0.5666095", "0.565981", "0.5638286", "0.56339693", "0.563239", "0.5629871", "0.5607552", "0.5599246", "0.55987793", "0.5591666", "0.5590745", "0.55886865", "0.5581219", "0.55784625" ]
0.6594849
6
08.21.2015 ghh this function deals with looking up an item in order to calculate its cost for the current dealership
function getItemCost( $itemid, $dealerid, $pricecode, $cost, $list ) { global $db; //08.21.2015 ghh - first we're going to see if there is a dealer specific price for //this item and if so we'll just pass it back $query = "select DealerCost from ItemCost where ItemID=$itemid and DealerID=$dealerid"; if (!$result = $db->sql_query($query)) { RestLog("Error 16527 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16527 - There was a problem attempting find the dealer cost"); //Internal Server Error return false; } $row = $db->sql_fetchrow( $result ); //if there is a cost then lets just return it. if ( $row['DealerCost'] > 0 ) return $row['DealerCost']; //if there was no cost then the next step is to see if there is a price code if ( $pricecode != '' ) { $query = "select Discount from PriceCodesLink where DealerID=$dealerid and PriceCode=$pricecode"; if (!$result = $db->sql_query($query)) { RestLog("Error 16528 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16528 - There was a problem finding your price code"); //Internal Server Error return false; } //08.28.2015 ghh - if we did not find a dealer specific code then next we're going to //look for a global code to see if we can find that if ( $db->sql_numrows( $result ) == 0 ) { $query = "select Discount from PriceCodesLink where DealerID=0 and PriceCode=$pricecode"; if (!$result = $db->sql_query($query)) { RestLog("Error 16626 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16626 - There was a problem finding your price code"); //Internal Server Error return false; } //if we found a global price code entry then enter here if ( $db->sql_numrows( $result ) > 0 ) { $row = $db->sql_fetchrow( $result ); if ( $row['Discount'] > 0 ) $cost = bcmul( bcadd(1, $row['Discount']), $cost ); else $cost = bcmul( bcadd( 1, $row['Discount']), $list ); } } else { //if we found a dealer specific code then enter here $row = $db->sql_fetchrow( $result ); if ( $row['Discount'] > 0 ) $cost = bcmul( bcadd(1, $row['Discount']), $cost ); else $cost = bcmul( bcadd( 1, $row['Discount']), $list ); } } return $cost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUnitCost( $modelid, $dealerid, $cost )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select Cost from UnitModelCost where ModelID=$modelid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16562 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16562 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['Cost'] > 0 )\n\treturn $row['Cost'];\n\nreturn $cost;\n}", "function getitemcost($item_cost)\r\n{\r\n require_once(\"heading.php\");\r\n$item = $_POST[\"items\"];\r\n$player = $_POST[\"character\"];\r\nif ($item == 'Bag')\r\n $item_cost = (int)20;\r\nif ($item == 'Phoenix')\r\n $item_cost = (int)20;\r\nif ($item == 'Raven')\r\n $item_cost = (int)15;\r\nif ($item == 'PrimalNether')\r\n $item_cost = (int)5;\r\nif ($item == 'NetherVortex')\r\n $item_cost = (int)8;\r\nif ($item == 'AVMark')\r\n $item_cost = (int)5;\r\nif ($item == 'MercilessD')\r\n $item_cost = (int)25;\r\nif ($item == 'Murloc')\r\n $item_cost = (int)5;\r\nif ($item == 'Tiger60')\r\n $item_cost = (int)20;\r\nif ($item == 'Tiger30')\r\n $item_cost = (int)15;\r\nif ($item == 'Ogre')\r\n $item_cost = (int)5;\r\nif ($item == 'BattleBear')\r\n $item_cost = (int)15;\r\nif ($item == 'FlyingBroom')\r\n $item_cost = (int)20;\r\nif ($item == 'XRocket')\r\n $item_cost = (int)25;\r\n\r\nreturn $item_cost;\r\n}", "public function getCost();", "public function getItemCost()\n {\n return $this->itemCost;\n }", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "function sellItem($store_id, $journey_id, $character_id, $player_id, $item_id) {\n\t\t\n\t\taddToDebugLog(\"sellItem(), Function Entry - Store ID: \" . $store_id . \", Journey ID: \" . $journey_id . \"; Character ID: \" . $character_id . \"; Player ID: \" . $player_id . \"; Item ID: \" . $item_id . \", INFO\");\n\t\t\n\t\t// Get item details from the character\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE equipment_id = \" . $item_id . \";\";\n\t\taddToDebugLog(\"sellItem(), Constructed query: \" . $sql . \", INFO\");\n\t\t$result = search($sql);\n\t\t$name = $result[0][1];\n\t\t$ac_boost = $result[0][2];\n\t\t$attack_boost = $result[0][3];\n\t\t$weight = $result[0][4];\n\t\t$slot = $result[0][5];\n\t\tif (substr($result[0][5], 0, 6) == 'potion') {\n\t\t\t$name_elements = explode(' ', $name);\n\t\t\t$final_name = $name_elements[0];\n\t\t\t$cost = 100 * $name_elements[3];\n\t\t} elseif (substr($result[0][5], 0, 3) == 'pet') {\n\t\t\t$name_elements = explode(',', $name);\n\t\t\t$final_name = $name_elements[0];\n\t\t\t$cost = ($name_elements[1] * 500) + 5000;\n\t\t} else {\n\t\t\t$cost = 50 * ($ac_boost + $attack_boost);\n\t\t\t$final_name = $name;\n\t\t}\n\t\t\n\t\t// Add value to player gold\n\t\t$dml = \"UPDATE hackcess.character_details SET gold = gold + \" . $cost . \" WHERE character_id = \" . $character_id . \";\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"sellItem(), Character record updated, INFO\");\n\t\t} else {\n\t\t\taddToDebugLog(\"sellItem(), Character record not updated, ERROR\");\n\t\t}\t\t\n\t\t\n\t\t// Add item to store\n\t\t$dml = \"INSERT INTO hackcess.store_contents (store_id, item_name, item_ac_boost, item_attack_boost, item_weight, item_slot, item_cost) VALUES (\" . $store_id . \", '\" . $final_name . \"', \" . $ac_boost . \", \" . $attack_boost . \", \" . $weight . \", '\" . $slot . \"', \" . $cost . \");\";\n\t\t$result = insert($dml);\t\t\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"sellItem(), Item added to store, INFO\");\n\n\t\t\t// Determine pet id\n\t\t\t$sql = \"SELECT pet_id FROM hackcess.pets WHERE pet_name = '\" . $name_elements[0] . \"';\";\n\t\t\t$result = search($sql);\n\t\t\t$pet_id = $result[0][0];\n\t\t\t\t\n\t\t\t// Unassign pet from character\n\t\t\t$dml = \"UPDATE hackcess.pets SET character_id = 0 WHERE pet_id = \" . $pet_id . \";\";\n\t\t\t$result = insert($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t\t}\n\t\t\t\n\t\t\t// Remove item from store\n\t\t\t$dml = \"DELETE FROM hackcess.character_equipment WHERE equipment_id = \" . $item_id . \";\";\n\t\t\t$result = delete($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"sellItem(), Item deleted from character equipment, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"sellItem(), Item not deleted from character equipment, ERROR\");\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\taddToDebugLog(\"sellItem(), Item not added to store, ERROR\");\n\t\t}\n\t\t\n\t\toutputDebugLog();\n\t\t\n\t\t// Redirect back to store page\n\t\techo \"<script>window.location.href = 'store.php?player_id=\" . $player_id . \"&character_id=\" . $character_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"'</script>\";\n\t\t\n\t}", "function buyItem($store_id, $journey_id, $character_id, $player_id, $item_id) {\n\t\n\t\taddToDebugLog(\"buyItem(), Function Entry - Store ID: \" . $store_id . \", Journey ID: \" . $journey_id . \"; Character ID: \" . $character_id . \"; Player ID: \" . $player_id . \"; Item ID: \" . $item_id . \", INFO\");\n\t\n\t\t// Get item details from the store\n\t\t$sql = \"SELECT * FROM hackcess.store_contents WHERE contents_id = \" . $item_id . \";\";\n\t\t$result = search($sql);\n\t\t$name = $result[0][2];\n\t\t$final_name = $result[0][2]; \n\t\t$ac_boost = $result[0][3];\n\t\t$atk_boost = $result[0][4];\n\t\t$weight = $result[0][5];\n\t\t$slot = $result[0][6];\n\t\t$cost = $result[0][7];\n\t\n\t\t// Remove gold from player\n\t\t$dml = \"UPDATE hackcess.character_details SET gold = gold - \" . $cost . \" WHERE character_id = \" . $character_id . \";\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t} else {\n\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t}\n\t\t\n\t\t// If the item is a pet, determine the Level and attach to the name\n\t\tif (substr($slot, 0, 3) == \"pet\") {\n\t\t\t$level = ($cost - 5000) / 500;\n\t\t\t$final_name = $name . \",\" . $level;\n\t\t}\n\t\n\t\t// Add item to player equipment\n\t\t$dml = \"INSERT INTO hackcess.character_equipment (name, ac_boost, attack_boost, weight, slot, character_id) VALUES ('\" . $final_name . \"', \" . $ac_boost . \", \" . $atk_boost . \", \" . $weight . \", '\" . $slot . \"', \" . $character_id . \");\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"buyItem(), Item added to player inventory, INFO\");\n\t\t\t\n\t\t\t// Determine pet id\n\t\t\t$sql = \"SELECT pet_id FROM hackcess.pets WHERE pet_name LIKE '\" . $name . \"%';\";\n\t\t\t$result = search($sql);\n\t\t\t$pet_id = $result[0][0]; \n\t\t\t\n\t\t\t// Assign pet to character\n\t\t\t$dml = \"UPDATE hackcess.pets SET character_id = \" . $character_id . \" WHERE pet_id = \" . $pet_id . \";\";\n\t\t\t$result = insert($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t\t}\t\t\t\n\t\t\t\t\n\t\t\t// Remove item from store\n\t\t\t$dml = \"DELETE FROM hackcess.store_contents WHERE contents_id = \" . $item_id . \";\";\n\t\t\t$result = delete($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Item deleted from store, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Item not deleted from store, ERROR\");\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\taddToDebugLog(\"buyItem(), Item not added to player inventory, ERROR\");\n\t\t}\n\t\n\t\toutputDebugLog();\n\t\t\n\t\t// Redirect back to store page\n\t\techo \"<script>window.location.href = 'store.php?player_id=\" . $player_id . \"&character_id=\" . $character_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"'</script>\";\n\t\n\t}", "function characterEquipment($character_id, $player_id, $journey_id, $store_id) {\n\t\n\t\taddToDebugLog(\"characterEquipment(), Function Entry - supplied parameters: Player ID: \" . $player_id . \"; Journey ID: \" . $journey_id . \"; Character ID: \" . $charcter_id . \"; Store ID: \" . $store_id . \", INFO\");\n\t\t\n\t\t// Get Character Name\n\t\t$character_name = getCharacterDetails($character_id, 'character_name');\n\t\n\t\techo \"<table cellpadding=3 cellspacing=0 border=1>\";\n\t\techo \"<tr><td colspan=5 align=center><h2>\" . $character_name . \"</h2></tr>\";\n\t\techo \"<tr bgcolor=#bbb><td>Item<td align=center>Weight<td align=center>Value<td align=center>Actions</tr>\";\n\t\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot NOT LIKE 'potion%' AND slot NOT LIKE 'pet%' ORDER BY slot ASC, ac_boost, attack_boost DESC;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\n\t\t// 0: ID\n\t\t// 1: Name\n\t\t// 2: AC Boost\n\t\t// 3: ATK Boost\n\t\t// 4: Weight\n\t\t// 5: Slot\n\t\n\t\t$weight_total = 0;\n\t\t$current_slot = \"\";\n\t\tfor ($e = 0; $e < $rows; $e++) {\n\t\n\t\t\tif ($result[$e][5] != $current_slot) {\n\t\t\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>\" . ucfirst($result[$e][5]) . \"</tr>\";\n\t\t\t\t$current_slot = $result[$e][5];\n\t\t\t}\n\t\n\t\t\t$bonus = $result[$e][2] + $result[$e][3];\n\t\t\techo \"<tr><td>+\" . $bonus . \" \" . $result[$e][1]; // Bonus + Item\n\t\t\techo \"<td align=center>\" . $result[$e][4]; // Weight\n\t\t\t\n\t\t\t//Value\n\t\t\t$value = $bonus * 50;\n\t\t\techo \"<td align=center>\" . $value;\n\t\n\t\t\t// Determine if the item of equipment is equipped or not\n\t\t\t$is_equipped = isEquipped($result[$e][5], $result[$e][0], $character_id);\n\t\t\t$weight_total = $weight_total + $result[$e][4];\n\t\t\tif ($is_equipped == 1) {\n\t\t\t\techo \"<td align=center bgcolor=#6f3>Equipped\";\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"<td align=center>\";\n\t\t\t\techo \"<a href='store.php?slot=\" . $result[$e][5] . \"&item_id=\" . $result[$e][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\t\techo \" | <a href='store.php?slot=\" . $result[$e][5] . \"&item_id=\" . $result[$e][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=equip&slot=\" . $result[$e][5] . \"'>Equip</a>\";\n\t\t\t}\n\t\t\t\t\n\t\t\techo \"</tr>\";\n\t\t\t\t\n\t\t}\n\t\n\t\t// Display Character potions\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot LIKE 'potion%' ORDER BY ac_boost, attack_boost DESC;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\t\n\n\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>Potions</tr>\";\n\t\t\n\t\tfor ($p = 0; $p < $rows; $p++) {\n\t\t\t\n\t\t\techo \"<tr><td>\" . $result[$p][1]; // Item\n\t\t\techo \"<td align=center>-\"; // Weight\n\t\t\t\t\n\t\t\t//Value\n\t\t\t$potion_name = explode(' ', $result[$p][1]);\n\t\t\t$value = $potion_name[3] * 100;\n\t\t\techo \"<td align=center>\" . $value;\n\t\t\t\n\t\t\t// Write actions Sell\n\t\t\techo \"<td align=center>\";\n\t\t\techo \"<a href='store.php?slot=\" . $result[$p][5] . \"&item_id=\" . $result[$p][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\techo \"</tr>\";\t\t\t\n\t\t\t\n\t\t}\n\n\t\t// Display Character pets\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot LIKE 'pet%';\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\t\n\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>Pets</tr>\";\n\t\t\n\t\tfor ($p = 0; $p < $rows; $p++) {\n\t\t\t\t\n\t\t\t$details = explode(',', $result[$p][1]);\n\t\t\t$type = substr($result[$p][5], 4);\n\t\t\t\n\t\t\techo \"<tr><td>\" . $details[0] . \", Lvl \" . $details[1] . \" \" . ucfirst($type); // Item\n\t\t\techo \"<td align=center>-\"; // Weight\n\t\t\n\t\t\t//Value\n\t\t\t$value = ($details[1] * 500) + 5000;\n\t\t\techo \"<td align=center>\" . $value;\n\t\t\t\t\n\t\t\t// Write actions Sell\n\t\t\techo \"<td align=center>\";\n\t\t\techo \"<a href='store.php?slot=\" . $result[$p][5] . \"&item_id=\" . $result[$p][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\techo \"</tr>\";\n\t\t\t\t\n\t\t}\n\t\t\n\t\t// Get character strength\t\t\n\t\t$character_strength = getCharacterDetailsInfo($character_id, 'strength');\n\t\t$effects = getEffectBoosts($character_id);\n\t\t$traits = getTraitBoosts($character_id);\n\t\t$total_strength = $character_strength + $effects[\"str\"] + $traits[\"str\"];\n\t\t\n\t\techo \"<tr><td align=right>Total Weight<td align=center>\" . $weight_total;\n\t\techo \"<td align=center>\" . $total_strength . \"<td align=left>Strength</tr>\";\n\t\t\n\t\t// Character Gold\n\t\t$character_gold = getCharacterDetailsInfo($character_id,'gold');\n\t\techo \"<tr><td align=right colspan=2>Character Gold<td align=center>\" . $character_gold . \"<td></tr>\";\n\t\t\n\t\techo \"</table>\";\n\t \n\t}", "function calculatePrice( &$item ) {\r\n\t\r\n\tglobal $db, $site;\r\n\t\r\n\t$resultPrice = $basePrice = $item['price'];\r\n\t\r\n\t$pricing = $db->getAll( 'select * from '. ATTRPRICING_TABLE.\" where product_id='$item[id]' and site_key='$site'\" );\r\n\t\r\n\tforeach ( $pricing as $pidx=>$price ) {\r\n\t\t\r\n\t\t$match = true;\r\n\t\t\r\n\t\tif ( $item['attributes'] )\r\n\t\tforeach( $item['attributes'] as $attr_id=>$attr ) {\r\n\t\t\t\r\n\t\t\t$values = $db->getRow( 'select value1, value2 from '. ATTRPRICEVALUES_TABLE.\" where price_id='$price[id]' and attr_id='$attr_id'\" );\r\n\t\t\t\r\n\t\t\tif ( !$values )\r\n\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t$value1 = $values['value1'];\r\n\t\t\t$value2 = $values['value2'];\r\n\t\t\t$value = $attr['value'];\r\n\t\t\r\n\t\t\tswitch( $attr['type'] ) {\r\n\t\t\t\tcase 'number':\r\n/*\t\t\t\t\tif ( strlen( $value1 ) )\r\n\t\t\t\t\t\t$match &= $value >= $value1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ( strlen( $value2 ) )\r\n\t\t\t\t\t\t$match &= $value <= $value2;\r\n\t\t\t\t\tbreak;\r\n*/\t\t\t\t\t\r\n\t\t\t\tcase 'single-text':\r\n\t\t\t\tcase 'multi-text':\r\n\t\t\t\tcase 'date':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$match &= $value == $value1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $match ) {\r\n\t\t\t$resultPrice = getPriceValue( $price, $basePrice );\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $resultPrice;\r\n\t\r\n}", "function calculateBudget($ProjectID){\n\t$strLength = strlen($ProjectID) - 3;\n\t$ProjectIDsuff = substr($ProjectID , 3 ,$strLength);\n\t\n\t$conn = connectDB();\n\t\n\t//calculate total item cost for whole project.\n\t$totalItemSum = 0;\n\t\n\t$sql = \"SELECT TaskIDsuff FROM ProjectToConstruction \" . \n\t\t\t\t\"WHERE ProjectIDsuff = '\" . $ProjectIDsuff . \"';\";\n\tmysqli_query($conn, $sql);\n\t$result = $conn->query($sql);\n\t\n\twhile($get_TaskID = $result->fetch_array(MYSQLI_ASSOC)){\n\t\t\t$TaskIDsuff = $get_TaskID[\"TaskIDsuff\"];\n\t\t\t\n\t\t\t$sqlInner = \"SELECT ItemIDsuff, Quantity FROM QtyForItems \" . \n\t\t\t\t\t\t\t\"WHERE TaskIDsuff = '\" . $TaskIDsuff . \"';\";\n\t\t\tmysqli_query($conn, $sqlInner);\n\t\t\t$resultInner = $conn->query($sqlInner);\n\t\t\t\n\t\t\twhile($get_ItemID_Qty = $resultInner->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t$ItemIDsuff = $get_ItemID_Qty[\"ItemIDsuff\"];\n\t\t\t\t$Quantity = $get_ItemID_Qty[\"Quantity\"];\n\t\t\t\t\n\t\t\t\t$sqlInnerInner = \"SELECT ItemName, Supplier FROM Item \" . \n\t\t\t\t\t\t\t\t\t\"WHERE ItemIDsuff = '\" . $ItemIDsuff . \"';\";\n\t\t\t\tmysqli_query($conn, $sqlInnerInner);\n\t\t\t\t$resultInnerInner = $conn->query($sqlInnerInner);\n\t\t\t\t\n\t\t\t\t$get_ItemName_Supl = $resultInnerInner->fetch_array(MYSQLI_ASSOC);\n\t\t\t\t$ItemName = $get_ItemName_Supl[\"ItemName\"];\n\t\t\t\t$Supplier = $get_ItemName_Supl[\"Supplier\"];\n\t\t\t\t\t\n\t\t\t\t$sqlInnerInner = \"SELECT CostInDollars FROM ItemCost \" . \n\t\t\t\t\t\t\t\t\t\"WHERE ItemName = '\" . $ItemName . \"'\" . \n\t\t\t\t\t\t\t\t\t\"AND Supplier = '\" . $Supplier . \"';\";\n\t\t\t\tmysqli_query($conn, $sqlInnerInner);\n\t\t\t\t$resultInnerInner = $conn->query($sqlInnerInner);\n\t\t\t\t\n\t\t\t\t$get_CostInDollars = $resultInnerInner->fetch_array(MYSQLI_ASSOC);\n\t\t\t\t$CostInDollars = $get_CostInDollars[\"CostInDollars\"];\n\t\t\t\t\n\t\t\t\t$totalItemSum = $totalItemSum + ($CostInDollars * $Quantity);\n\t\t\t}\n\t}\n\t\n\t\n\t\n\t//calculate labour cost for all tasks\n\t$totalLabourSum = 0;\n\t\n\t$sql = \"SELECT TaskIDsuff FROM ProjectToConstruction \" . \n\t\t\t\"WHERE ProjectIDsuff = \" . $ProjectIDsuff . \";\";\n\tmysqli_query($conn, $sql);\n\t$result = $conn->query($sql);\n\t\n\twhile($get_TaskID = $result->fetch_array(MYSQLI_ASSOC)){\n\t\t\n\t\t$TaskIDsuff = $get_TaskID[\"TaskIDsuff\"];\n\t\t\n\t\t$sqlInner = \"SELECT CostPerHrs, TimeInHrs FROM Construction \" . \n\t\t\t\t\t\"WHERE TaskIDsuff = \" . $TaskIDsuff . \";\";\n\t\tmysqli_query($conn, $sqlInner);\n\t\t$result = $conn->query($sqlInner);\n\t\t\n\t\t$get_Cost_Time = $result->fetch_array(MYSQLI_ASSOC);\n\t\t$CostPerHrs = $get_Cost_Time[\"CostPerHrs\"];\n\t\t$TimeInHrs = $get_Cost_Time[\"TimeInHrs\"];\n\t\t\n\t\t$totalLabourSum = $totalLabourSum + ($CostPerHrs * $TimeInHrs);\n\t\t\n\t}\n\t\n\t\n\t//PermitCost\n\t$sql = \"SELECT PermitCost, Estimated FROM Project WHERE ProjectIDsuff = '\" . $ProjectIDsuff . \"'\";\n\tmysqli_query($conn, $sql);\n\t$result = $conn->query($sql);\n\t$thePertmitCost = $result->fetch_array(MYSQLI_ASSOC);\n\t$Estimated = $thePertmitCost[\"Estimated\"];\n\n\t$totalBudget = (int)$thePertmitCost[\"PermitCost\"] + (int)$totalItemSum + (int)$totalLabourSum;\n\t\n\t//Estimated - ActualCost\n\t$estimSubBudget = $Estimated - $totalBudget;\n\t\n\techo \"<h4>Total Item Cost: \" . $totalItemSum . \"<h4>\";\n\techo \"<h4>Total Labour Cost: \" . $totalLabourSum . \"<h4>\";\n\techo \"<h4>Permit Cost: \" . $thePertmitCost[\"PermitCost\"] . \"<h4>\";\n\techo \"<h4>Project Total Cost: \" . $totalBudget . \"<h4>\";\n\techo \"<h4>Surplus/Under: \" . $estimSubBudget .\"</h4>\";\n\n\t$sql = \"UPDATE Project SET \" .\n\t \"Budget=\" . $estimSubBudget . \" WHERE \" .\n\t \"ProjectIDsuff=\" . $ProjectIDsuff . \";\";\n\tmysqli_query($conn, $sql);\n\t\n\tmysqli_close($conn);\n}", "public function refactorBasedonItems()\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n $this->cabItems += $wood['qty'];\n $this->instItems += $wood['qty'];\n }\n }\n }\n\n /*\n if ($this->cabItems < 30)\n {\n $this->cabItems = 30;\n }\n\n if ($this->instItems < 30 && $this->quote->type != 'Cabinet Small Job')\n {\n $this->instItems = 30;\n }\n\n\n if ($this->instItems > 35 && $this->instItems < 40)\n {\n $this->instItems = 40;\n }\n\n // Start Staging Price Blocks.\n if ($this->cabItems > 30 && $this->cabItems < 40)\n {\n $this->cabItems = 40;\n }\n */\n\n // For Designer\n if ($this->quote->type == 'Full Kitchen' || $this->quote->type == 'Cabinet and Install')\n {\n if ($this->cabItems <= 35)\n {\n $this->forDesigner = $this->getSetting('dL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forDesigner = $this->getSetting('dG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forDesigner = $this->getSetting('dG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forDesigner = $this->getSetting('dG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forDesigner = $this->getSetting('dG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forDesigner = $this->getSetting('dG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forDesigner = $this->getSetting('dG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forDesigner = $this->getSetting('dG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n }\n else\n {\n if ($this->quote->type == 'Cabinet Small Job' || $this->quote->type == 'Builder')\n {\n $this->forDesigner = 250;\n }\n }\n\n // ----------------------- Quote Type Specific values\n\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet Only')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if (!$cabinet->cabinet || !$cabinet->cabinet->vendor)\n {\n echo \\BS::alert(\"danger\", \"Unable To Determine Cabinets\",\n \"Cabinet type has not been selected! Unable to figure multiplier.\");\n return;\n }\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n $amt = ($cabinet->measure) ? 500 : 250;\n $this->forDesigner += $amt;\n $this->setDebug(\"Field Measure for Designer (Y=500/N=250)\", $amt);\n $this->forFrugal += 250; // for cabinet buildup.\n $this->setDebug(\"Frugal got $250 for Buildup\", 250);\n switch ($cabinet->location)\n {\n case 'North':\n $this->forFrugal += 300;\n $this->setDebug(\"Delivery North\", 300);\n break;\n case 'South':\n $this->forFrugal += 200;\n $this->setDebug(\"Delivery South\", 200);\n break;\n default:\n $this->forFrugal += 500;\n $this->setDebug(\"Further than 50m\", 500);\n break;\n }\n } // fe\n }\n else\n {\n if ($this->quote->type == 'Granite Only')\n {\n $this->forInstaller = 0;\n $this->forPlumber = 350;\n $this->forElectrician = 0;\n //$this->appElectrician = 0 ;\n //$this->forDesigner = 0;\n }\n else\n {\n if ($this->quote->type == \"Cabinet and Install\" || $this->quote->type == 'Builder')\n {\n if ($this->quote->type == 'Cabinet and Install')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n }\n\n $this->forInstaller += $this->instItems * 20; // get 20 per installable item not attach\n $this->forFrugal += 250; // For delivery\n $this->forFrugal += 250; // for cabinet buildup.\n $this->forFrugal += $this->instItems * 10; // Cabinet + Install gets $10 for frugal.\n $this->forFrugal += $this->attCount * 30; // Attachment Count.\n } // If it's cabinet install\n else\n {\n if ($this->instItems < 40)\n {\n $this->forInstaller += 500;\n }\n else\n {\n $remainder = $this->instItems - 40;\n $this->forInstaller += 500;\n $this->forInstaller += $remainder * 10;\n } // more than 40\n } // If builder\n } // if cabinet and install or builder\n else\n {\n if ($this->cabItems <= 35)\n {\n $this->forFrugal += $this->getSetting('fL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forFrugal += $this->getSetting('fG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forFrugal += $this->getSetting('fG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forFrugal += $this->getSetting('fG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forFrugal += $this->getSetting('fG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forFrugal += $this->getSetting('fG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forFrugal += $this->getSetting('fG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forFrugal += $this->getSetting('fG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n $this->forFrugal += ($this->attCount * 20);\n $this->setDebug(\"Frugal gets Attachment count * 20\", $this->attCount * 20);\n $this->forInstaller += ($this->instItems * 20);\n $this->setDebug(\"Installer gets Cabinet Installable ($this->instItems * 20)\",\n $this->instItems * 20);\n }\n }\n }\n\n $this->forElectrician += $this->appElectrician;\n $this->forPlumber += $this->appPlumber;\n $this->forInstaller += $this->accInstaller;\n $this->forFrugal += $this->accFrugal;\n // Additional - LED Lighting let's add this.\n $this->forDesigner += $this->designerLED;\n $this->forFrugal += $this->frugalLED;\n $this->forElectrician += $this->electricianLED;\n\n // No electrician or plumber if cabinet + install\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet and Install' || $this->quote->type == 'Cabinet Only')\n {\n $this->forPlumber = 0;\n $this->forElectrician = 0;\n }\n if ($this->quote->type == 'Cabinet Only')\n {\n $this->forInstaller = 0;\n }\n\n if ($this->quote->type == 'Granite Only')\n {\n $this->forElectrician = 0;\n }\n /*\n if ($this->quote->type == 'Cabinet Small Job')\n {\n if (!isset($this->gPrice))\n {\n $this->gPrice = 0;\n }\n\n $gMarkup = $this->gPrice * .2;\n $this->forFrugal += $gMarkup;\n\n $this->setDebug(\"Small Job Marks up Granite 20%\", $gMarkup);\n $sTotal = 0;\n if (isset($this->meta['sinks']))\n {\n foreach ($this->meta['sinks'] AS $sink)\n {\n if (!$sink)\n {\n continue;\n }\n $sink = Sink::find($sink);\n $sTotal += $sink->price;\n }\n $sMarkup = $sTotal * .2;\n $this->setDebug(\"Small Job Marks up Sink Costs 20%\", $sMarkup);\n $this->forFrugal += $sMarkup;\n }\n }\n */\n if ($this->quote->type == 'Cabinet Small Job')\n {\n $markup = $this->total * .4;\n $this->setDebug(\"Applying 40% Markup to Frugal for Cabinet Small Job\", $markup);\n $this->forFrugal = $markup;\n }\n\n // Add for installer to total\n $this->total += $this->forInstaller;\n $this->setDebug(\"Applying Installer Payouts to Quote\", $this->forInstaller);\n $this->total += $this->forElectrician;\n $this->setDebug(\"Applying Electrician Payouts to Quote\", $this->forElectrician);\n $this->total += $this->forPlumber;\n $this->setDebug(\"Applying Plumber Payouts to Quote\", $this->forPlumber);\n if ($this->quote->type != 'Builder')\n {\n $this->total += $this->forFrugal;\n $this->setDebug(\"Applying Frugal Payouts to Quote\", $this->forFrugal);\n }\n $this->total += $this->forDesigner;\n $this->setDebug(\"Applying Designer Payouts to Quote\", $this->forDesigner);\n if ($this->quote->type == 'Builder')\n {\n if ($this->quote->markup == 0)\n {\n $this->quote->markup = 30;\n $this->quote->save();\n }\n\n $perc = $this->quote->markup / 100;\n $markup = $this->total * $perc;\n $this->total += $markup;\n $this->setDebug(\"Applying {$this->quote->markup}% to Total For Builder Markup\", $markup);\n $this->forFrugal = $markup;\n }\n\n }", "public function getGoods($double_RRs = false)\n{\n\n global $DEA, $rules, $racesNoApothecary, $lng;\n\n $rr_price = $DEA[$this->race]['other']['rr_cost'] * (($double_RRs) ? 2 : 1);\n $apoth = !in_array($this->race_id, $racesNoApothecary);\n\n return array(\n // MySQL column names as keys\n 'apothecary' => array('cost' => $rules['cost_apothecary'], 'max' => ($apoth ? 1 : 0), 'item' => $lng->GetTrn('common/apothecary')),\n 'rerolls' => array('cost' => $rr_price, 'max' => $rules['max_rerolls'], 'item' => $lng->GetTrn('common/reroll')),\n 'ff_bought' => array('cost' => $rules['cost_fan_factor'], 'max' => $rules['max_fan_factor'], 'item' => $lng->GetTrn('matches/report/ff')),\n 'ass_coaches' => array('cost' => $rules['cost_ass_coaches'], 'max' => $rules['max_ass_coaches'], 'item' => $lng->GetTrn('common/ass_coach')),\n 'cheerleaders' => array('cost' => $rules['cost_cheerleaders'], 'max' => $rules['max_cheerleaders'], 'item' => $lng->GetTrn('common/cheerleader')),\n );\n}", "function get_item($item_id)\n\t{\n\t\tglobal $conn;\n\n\t\t$query=\"SELECT * FROM list_items WHERE item_id='$item_id' \";\n\t\t$result=mysqli_query($conn,$query);\n\n\t\t$item_data=\"\";\n\t\t\n\t\twhile($row = mysqli_fetch_array( $result))\n\t\t{\n\t\t\t$daily_price=$row['daily_rate'];\n\t\t\t$weekly_price=$row['weekly_rate'];\n\t\t\t$weekend_price=$row['weekend_rate'];\n\t\t\t$monthly_price=$row['monthly_rate'];\n\t\t\t$bond_price=$row['bond_rate'];\n\n\t\t\tif($daily_price=='0.00'){$daily_price=\"NA\";}\n\t\t\tif($weekly_price=='0.00'){$weekly_price=\"NA\";}\n\t\t\tif($weekend_price=='0.00'){$weekend_price=\"NA\";}\n\t\t\tif($monthly_price=='0.00'){$monthly_price=\"NA\";}\n\t\t\tif($bond_price=='0.00'){$bond_price=\"NA\";}\n\n\t\t\t$extra=array(\n\t\t\t\t'item_id'\t=>\t$row['item_id'],\n\t\t\t\t'item_pictures'\t=>\t$row['item_pictures'],\n\t\t\t\t'item_description'\t=>\t$row['item_description'],\n\t\t\t\t'item_name'\t=>\t$row['item_name'],\n\t\t\t\t'extra_option'\t=>\t$row['extra_option'],\t\t\t\t\n\t\t\t\t'user_id'\t=>\t$row['user_id'],\t\t\t\t\n\t\t\t\t'total_views'\t=>\t$row['total_views'],\t\t\t\t\n\t\t\t\t'cat_name'\t=>\t$row['cat_name'],\n\t\t\t\t'isLive'\t=>\t$row['isLive'],\n\t\t\t\t'user_name'\t=>\t$row['user_name'],\n\t\t\t\t'daily_rate'\t=>\t$daily_price,\n\t\t\t\t'weekly_rate'\t=>\t$weekly_price,\n\t\t\t\t'weekend_rate'\t=>\t$weekend_price,\n\t\t\t\t'monthly_rate'\t=>\t$monthly_price,\n\t\t\t\t'bond_rate'\t=>\t$bond_price\n\t\t\t);\n\t\t\t$item_data[]=$extra;\n\n\t\t}\n\n\t\tif(mysqli_query($conn, $query)){\n\t\t\t$response=array(\n\t\t\t\t'status' => 1,\n\t\t\t\t'items' => $item_data\t\t\t\t\t\t\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insertion failure\n\t\t\t$response=array(\n\t\t\t\t'status' => 0,\n\t\t\t\t'status_message' =>'Item Details not found!!!'\t\t\t\n\t\t\t);\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($response);\n\t}", "public function get_services_cost(){\n //find all the requested services on a deadbody\n $sql = \"SELECT * FROM requested_service WHERE dead_no={$this->id}\";\n $this->requested_services = RequestedService::find_by_sql($sql);\n $total_debit = 0;\n //for each requested service find price and add to total debit\n foreach ($this->requested_services as $requested_service) {\n $service = Service::find_by_id($requested_service->service_no);\n $total_debit += $service->price;\n }\n return $total_debit;\n }", "function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}", "public function getTotalEstimated() {\n\t\t$total = 0;\n\t\t$this->costitem->get();\n\t\tforeach($this->costitem->all as $item) {\n\t\t\tif ($item->item_type == 'price') {\n\t\t\t\t$total += $item->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t\t\n\t}", "public function get_info($item_id, $amt)\n\t{\n\t\t$taxtype = $this->session->userdata('taxtype');\n\t\t$category = $this->Item->get_info($item_id)->category;\n\t\t\n\t\t$main_array = [\"MEN'S CLOTHING\", \"WOMEN'S CLOTHING\", \"KID'S CLOTHING\", \"MEN'S FOOTWEAR\", \"WOMEN'S FOOTWEAR\", \"KID'S FOOTWEAR\"];\n\t\t$clothes_array = [\"MEN'S CLOTHING\", \"WOMEN'S CLOTHING\", \"KID'S CLOTHING\"];\n\t\t$footwear_array = [\"MEN'S FOOTWEAR\", \"WOMEN'S FOOTWEAR\", \"KID'S FOOTWEAR\"];\n\n\t\tif(in_array($category, $main_array))\n\t\t{\n\t\t\tif(in_array($category, $clothes_array)) //CLOTHES\n\t\t\t{\n\t\t\t\tif($taxtype) //IGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_igst_array($item_id, 12) : $this->create_igst_array($item_id, 5);\n\t\t\t\t}\n\t\t\t\telse //CSGT+SGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_array($item_id, 6) : $this->create_array($item_id, 2.5);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(in_array($category, $footwear_array)) //FOOTWEARS\n\t\t\t{\n\t\t\t\tif($taxtype) //IGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_igst_array($item_id, 18) : $this->create_igst_array($item_id, 5);\n\t\t\t\t}\n\t\t\t\telse //CSGT+SGST\n\t\t\t\t{\n\t\t\t\t\treturn ($amt > 1000) ? $this->create_array($item_id, 9) : $this->create_array($item_id, 2.5);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->from('items_taxes');\n\t\t\t$this->db->where('item_id',$item_id);\n\t\t\tif($taxtype)\n\t\t\t{\n\t\t\t\t$array = array('IGST');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array = array('SGST', 'CGST');\n\t\t\t}\n\t\t\t$this->db->where_in('name', $array);\n\n\t\t\t//return an array of taxes for an item\n\t\t\treturn $this->db->get()->result_array();\n\t\t}\n\t}", "public function get_shipcost_details($dom, $sku, $item_id){\t\n\t\t\t//push each entry into new array\n\t\t\t$update_item_array = array();\n\n\t\t\t$update_item_response = $dom->getElementsByTagName(DOM_ELEMENT_SHIPCOST_RESPONSE);\n\n\t\t\tforeach ($update_item_response as $item){\n\t\t\t\t//ad sku to first entry of array\n\t\t\t\tarray_push($update_item_array, $sku);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tarray_push($update_item_array, $item_id);\n\n\t\t\t\t$costs = $item->getElementsByTagName(DOM_ELEMENT_SHIP_DETAILS);\n\t\t\t\t\n\t\t\t\tforeach ($costs as $costsmsg){\n\t\t\t\t\t\n\t\t\t\t\t$serv_opts = $costsmsg->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_OPTIONS);\n\t\t\t\t\tforeach($serv_opts as $serv){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$costers = trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) != \"\" ? trim($serv->getElementsByTagName(DOM_ELEMENT_SHIP_SERVICE_CST)->item(0)->nodeValue) : \"No Cost Entered - Error\";\n\t\t\t\t\t\tarray_push($update_item_array, $costers);\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\n\n\t\t\t\t//errors\n\t\t\t\t$error_messages = $item->getElementsByTagName(DOM_ELEMENT_ERRORS);\n\n\t\t\t\tforeach ($error_messages as $errormsg){\n\t\t\t\t\t$error = trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) != \"\" ? trim($errormsg->getElementsByTagName(DOM_ELEMENT_SHORT_ERROR_MSG)->item(0)->nodeValue) : \"No Error\";\n\t\t\t\t\tarray_push($update_item_array, $error);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\treturn $update_item_array;\n\n\t\t//DOM_ELEMENT_SHORT_ERROR_MSG\n\t\t}", "function purchaseItem($idItem, $unitCost, $amount, $week){ //Seems to be no add() so maybe pull the new amount from the website or call an updateItemAmount()\n global $db;\n \n $money = $amount * $unitCost;\n $stmt=$db->prepare(\"INSERT INTO purchases (week, idItem, amount, money) VALUES (:week, :idItem, :amount, :money)\");\n \n $binds= array (\n \":week\" => $week,\n \":idItem\" => $idItem,\n \":amount\" => $amount,\n \":money\" => $money\n );\n \n if($stmt->execute($binds) && $stmt->rowCount()>0){\n //Runs functions to keep the other dataTables working\n addExpense($week, $money);\n $invAmount = getAmount($idItem);\n $netAmount = $invAmount['amount'] + $amount;\n return updateItemAmount($idItem, $netAmount);//returns true if successful\n \n }\n else{\n return false;\n }\n }", "private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }", "public function getShippingCost();", "function calculate_delivery_cost($volume,$location_distance,$quantity){\n $total_volume = $volume * $quantity;\n // assume that the volume of space available in a motocycle is 500\n $motocycle_vol = 500;\n // assume that the volume of space available in a motocycle is 1000\n $cab_volume = 1000;\n if($total_volume <= $motocycle_vol){\n $means = 1; // 1 for motocycle ans 2 for cab\n }elseif ($total_volume <= $cab_volume && $total_volume > $motocycle_vol){\n $means = 2;\n }\n $cost_per_dist = ($means == 1)? 100 : 70;\n $total_cost = $cost_per_dist * $location_distance; // assume location distance is in km\n return $total_cost;\n}", "public function calItem($quantity,$item_price){\n $cal_price=$quantity*$item_price;\n return $cal_price;\n }", "function ciniki_sapos_itemCalcAmount($ciniki, $item) {\n\n if( !isset($item['quantity']) || !isset($item['unit_amount']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.30', 'msg'=>'Unable to calculate the item amount, missing quantity or unit amount'));\n }\n\n $unit_amount = $item['unit_amount'];\n //\n // Apply the dollar amount discount first\n //\n if( isset($item['unit_discount_amount']) && $item['unit_discount_amount'] > 0 ) {\n $unit_amount = bcsub($unit_amount, $item['unit_discount_amount'], 4);\n }\n //\n // Apply the percentage discount second\n //\n if( isset($item['unit_discount_percentage']) && $item['unit_discount_percentage'] > 0 ) {\n $percentage = bcdiv($item['unit_discount_percentage'], 100, 4);\n $unit_amount = bcsub($unit_amount, bcmul($unit_amount, $percentage, 4), 4);\n }\n\n //\n // Calculate what the amount should have been without discounts\n //\n $subtotal = bcmul($item['quantity'], $item['unit_amount'], 2);\n\n //\n // Apply the quantity\n //\n $total = bcmul($item['quantity'], $unit_amount, 2);\n\n //\n // Calculate the total discount on the item\n //\n $discount = bcsub(bcmul($item['quantity'], $item['unit_amount'], 2), $total, 2);\n\n //\n // Calculate the preorder_amount, after all discount calculations because this amount will be paid later\n //\n $preorder = 0;\n if( isset($item['unit_preorder_amount']) ) {\n $preorder = bcmul($item['quantity'], $item['unit_preorder_amount'], 2);\n if( $preorder > 0 ) {\n $total = bcsub($total, $preorder, 2);\n }\n }\n\n return array('stat'=>'ok', 'subtotal'=>$subtotal, 'preorder'=>$preorder, 'discount'=>$discount, 'total'=>$total);\n}", "function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }", "public function getCost()\n {\n return $this->get(self::_COST);\n }", "public function items($product, $protype='amount', $profit=0, $profit_child=0, $profit_baby=0)\n {\n if ($product['type'] != 2 || $product['payment'] != 'prepay') return $product;\n\n // type = 1 only hotel + auto product\n $sql = \"SELECT a.`id`, a.`name`, a.`objtype` AS `type`, a.`source`, a.`target`, a.`objpid`, a.`objid`, a.`ext`, a.`ext2`, a.`intro`, a.`childstd`, a.`babystd`, a.`default`,\n b.`profit` AS `profit`, b.`child` AS `profit_child`, b.`baby` AS `profit_baby`, b.`type` AS `protype`\n FROM `ptc_product_item` AS a\n LEFT JOIN `ptc_org_profit` AS b ON b.`org` = :org AND b.`payment` = 'prepay' AND b.`objtype` = 'item' AND b.`objid` = a.`id`\n WHERE a.`pid`=:pid\n ORDER BY a.`objtype` DESC, a.`seq` ASC;\";\n $db = db(config('db'));\n $items = $db -> prepare($sql) -> execute(array(':pid'=>$product['id'], ':org'=>api::$org));\n\n $hmax = $fmax = 0;\n $hmin = $fmin = 9999999;\n foreach ($items as $k => $v)\n {\n $sql = \"SELECT a.`id` AS `city`, a.`name` AS `cityname`, a.`pid` AS `country`, b.`name` AS `countryname`, a.`lng`, a.`lat`\n FROM `ptc_district` AS a\n LEFT JOIN `ptc_district` AS b ON a.pid = b.id\n WHERE a.`id`=:id\";\n\n if ($v['source'])\n {\n $source = $db -> prepare($sql) -> execute(array(':id' => $v['source']));\n $items[$k]['source'] = $source[0];\n }\n else\n {\n $items[$k]['source'] = null;\n }\n\n $target = $db -> prepare($sql) -> execute(array(':id' => $v['target']));\n $items[$k]['target'] = $target[0];\n\n if ($v['type'] == 'room')\n {\n $items[$k]['hotel'] = $v['objpid'];\n $items[$k]['room'] = $v['objid'];\n $items[$k]['night'] = $v['ext'];\n\n $sql = \"SELECT p.`key` AS `code`, p.`date`, p.`price`, p.`allot`-`sold` AS `allot`, p.`filled`, p.`standby`\n FROM `ptc_hotel_price_date` AS p\n WHERE p.`supply`='EBK' AND p.`supplyid`=:sup AND p.`hotel`=:hotel AND p.`room`=:room AND p.`close`=0\";\n $condition = array(':sup'=>$product['id'], ':hotel'=>$v['objpid'], ':room'=>$v['id']);\n\n $date = $db -> prepare($sql) -> execute($condition);\n }\n else\n {\n $items[$k]['auto'] = $v['objpid'];\n\n $sql = \"SELECT p.`key` AS `code`, p.`date`, p.`price`, p.`child`, p.`baby`, p.`allot`-p.`sold` AS `allot`, p.`filled`\n FROM `ptc_auto_price_date` AS p\n WHERE `auto`=:auto AND `close`=0\";\n $condition = array(':auto'=>$v['objpid']);\n\n $date = $db -> prepare($sql) -> execute($condition);\n }\n\n if ($v['protype'])\n {\n $_protype = $v['protype'];\n $_profit = $v['profit'];\n $_profit_child = $v['profit_child'];\n $_profit_baby = $v['profit_baby'];\n }\n else\n {\n $_protype = $protype;\n $_profit = $profit;\n $_profit_child = $profit_child;\n $_profit_baby = $profit_baby;\n }\n\n unset($items[$k]['protype'], $items[$k]['profit'], $items[$k]['profit_child'], $items[$k]['profit_baby']);\n\n $items[$k]['dates'] = array();\n foreach ($date as $d)\n {\n $d['code'] = key_encryption($d['code'].'_auto'.$product['id'].'.'.$v['id'].'_product2');\n $d['date'] = date('Y-m-d', $d['date']);\n $d['price'] = $d['price'] + round($_protype == 'amount' ? $_profit : ($d['price'] * $_profit / 100));\n $d['allot'] = $d['filled'] || $d['allot'] < 0 ? 0 : $d['allot'];\n if (isset($d['standby']))\n {\n $standby = json_decode($d['standby'], true);\n $d['child'] = $standby['child'] ? $standby['child'] + round($_protype == 'amount' ? $_profit_child : ($standby['child'] * $_profit_child / 100)) : 0;\n $d['baby'] = $standby['baby'] ? $standby['baby'] + round($_protype == 'amount' ? $_profit_baby : ($standby['baby'] * $_profit_baby / 100)) : 0;\n }\n else\n {\n $d['child'] = $d['child'] ? $d['child'] + round($_protype == 'amount' ? $_profit_child : ($d['child'] * $_profit_child / 100)) : 0;\n $d['baby'] = $d['baby'] ? $d['baby'] + round($_protype == 'amount' ? $_profit_baby : ($d['baby'] * $_profit_baby / 100)) : 0;\n }\n unset($d['uncombine'], $d['combine'], $d['standby']);\n $items[$k]['dates'][] = $d;\n\n if (!$d['allot']) continue;\n\n if ($v['type'] == 'room')\n {\n $hmin = $hmin > $d['price'] ? $d['price'] : $hmin;\n $hmax = $hmax < $d['price'] ? $d['price'] : $hmax;\n }\n else\n {\n $fmin = $fmin > $d['price'] ? $d['price'] : $fmin;\n $fmax = $fmax < $d['price'] ? $d['price'] : $fmax;\n }\n }\n }\n\n $product['maxprice'] = $hmax + $fmax;\n $product['minprice'] = $hmin + $fmin;\n $product['items'] = $items;\n return $product;\n }", "public function calculateQtyToShip();", "function getCost(){\n return $this->cost;\n }", "public function getTotalCost()\n {\n $this->loadItems();\n return $this->calculator->getCost($this->items);\n }", "public function getCost() {\n return 15 + $this->carService->getCost();\n }", "function getitem()\r\n{\r\n require_once(\"heading.php\");\r\n$item = $_POST[\"items\"];\r\n$player = $_POST[\"character\"];\r\n\r\n if ($item == \"error\")\r\n {\r\n $output .= \"<div class=\\\"top\\\"><h1>Wrong item selected!</h1></div><center>\"; \r\n }\r\n \r\n if (($player == \"Character Name\") || (trim($player) == \"\"))\r\n {\r\n $output .= \"<div class=\\\"top\\\"><h1>Please type valid character name!</h1></div><center>\";\r\n }\r\n else\r\n {\r\n mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n $total_points = mysql_fetch_row(mysql_query(\"SELECT `points` FROM point_system WHERE `accountid` = '$user_id';\"));\r\n $total_points = $total_points[0];\r\n if($total_points <= 0)\r\n $total_points = (int)0;\r\n $item_cost = getitemcost();\r\n $item_id = getitemid();\r\nif($total_points > ($item_cost-1))\r\n{\r\n require_once \"scripts/PHPTelnet.php\";\r\n $telnet = new PHPTelnet();\r\n $result = $telnet->Connect($server[$realm_id]['addr'],$server[$realm_id]['game_acc'],$server[$realm_id]['game_pass']);\r\n if ($result == 0)\r\n {\r\n mysql_query(\"UPDATE point_system SET `points` = `points` - $item_cost WHERE `accountid` = '$user_id';\");\r\n $telnet->DoCommand(\"senditems $player \\\"Credit item\\\" \\\"Thanks for your donation! your item is attached to this mail\\\" $item_id\");\r\n $telnet->Disconnect();\r\n \t mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', '$player', '$datetime', '$item', 'Yes');\");\r\n $output .= \"<div class=\\\"top\\\"><h1>$item has been sent to your mailbox $player</h1></div><center>\";\r\n }\r\n else\r\n {\r\n \t mysql_select_db($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass']) ;\r\n mysql_query(\"INSERT INTO point_system_requests (`username`, `request`, `date`, `code`, `treated`) VALUES ('$user_name', '$item Item Error', '$datetime', '$player', 'Yes');\");\r\n $output .= \"<div class=\\\"top\\\"><h1>$ren_char, There was a connection error, try again later!</h1></div>\";\r\n }\r\n }\r\nelse $output .= \"<div class=\\\"top\\\"><h1>$user_name, you do not have enough points to request a $item!</h1></div><center>\";\r\n}\r\n require_once(\"footer.php\");\r\n}", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}", "public function run()\n {\n $item = new Item();\n $item->name = \"1-3\";\n $item->tier5_cost = 525;\n $item->other_cost = 1050;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"4-9\";\n $item->tier5_cost = 1000;\n $item->other_cost = 2140;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"10+\";\n $item->tier5_cost = 1600;\n $item->other_cost = 3270;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"SOCIAL\";\n $item->tier5_cost = 550;\n $item->other_cost = 1150;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"EMAIL\";\n $item->tier5_cost = 1000;\n $item->other_cost = 2000;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1500;\n $item->other_cost = 3300;\n $item->step = 3;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 3;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 3;\n $item->save();\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1500;\n $item->other_cost = 3000;\n $item->step = 4;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 4;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 4;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1700;\n $item->other_cost = 3300;\n $item->step = 5;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 5;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 5;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1000;\n $item->other_cost = 2000;\n $item->step = 6;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 6;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 6;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 3500;\n $item->other_cost = 6367;\n $item->step = 7;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 7;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 7;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 5555;\n $item->other_cost = 10827;\n $item->step = 8;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 8;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 8;\n $item->save();\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 3247;\n $item->other_cost = 6494;\n $item->step = 9;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 9;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 9;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 6000;\n $item->other_cost = 12732;\n $item->step = 10;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 10;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 10;\n $item->save();\n }", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "public function cost()\n {\n return $this->beverage->cost() + $this->cost;\n }", "public function getUnitCostAttribute()\n {\n $item = ItemModel::where('id', $this->item_id)->first();\n if($item) {\n if($item->cost) {\n return $item->cost;\n } else {\n if(ProductEnglishValueModel::where('product_id', $item->product_id)->first()) {\n return ProductEnglishValueModel::where('product_id', $item->product_id)->first()->sale_usd_price;\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n }", "private function get_costing_finish_goods($costing_id){\n $costing = Costing::with(['style'])->find($costing_id);\n $product_feature = ProductFeature::find($costing->style->product_feature_id);\n $item = [];\n\n if($product_feature->count > 1){//has sfg items\n $list = DB::select(\"SELECT\n costing_sfg_item.costing_id,\n costing_fng_item.costing_fng_id,\n costing_fng_item.fng_id,\n item_master_fng.master_code AS fng_code,\n item_master_fng.master_description AS fng_description,\n org_color_fng.color_code AS fng_color_code,\n org_color_fng.color_name AS fng_color_name,\n costing_sfg_item.costing_sfg_id,\n costing_sfg_item.sfg_id,\n item_master_sfg.master_code AS sfg_code,\n item_master_sfg.master_description AS sfg_description,\n org_color_sfg.color_code AS sfg_color_code,\n org_color_sfg.color_name AS sfg_color_name,\n org_country.country_description\n FROM\n costing_sfg_item\n INNER JOIN costing_fng_item ON costing_fng_item.costing_fng_id = costing_sfg_item.costing_fng_id\n INNER JOIN item_master AS item_master_sfg ON item_master_sfg.master_id = costing_sfg_item.sfg_id\n INNER JOIN item_master AS item_master_fng ON item_master_fng.master_id = costing_fng_item.fng_id\n INNER JOIN org_country ON org_country.country_id = costing_sfg_item.country_id\n INNER JOIN org_color AS org_color_fng ON org_color_fng.color_id = costing_fng_item.fng_color_id\n INNEr JOIN org_color AS org_color_sfg ON org_color_sfg.color_id = costing_sfg_item.sfg_color_id\n WHERE costing_sfg_item.costing_id = ?\", [$costing_id]);\n }\n else {//no sfg items\n $list = DB::select(\"SELECT\n costing_fng_item.costing_id,\n costing_fng_item.costing_fng_id,\n costing_fng_item.fng_id,\n item_master.master_code AS fng_code,\n item_master.master_description AS fng_description,\n org_color.color_code AS fng_color_code,\n org_color.color_name AS fng_color_name,\n 0 AS costing_sfg_id,\n 0 AS sfg_id,\n '' AS sfg_code,\n '' AS sfg_description,\n '' AS sfg_color_code,\n '' AS sfg_color_name,\n org_country.country_description\n FROM\n costing_fng_item\n INNER JOIN item_master ON item_master.master_id = costing_fng_item.fng_id\n INNER JOIN org_country ON org_country.country_id = costing_fng_item.country_id\n INNER JOIN org_color ON org_color.color_id = costing_fng_item.fng_color_id\n WHERE costing_fng_item.costing_id = ?\", [$costing_id]);\n }\n\n return $list;\n }", "public function cost()\n {\n return $this->price;\n }", "public function cost()\n {\n return $this->getPrice();\n }", "function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}", "function getDataByID($strDataID)\n{\n global $db;\n $tbl = new cGaConsumablePurchase();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrTemp = getEmployeeInfoByID($db, $dataEdit[$strDataID]['id_employee'], \"employee_id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id_item'];\n $arrResult['dataRequestDate'] = $dataEdit[$strDataID]['request_date'];\n $arrResult['dataItemAmount'] = $dataEdit[$strDataID]['item_amount'];\n $arrResult['dataRemark'] = $dataEdit[$strDataID]['remark'];\n $arrResult['dataConsPurchaseNo'] = $dataEdit[$strDataID]['consumable_purchase_no'];\n $arrResult['dataConsReqNo'] = $dataEdit[$strDataID]['id_consumable_request'];\n //foreach($arrTripCost[$dataDonation ['trip_type']\n return $arrResult;\n}", "public function totalCost(): float;", "public function getCost()\n {\n return round($this->price * $this->quantity, 2);\n }", "function craft($item,$qty,$ft){\r\n\tglobal $recipe,$fuel;\r\n\t$items=Array();\r\n\t$itemsq=Array();\r\n\t$nitems=Array();\r\n\t$nitemsq=Array();\r\n\t$items[0]=$item;\r\n\t$itemsq[0]=$qty;\r\n\tdo{\r\n\t\t$allend=0;\r\n\t\tforeach($items as $k=>$v){\r\n\t\t\tif(!isset($recipe[$v])) echo('Error processing item: <b>'.$v.'</b>. Please report this to [email protected]<br>');\r\n\t\t\telse{\r\n\t\t\t\tif($recipe[$v]!='end'){\r\n\t\t\t\t\t$allend+=1;\r\n\t\t\t\t\t$tmp=explode(',',$recipe[$v]);\r\n\t\t\t\t\tforeach($tmp as $t){\r\n\t\t\t\t\t\t$t2=explode(':',$t);\r\n\t\t\t\t\t\t$nitems[count($nitems)]=$t2[0];\r\n\t\t\t\t\t\t$nitemsq[count($nitemsq)]=($t2[1]*$itemsq[$k]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if($v=='fuel'){\r\n\t\t\t\t\t$allend+=1;\r\n\t\t\t\t\t$nitems[count($nitems)]=$ft;\r\n\t\t\t\t\t$nitemsq[count($nitemsq)]=($itemsq[$k]/$fuel[$ft]);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$nitems[count($nitems)]=$v;\r\n\t\t\t\t\t$nitemsq[count($nitemsq)]=$itemsq[$k];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$items=$nitems;\r\n\t\t$itemsq=$nitemsq;\r\n\t\t$nitems=Array();\r\n\t\t$nitemsq=Array();\r\n\t}while($allend!=0);\r\n\tforeach($items as $key=>$val){\r\n\t\t$re[$val]+=$itemsq[$key];\r\n\t}\r\n\treturn $re;\r\n}", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function breakdown(): CostBreakdownContract;", "public function getItemNo_total($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT cashUnpaid from patientCharges where itemNo = '$itemNo' \");\n\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['cashUnpaid'];\n }\n\n}", "function getSaddleCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"saddle\"] == \"saddle\") {\n\t$saddleLabor = (($quantity/SADDLEPERHOUR) * HOUR);\n\t$saddleCost = ($quantity * STAPLE);\n\t}\nelse {\n\t$saddleLabor = 0;\n\t$saddleCost = 0;\n\t}\n$labor += $saddleLabor;\n$rawCost += $saddleCost;\n}", "public function getBaseTotalInvoicedCost();", "function getItemLookup ( $asin, $associatedid, $use_cache = TRUE )\n\t{\n\t\t$is_cached = false;\n\t\tif ( $use_cache ) {\n\t\t\t$cached_item = get_option( $this->db_options_name_cached_item );\n\t\t\tif ( is_array( $cached_item ) ) {\n\t\t\t\tif ( isset( $cached_item[$asin] ) ) {\n\t\t\t\t\tif ( (time() - $cached_item[$asin]['time']) < 60 * 60 * 23 ) {\n\t\t\t\t\t\t$item_result = $cached_item[$asin]['item'];\n\t\t\t\t\t\t$is_cached = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $is_cached ) {\n\t\t\t$item_result = $this->handleRESTcall( $this->getRestItemLookupParams( $asin, $associatedid ) );\n\t\t\tif ( ! (isset( $item_result['Error'] ) || isset( $item_result['Items']['Request']['Errors'] )) ) {\n\t\t\t\t$cached_item[$asin]['time'] = time();\n\t\t\t\t$cached_item[$asin]['item'] = $item_result;\n\t\t\t\tupdate_option( $this->db_options_name_cached_item, $cached_item );\n\t\t\t}\n\t\t}\n\t\treturn ($item_result);\n\t}", "function getStakeholderItem($mainBusiness, $conn, $item) {\n $stakeholders = []; $stakeholder = [];\n $sql_key_info = \"SELECT `description` FROM tbl_catalogue_summary WHERE tab = 'Sustainability Measures' AND sub_tab = 'Stakeholders' AND button_in_sub_tab = '$item'\";\n $result_key_info =mysqli_query($conn, $sql_key_info);\n $key_info = mysqli_fetch_all($result_key_info, MYSQLI_ASSOC);\n //Get tables name from tbl_catalogue_summary.\n $sql_tables = \"SELECT tbl_pull_request_1_source FROM tbl_catalogue_summary WHERE tab = 'Sustainability Measures' AND sub_tab = 'Stakeholders' AND button_in_sub_tab = '$item'\";\n $result_table = mysqli_query($conn, $sql_tables);\n $tables = mysqli_fetch_all($result_table, MYSQLI_ASSOC);\n foreach ($mainBusiness as $mainBusiness_item) {\n foreach ($key_info as $key => $key_info_item) {\n $country_name = $mainBusiness_item['country'];\n $col = $key_info_item['description'];\n $table = $tables[$key]['tbl_pull_request_1_source'];\n //Get table content from $tables.\n $content = getContent($table, '', $conn);\n foreach ($content as $content_item) {\n if(isset($content_item['country'])&&isset($content_item[$col])) {\n if($content_item['country']==$country_name) {\n $result_col = [];\n $result_col[$col] = $content_item[$col];\n array_push($stakeholder, $result_col);\n }\n }\n }\n }\n array_push($stakeholders, $stakeholder);\n }\n return $stakeholders;\n }", "abstract protected function get_item_from_db($item_id);", "public function getPatientChargesQTY($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT * from patientCharges where itemNo = '$itemNo' \");\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['quantity'];\n }\n\n}", "function algorithmic_cost()\r\n{\r\n return ['cost' => 10];\r\n}", "function getQuotationItems($qid)\n {\n $where = \"id='\".$qid.\"'\";\n $result = $this->dList($where);\n $itemArr = $this->getValues($result[0][4],$this->logUser);\n\t$cusItemArr = $this->toArray($result[0][4]);\n\t$n=0;$this->grandTotal=0;$this->itemData='';\n\tforeach ($itemArr as &$value) {\n\t\t$arr[$n][0] = $value[0];\n\t\t$arr[$n][0]['cp'] = $cusItemArr[$value[0]['id']]['cp'];\n\t\t$arr[$n][0]['order'] = $cusItemArr[$value[0]['id']]['order'];\n\t\t$this->itemData[$value[0]['id']]['cp']=$arr[$n][0]['cp'] ;\n\t\tif($cusItemArr[$value[0]['id']]['cp'] && $arr[$n][0]['qty']){\n\t\t\n\t\t$arr[$n][0]['totle'] = $cusItemArr[$value[0]['id']]['cp'] * $arr[$n][0]['qty'];\n\t\t }elseif($cusItemArr[$value[0]['id']]['cp'])\n\t\t {\n\t\t\t $arr[$n][0]['totle'] = $cusItemArr[$value[0]['id']]['cp'];\n\t\t }else\n\t\t {\n\t\t\t switch($arr[$n][0]['type']){\n\t\t\t\tcase\"M\": {\n\t\t\t $arr[$n][0]['totle'] = ($arr[$n][0]['qty'])? $arr[$n][0][6] * $arr[$n][0]['qty'] : $arr[$n][0][6];\n\t\t\t\t} break;\n\t\t\t\tcase\"S\":{\n\t\t\t $arr[$n][0]['totle'] = ($arr[$n][0]['qty']) ? $arr[$n][0][10] * $arr[$n][0]['qty'] : $arr[$n][0][10];\n\t\t\t\t}break;\n\t\t\t\tcase\"C\":{\n\t\t\t $arr[$n][0]['totle'] = ($arr[$n][0]['qty']) ? $arr[$n][0][10] * $arr[$n][0]['qty'] : $arr[$n][0][10];\n\t\t\t\t}break;\n\t\t\t }\n\t\t }\n\t\t$this->grandTotal+=$arr[$n][0]['totle'];\n\t\t$n++;\n\t}\n\n if(!empty($arr))\n {usort($arr, array(\"Quotation\", \"compare\"));}\n\n\t return $arr;\n }", "function calculateActualCost($product_price,$product_cost,$netamount,$othercost,$quantity)\n\t{\n\t\t//product_price = original purchase price\n\t\t//othercost = duty fee + shipping cost + other charges\n\n\t\t$actual_cost = 0;\n\t\t$price_percentage = 0;\n\t\t$other_charges_bypercentage = 0;\n\t\t$product_cost = floatval(str_replace(\",\",\"\",$product_cost));\n\t\t$netamount = floatval(str_replace(\",\",\"\",$netamount));\n\t\t$othercost = floatval(str_replace(\",\",\"\",$othercost));\n\t\t$product_price = floatval(str_replace(\",\",\"\",$product_price));\n\t\t$actual_cost += $product_price; //original purchase price \n\t\tif($netamount!=0 && $netamount!=''){\n\t\t\t$price_percentage = (((100/$netamount)*$product_cost)/100);\n\t\t}\n\t\t//calculation on other charges\n\t\tif($quantity && $quantity!=0){\n\t\t\t$other_charges_bypercentage = ($othercost/$quantity) * $price_percentage ;\n\t\t}\n\t\t$actual_cost += $other_charges_bypercentage;\n\t\treturn $actual_cost;\n\t}", "public function getBaseCost() {\n return $this->item->getBaseCost();\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function cost() {\n $cost = $this->beverage->cost();\n switch ($this->beverage->getSize()) {\n case 'tall':\n $cost += 1;\n break;\n case 'grande':\n $cost += 3;\n break;\n case 'venti':\n $cost += 6;\n break;\n }\n return $cost;\n }", "public function getCost()\n {\n return $this->cost;\n }", "public function getCost()\n {\n return $this->cost;\n }", "public function getCost()\n {\n return $this->cost;\n }", "public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }", "public function addCartItem($rateplanId, $quantity){\r\n\t\terror_log('cart.php rateplanId is: ' . $rateplanId, 0);\r\n\t\terror_log('cart.php quantity is: ' . $quantity, 0);\r\n\t\t//$newCartItem = new Cart_Item($rateplanId, $quantity, $this->latestItemId);\r\n\r\n\r\n\r\n\t\t$newCartItem = new Cart_Item();\r\n\t\t$newCartItem->ratePlanId = $rateplanId;\r\n\t\terror_log('cart.php ratePlanId2 is: ' . $newCartItem->ratePlanId, 0);\r\n\t\t$newCartItem->itemId = $this->latestItemId++;\r\n\t\terror_log('cart.php itemId is: ' . $newCartItem->itemId, 0);\r\n\t\t$newCartItem->quantity = $quantity;\r\n\r\n\t\t//$plan = Catalog::getRatePlan($newCartItem->ratePlanId);\r\n\t\t$rpId = $newCartItem->ratePlanId;\r\n\r\n\t\r\n\r\n\r\n\t\t$catalog_groups = self::readCache();\t//should be in associative array already.\r\n\r\n\t\t$catalog_products = $catalog_groups->products;\t//returns enture product array.\r\n\t\t//error_log(print_r($catalog_products, true));\r\n\t\t//error_log(print_r($catalog_products[2], true));\t//returns a product array with productrateplan and productrateplancharges arrays embedded inside.\r\n\t\t$catalog_rateplans = $catalog_products[0]->productRatePlans;\r\n\t\t//error_log(print_r($catalog_rateplans, true));\r\n\r\n\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// foreach($catalog_groups as $group){\r\n\t\t// \t\r\n\t\t// \tforeach($group->products as $product){\r\n\t\t// \t\t\r\n\t\t// \t\tforeach($product->productRatePlans as $ratePlan){\r\n\t\t// \t\t\tif($ratePlan->id == $rpId){\r\n\t\t// \t\t\t\t$plan = $ratePlan;\r\n\t\t// \t\t\t}\r\n\t\t// \t\t}\r\n\t\t// \t}\r\n\t\t// }\r\n\t\t// $plan = NULL;\r\n\r\n\t/**\r\n\t * Given a RatePlan ID, retrieves all rateplan information by searching through the cached catalog file\r\n\t * @return RatePlan model\r\n\t */\r\n\t// public static function getRatePlan($rpId){\r\n\t// \t$catalog_groups = self::readCache();\r\n\t// \tforeach($catalog_groups as $group){\r\n\t// \t\tforeach($group->products as $product){\r\n\t// \t\t\tforeach($product->ratePlans as $ratePlan){\r\n\t// \t\t\t\tif($ratePlan->Id == $rpId){\r\n\t// \t\t\t\t\treturn $ratePlan;\r\n\t// \t\t\t\t}\r\n\t// \t\t\t}\r\n\t// \t\t}\r\n\t// \t}\r\n\t// \treturn NULL;\r\n\t// }\r\n\r\n\r\n/*\t\t//Not needed? no Uom. \r\n\t\tif(isset($plan->Uom)){\r\n\t\t\t$newCartItem->uom = $plan->Uom;\r\n\t\t} else {\r\n\t\t\t$newCartItem->uom = null;\t\t\t\r\n\t\t}\r\n*/\t\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->Name : 'Invalid Product';\r\n\t\t// $newCartItem->ProductName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->name : 'Invalid Product';\r\n\t\t// $newCartItem->productName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\t\tarray_push($this->cart_items, $newCartItem);\r\n\t}", "public function addItem($item_id,$quantity=1,$price_tier_id = null,$employee_id = null,$user_id = null,$discount_amount=0,$discount_type = '%')\n {\n $models = Item::model()->getItemPriceTierWS($item_id, null);\n $trans_mode=Yii::app()->receivingCart->getMode();\n $supplier_id=Yii::app()->receivingCart->getSupplier();\n if (empty($models)) {\n $models = Item::model()->getItemPriceTierItemNumWS($item_id, null);\n\n foreach ($models as $model) {\n $item_id=$model[\"id\"];\n $item_number=$models['item_number'];\n $cost_price=$models['cost_price'];\n //$supplier_id = $models['supplier_id'];\n }\n }\n\n $cmd = Yii::app()->db->createCommand(\"select func_recv_order_add(:item_id,:item_number,:quantity,:price_tier_id,:cost_price,:supplier_id,:employee_id,:user_id,:discount_amount,:discount_type,:trans_mode) from dual\");\n\n $cmd->bindParam(':item_id' , $item_id);\n $cmd->bindParam(':item_number' ,$item_number);\n $cmd->bindParam(':quantity',$quantity);\n $cmd->bindParam(':price_tier_id',$price_tier_id);\n $cmd->bindParam(':cost_price',$cost_price);\n $cmd->bindParam(':supplier_id',$supplier_id);\n $cmd->bindParam(':employee_id',$employee_id);\n $cmd->bindParam(':user_id',$user_id);\n $cmd->bindParam(':discount_amount',$discount_amount);\n $cmd->bindParam(':discount_type',$discount_type);\n $cmd->bindParam(':trans_mode',$trans_mode);\n $results=$cmd->queryAll();\n\n foreach($results as $result)\n foreach ($result as $k=>$value)\n\n return $value;\n }", "function calculateRealBuyPriceOfAssetUsingCostBasisAndFeeOnPurchase($costBasis, $feeOnPurchase)\n\t{\t\n\t\t\n\t\t$realBuyPriceOfAsset\t\t\t\t= $costBasis - $feeOnPurchase;\n\n\t\treturn $realBuyPriceOfAsset;\t\n\t}", "public function testing()\n {\n //creating the item array with all the values of book object and fruit object\n $items = [new Book(20, \"1234\"), new Book(100, \"5678\"), new Fruit(10, 2, \"Banana\"), new Fruit(5, 5, \"Apple\")];\n\n //calling calculatePrice function to get the total cost\n $total = $this->calculatePrice($items);\n\n // printing the total cost of all items\n echo (\"Total Cost = \" . $total . \"\\n\");\n }", "function format_item($item) //returns an item result with the proper formatting\n{\n\t$format_arr = array('Necessity', 'Title', 'Edition', 'Authors', 'Publisher');\n\t\n\tforeach ($format_arr as $name)\n\t{\n\t\tif (isset($item[$name]) && $item[$name])\n\t\t{\n\t\t\t$item[$name] = ucwords(strtolower(trim($item[$name], \" \\t\\n\\r\\0\\x0B\\xA0\")));\n\t\t}\n\t}\n\tif (isset($item['Year']) && $item['Year'])\n\t{\n\t\t$item['Year'] = date('Y', strtotime(trim($item['Year'])));\n\t}\n\tif (isset($item['ISBN']) && $item['ISBN'])\n\t{\n\t\t$item['ISBN'] = get_ISBN13(str_replace('&nbsp;', '', trim($item['ISBN'])));\n\t}\n\tif (isset($item['Bookstore_Price']) && $item['Bookstore_Price'])\n\t{\n\t\t$item['Bookstore_Price'] = priceFormat($item['Bookstore_Price']);\n\t}\n\t\n\tif (isset($item['New_Price']) && $item['New_Price'])\n\t{\n\t\t$item['New_Price'] = priceFormat($item['New_Price']);\n\t}\n\tif (isset($item['Used_Price']) && $item['Used_Price'])\n\t{\n\t\t$item['Used_Price'] = priceFormat($item['Used_Price']);\n\t}\n\tif (isset($item['New_Rental_Price']) && $item['New_Rental_Price'])\n\t{\n\t\t$item['New_Rental_Price'] = priceFormat($item['New_Rental_Price']);\n\t}\n\tif (isset($item['Used_Rental_Price']) && $item['Used_Rental_Price'])\n\t{\n\t\t$item['Used_Rental_Price'] = priceFormat($item['Used_Rental_Price']);\n\t}\n\n\treturn $item;\n}", "Function SalesPriceUsedInOrder($int_record_id) {\r\n return GetField(\"SELECT orders.OrderID\r\n\t\t\t\t\t FROM order_details\r\n\t\t\t\t\t INNER JOIN orders ON orders.OrderID = order_details.OrderID\r\n\t\t\t\t\t INNER JOIN pricing ON pricing.ProductID = order_details.ProductID\r\n\t\t\t\t\t\t\t\t\t AND (order_details.Quantity >= pricing.start_number OR pricing.start_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (pricing.ContactID = orders.ContactID OR pricing.ContactID = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate >= pricing.start_date OR pricing.start_date = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate <= pricing.end_date OR pricing.end_date = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t WHERE recordID = $int_record_id\");\r\n}", "public function placeOrder($refName, $quantityOrder, $buyerNm, $buyerAdd, $buyerApt, $buyerCiti, $buyerState, $buyerZip, $buyerCountry, $buyerNotes, $sellerId, $sellerNm)\n\t{\n\t\t$conn = $this->inv_conn();\n\t\t$qry_all = \"SELECT DISTINCT `id`, `quantity`,`price` FROM `inventory` WHERE `ref_name` = '$refName'\";\n\t\t$result = mysqli_query($conn, $qry_all);\n\n\t\twhile($res = mysqli_fetch_assoc($result))\n\t\t{\n\t\t\t$refid = $res['id'];\n\t\t\t$quant = $res['quantity'];\n\t\t\t$val = $res['price'];\n\t\t}\n\n\t\tif(($quant - $quantityOrder) < 0)\n\t\t{\n\t\t\treturn 4;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$orderTotal = $val * $quantityOrder;\n\n\t\t\t//International orders\n\t\t\tif($buyerCountry != \"United States\")\n\t\t\t{\n\t\t\t\t$orderTotal += 10;\n\t\t\t}\n\n\t\t\t$qryIns = \"INSERT INTO `order`(`ord_id`, `ord_ref_item`, `ref_fk`, `ord_quant`, `buyer_nm`, `buyer_add`, `buyer_apt`, `ord_city`, `ord_state`, `ord_zip`, `ord_country`, `ord_observ`, `seller_id`, `seller`, `ord_total`)\n\t\t\t\t\t VALUES ('', '$refName','$refid','$quantityOrder', '$buyerNm', '$buyerAdd', '$buyerApt', '$buyerCiti', ' $buyerState', '$buyerZip' ,'$buyerCountry', '$buyerNotes', '$sellerId','$sellerNm', $orderTotal)\";\n\n\t\t\t$conn = $this->inv_conn();\n\t\t\tif($conn->query($qryIns) == TRUE)\n\t\t\t{\n\t\t\t\t$updQuantity = $quant - $quantityOrder;\n\t\t\t\t$qry_upd = \"UPDATE `inventory` SET `quantity` = $updQuantity, `last_update` = CURRENT_TIMESTAMP WHERE `ref_name` = '$refName'\";\n\t\t\t\tif($conn->query($qry_upd) == TRUE)\n\t\t\t\t{\n\t\t\t\t\tif($updQuantity == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = new ordering();\n\t\t\t\t\t\t$obj->outOfStockEmail($refName);\n\t\t\t\t\t}\n\t\t\t\t\t//Order has been placed successful. Send email to system admin.\n\t\t\t\t\t$this->sendEmailAdmin($sellerNm, $refName, $quantityOrder, $updQuantity );\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t}", "public function calculateSaleItem(Model\\SaleItemInterface $item);", "function get_item_shipping() {\n\t}", "private function getCrestData(int $item_id, int $station_id, string $order_type): float\n {\n $regionID = $this->getRegionID($station_id)->id;\n $url = \"https://crest-tq.eveonline.com/market/\" . $regionID . \"/orders/\" . $order_type . \"/?type=https://crest-tq.eveonline.com/inventory/types/\" . $item_id . \"/\";\n //$context = stream_context_create(array('http' => array('header'=>'Connection: close\\r\\n')));\n /*$ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $result = json_decode(curl_exec($ch), true);*/\n $result = json_decode(file_get_contents($url), true);\n $array_prices = [];\n\n for ($i = 0; $i < count($result['items']); $i++) {\n // only fetch orders FROM the designated stationID\n if ($result['items'][$i]['location']['id_str'] == $station_id) {\n array_push($array_prices, $result['items'][$i]['price']);\n }\n }\n\n if ($order_type == 'buy') {\n if (!empty($array_prices)) {\n $price = max($array_prices);\n } else {\n $price = 0;\n }\n } else if ($order_type == 'sell') {\n if (!empty($array_prices)) {\n $price = min($array_prices);\n } else {\n $price = 0;\n }\n }\n return $price;\n }", "function getStoreContentsBySlot($store_id, $journey_id, $character_id, $player_id, $slot) {\n\t\t\n\t\taddToDebugLog(\"manageEquipment(), Function Entry - supplied parameters: Player ID: \" . $player_id . \"; Journey ID: \" . $journey_id . \"; Character ID: \" . $charcter_id . \"; Store ID: \" . $store_id . \", INFO\");\n\n\t\t$row_limit = 3;\n\t\t\n\t\tif ($slot == 'weapon') {\n\t\t\t$order_by = \"item_attack_boost DESC\";\n\t\t} else {\n\t\t\t$order_by = \"item_ac_boost DESC\";\n\t\t}\n\t\t\n\t\t$sql = \"SELECT * FROM hackcess.store_contents WHERE store_id = \" . $store_id . \" AND item_slot = '\" . $slot . \"' ORDER BY \" . $order_by . \" LIMIT \" . $row_limit . \";\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\tif ($rows < $row_limit) {\n\t\t\t$row_limit = $rows;\n\t\t}\n\t\t\n\t\tif ($rows > 0) {\n\t\t\n\t\t\t// Get character gold\n\t\t\t$character_gold = getCharacterDetailsInfo($character_id, 'gold');\n\t\n\t\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>\" . ucfirst($slot) . \"</tr>\";\n\t\t\t\n\t\t\tfor ($i = 0; $i < $row_limit; $i++) {\n\t\t\n\t\t\t\t$boost = $result[$i][3] + $result[$i][4];\n\t\t\t\techo \"<tr><td>+\" . $boost . \" \" . $result[$i][2]; // Item and Boost\n\t\t\t\techo \"<td align=center>\" . $result[$i][5]; // Weight\n\t\t\t\techo \"<td align=center>\" . $result[$i][7]; // Value\n\t\t\t\tif ($result[$i][7] <= $character_gold) { \n\t\t\t\t\techo \"<td align=center><a href='store.php?journey_id=\" . $journey_id . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&store_id=\" . $store_id . \"&action=buy&item_id=\" . $result[$i][0] . \"'>Buy</a>\"; // Action\n\t\t\t\t} else {\n\t\t\t\t\techo \"<td align=center>-\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t}", "function getItemInfo($id, $obDB)\n{\n $obDB->doQuery(\"select * from auctionitems where itemID=\".$id.\" LIMIT 1\");\n $aResult = $obDB->fetchAssocResult()[0];\n return $aResult;\n \n}", "public function get_itemimport_cost($item_id, $year=0, $brand='ALL') {\n $this->db->select('*');\n $this->db->from('ts_itemsold_impts');\n $this->db->where('item_id', $item_id);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('brand', $brand);\n } else {\n $this->db->where_in('brand', ['BT','SB']);\n }\n }\n // $this->db->where('year', $year);\n $res=$this->db->get()->row_array();\n if (isset($res['itemsold_impt_id'])) {\n return $res['cost'];\n } else {\n return 0;\n }\n }", "function dCost($i,$j){\n\t\t\t\treturn $GLOBALS[\"diagCostsTable\"][$i][$j];\n\t\t\t}", "public function calculateShippingAmount()\n {\n\n\n $kgs = 1;\n $total_cost = 0;\n $bc_shipping_cost = 0;\n $shipping_threshold = config('paths.shipping_threshold');\n $shipping_cost = config('paths.shipping_cost');\n $items_in_bag = Session::get('items');\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n if ($item['weight_unit'] == 'g') {\n $kgs = 0.001;\n }\n $i_weight = $item['weight'] * $kgs;\n $total_i_weight = $i_weight * $item['quantity'];\n if ($total_i_weight > $shipping_threshold) {\n $item_shipping_cost = $shipping_cost + ($total_i_weight - $shipping_threshold);\n } else {\n $item_shipping_cost = $shipping_cost;\n }\n $bc_shipping_cost = $bc_shipping_cost + $item_shipping_cost;\n $item_shipping_cost = $item_shipping_cost * Session::get('amount_per_unit');\n $total_cost = $total_cost + $item_shipping_cost;\n $total_cost = round($total_cost, 2);\n $bc_shipping_cost = round($bc_shipping_cost, 2);\n }\n }\n\n Session::put('shipping_cost', $total_cost);\n Session::put('bc_shipping_cost', $bc_shipping_cost);\n return $total_cost;\n }", "function getiteminfo($sessionID, $itemID, $debug) {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT * FROM pricing WHERE sessionid = :sessionID AND itemid = :itemid LIMIT 1\");\n\t\t$switching = array(':sessionID' => $sessionID, ':itemid' => $itemID); $withquotes = array(true, true);\n\t\tif ($debug) {\n\t\t\treturn returnsqlquery($sql->queryString, $switching, $withquotes);\n\t\t} else {\n\t\t\t$sql->execute($switching);\n\t\t\treturn $sql->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "abstract function get ($item);", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "private function calculate_item_prices()\r\n\t{\r\n\t\t// Loop through cart items.\r\n\t\tforeach($this->flexi->cart_contents['items'] as $row_id => $row)\r\n\t\t{\r\n\t\t\t// Check if the item has a specific tax rate set.\r\n\t\t\t$item_tax_rate = $this->get_item_tax_rate($row_id, FALSE); \r\n\r\n\t\t\t// Calculate the internal item price.\r\n\t\t\t$item_internal_tax_data = $this->calculate_tax($row[$this->flexi->cart_columns['item_internal_price']], $item_tax_rate);\r\n\r\n\t\t\t// Calculate the tax on the item price using the carts current location settings.\r\n\t\t\t$item_tax_data = $this->calculate_tax($item_internal_tax_data['value_ex_tax'], $item_tax_rate, FALSE, TRUE);\r\n\t\t\t\t\t\t\r\n\t\t\t// Update the item price.\r\n\t\t\t$row[$this->flexi->cart_columns['item_price']] = $this->format_calculation($item_tax_data['value_inc_tax']);\r\n\r\n\t\t\t// Save item pricing.\r\n\t\t\t$this->flexi->cart_contents['items'][$row_id] = $row;\r\n\t\t}\r\n\t}", "public function get_shipping_cost()\n {\n $products = $this->get();\n $shipping = 0;\n if (! empty($products)) {\n foreach ($products as $product) {\n if ($product['weight'] <= 200) {\n $shipping += 1.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 500) {\n $shipping += 3.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 800) {\n $shipping += 5.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1000) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } else {\n $shipping += 20.00 * ($_SESSION['cart'][$product['id']]);\n }\n }\n return $shipping; \n }\n else {\n return 0.00;\n }\n\n }", "public function getCostDetails()\n {\n\n $return = array (\n 'type' => $this->getType(),\n 'extra' => null,\n 'cost' => $this->getCost(),\n 'total' => $this->getCost(),\n 'children' => array(),\n );\n\n //call the children and populate 'children'\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $costResult = $item->getCostDetails();\n if ($costResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $costResult;\n $return['total'] += $costResult['total']; //add to total we are returning.\n }\n }\n }\n }\n if ($return['total'] == 0) {\n //total is 0, even after going through children! no cost details to return\n return false;\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }", "public function getCostDetails()\n {\n\n $return = array (\n 'type' => $this->getType(),\n 'extra' => null,\n 'cost' => $this->getCost(),\n 'total' => $this->getCost(),\n 'children' => array(),\n );\n\n //call the children and populate 'children'\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $costResult = $item->getCostDetails();\n if ($costResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $costResult;\n $return['total'] += $costResult['total']; //add to total we are returning.\n }\n }\n }\n }\n if ($return['total'] == 0) {\n //total is 0, even after going through children! no cost details to return\n return false;\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }", "public function getCostDetails()\n {\n\n $return = array (\n 'type' => $this->getType(),\n 'extra' => null,\n 'cost' => $this->getCost(),\n 'total' => $this->getCost(),\n 'children' => array(),\n );\n\n //call the children and populate 'children'\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $costResult = $item->getCostDetails();\n if ($costResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $costResult;\n $return['total'] += $costResult['total']; //add to total we are returning.\n }\n }\n }\n }\n if ($return['total'] == 0) {\n //total is 0, even after going through children! no cost details to return\n return false;\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }", "function getBookletCoverCost ($Nup, $quantity, $coverPrice, &$rawCost) {\n\tif ($_POST[\"book\"] == \"book\") {\n\t\t$coverCost = (($quantity / $Nup) * $coverPrice);\n\t}\n$rawCost += $coverCost;\n}", "function getPrice($cart) {\n $cart = $cart['items'];\n\n $totalCost = 0;\n\n /**\n * Sums the cost of each product in the user's cart.\n */\n for ($i = 0; $i < sizeof($cart); $i++) {\n $quantity = ['dvdQuantity' => (int)$cart[$i]['dvdQuantity'], 'bluRayQuantity' => (int)$cart[$i]['bluRayQuantity']];\n\n foreach ($quantity as $key => $value) {\n $isDVD = ($key) === 'dvdQuantity';\n\n if ($value > 0) {\n $totalCost += ($value * (float)$cart[$i][($isDVD) ? 'dvdPrice' : 'bluRayPrice']);\n }\n }\n }\n\n /**\n * The total cost summary is calculated.\n */\n $priceBreakdown = ['subTotal' => bcdiv($totalCost, 1, 2),\n 'vat' => bcdiv((0.20 * $totalCost), 1, 2),\n 'postAndPackaging' => 'Free',\n 'grandTotal' => bcdiv(($totalCost + (0.20 * $totalCost)), 1, 2)\n ];\n\n return $priceBreakdown;\n}", "function purchaseditem () {\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\t$this->set('title_for_layout','- Settings');\n\t\t\tglobal $loguser;\n\t\t\t$userid = $loguser[0]['User']['id'];\n\t\t\tif(!$this->isauthenticated()){\n\t\t\t\t$this->redirect('/mobile/');\n\t\t\t}\n\t\t\t$itemModel = array();\n\t\t\n\t\t\t$this->loadModel('Orders');\n\t\t\t$this->loadModel('Order_items');\n\t\t\t$this->loadModel('Item');\n\t\t\t$this->loadModel('Forexrate');\n\t\t\t\n\t\t\t$forexrateModel = $this->Forexrate->find('all');\n\t\t\t$currencySymbol = array();\n\t\t\tforeach($forexrateModel as $forexrate){\n\t\t\t\t$cCode = $forexrate['Forexrate']['currency_code'];\n\t\t\t\t$cSymbol = $forexrate['Forexrate']['currency_symbol'];\n\t\t\t\t$currencySymbol[$cCode] = $cSymbol;\n\t\t\t}\n\t\t\n\t\t\t$ordersModel = $this->Orders->find('all',array('conditions'=>array('userid'=>$userid),'order'=>array('orderid'=>'desc')));\n\t\t\t$orderid = array();\n\t\t\tforeach ($ordersModel as $value) {\n\t\t\t\t$orderid[] = $value['Orders']['orderid'];\n\t\t\t}\n\t\t\tif(count($orderid) > 0) {\n\t\t\t\t$orderitemModel = $this->Order_items->find('all',array('conditions'=>array('orderid'=>$orderid)));\n\t\t\t\t$itemid = array();\n\t\t\t\tforeach ($orderitemModel as $value) {\n\t\t\t\t\t$orid = $value['Order_items']['orderid'];\n\t\t\t\t\tif (!isset($oritmkey[$orid])){\n\t\t\t\t\t\t$oritmkey[$orid] = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$itemid[] = $value['Order_items']['itemid'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemname'] = $value['Order_items']['itemname'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemtotal'] = $value['Order_items']['itemprice'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemsunitprice'] = $value['Order_items']['itemunitprice'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['itemssize'] = $value['Order_items']['item_size'];\n\t\t\t\t\t$orderitems[$orid][$oritmkey[$orid]]['quantity'] = $value['Order_items']['itemquantity'];\n\t\t\t\t\t$oritmkey[$orid]++;\n\t\t\t\t}\n\t\t\t\t/* if (count($itemid) > 0) {\n\t\t\t\t\t$itemModel = $this->Item->find('all',array('conditions'=>array('Item.id'=>$itemid)));\n\t\t\t\t}\n\t\t\t\tforeach($itemModel as $item) {\n\t\t\t\t\t$itemArray[$item['Item']['id']] = $item['Item'];\n\t\t\t\t} */\n\t\t\t}\n\t\t\t$orderDetails = array();\n\t\t\tforeach ($ordersModel as $key => $orders){\n\t\t\t\t$orderid = $orders['Orders']['orderid'];\n\t\t\t\t$orderCurny = $orders['Orders']['currency'];\n\t\t\t\t$orderDetails[$key]['orderid'] = $orders['Orders']['orderid'];\n\t\t\t\t$orderDetails[$key]['price'] = $orders['Orders']['totalcost'];\n\t\t\t\t$orderDetails[$key]['saledate'] = $orders['Orders']['orderdate'];\n\t\t\t\t$orderDetails[$key]['status'] = $orders['Orders']['status'];\n\t\t\t\t$itemkey = 0;\n\t\t\t\tforeach ($orderitems[$orderid] as $orderkey => $orderitem) {\n\t\t\t\t\t//$itemTable = $itemArray[$orderitem];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['itemname'] = $orderitems[$orderid][$orderkey]['itemname'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['quantity'] = $orderitems[$orderid][$orderkey]['quantity'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['price'] = $orderitems[$orderid][$orderkey]['itemtotal'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['unitprice'] = $orderitems[$orderid][$orderkey]['itemsunitprice'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['size'] = $orderitems[$orderid][$orderkey]['itemssize'];\n\t\t\t\t\t$orderDetails[$key]['orderitems'][$itemkey]['cSymbol'] = $currencySymbol[$orderCurny];\n\t\t\t\t\t$itemkey++;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t//echo \"<pre>\";print_r($orderitems);die;\n\t\t\t$this->set('orderDetails',$orderDetails);\n\t\t\t\n\t\t}", "abstract public function getPrice();", "function calc_extra_sp_cost($Discount = 1){\r\n\t$list = array('D','E','A');\r\n\tforeach($list as $v){\r\n\t\tif(preg_match('/CostSP<([0-9]+)>/',$this->Eq[$v]['spec'],$array)){\r\n\t\t\t$a = intval($array[1]);\r\n\t\t\t$this->SP_Cost += ceil($a * $Discount);\r\n\t\t}\r\n\t}\r\n}", "function getScoreCost (&$labor, $quantity) {\n\tif ($_POST[\"score\"] == \"score\") {\n\t\t$scoreLabor = (HOUR * .16);\n\t\t$scoreLabor += (($quantity * .000833) * HOUR);\n\t}\nelse {\n\t$scoreLabor = 0;\n\t}\n$labor += $scoreLabor;\n}", "function getItem() ;", "protected function calculatePrices()\n {\n }", "public function get_cost($geo,$practice,$mode,$item_category){\n\t\t//mode(0)=>total cost\n\t\t//mode(1)=>fixed cost\n\t\t//mode(2)=>recurring cost\n\t\t//mode(3)=>cost by item_category\n\t\t$utils=new UTILS();\n\t\t$arr=$this->get_cost_array($geo,$practice,$mode,$item_category);\n\t\t$arr1=array();\n\n\t\tforeach ($arr as $key => $value) {\n\t\t\t$arr1[$key]=array_sum($value);\n\t\t}\n\n\t\treturn $arr1;\t\t\t\t\n\t}", "public function getEveryItemHasCost()\n {\n foreach ($this->getQuote()->getAllVisibleItems() as $item) {\n if ($this->getItemCost($item) === null) {\n return false;\n }\n }\n\n return true;\n }", "function getAmount($idItem){\n global $db;\n \n $stmt=$db->prepare(\"SELECT amount FROM inventory WHERE idItem = :idItem\");\n \n $binds= array(\n \":idItem\"=> $idItem\n );\n \n $results=[];\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n return $results;\n }\n else{\n return false;\n }\n \n }", "function getOverallPrice(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl))*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "function wc_shipping_cost_tiers( $cost, $method ) {\n\t\n\tif ( in_array( $method->get_instance_id(), array( 1 ) ) && WC()->cart ) {\n\t\t\n\t\t$cart_item_count = WC()->cart->get_cart_contents_count();\n\n\t\t// if we have items that need shipping, round the quantity / 2 to the nearest whole number\n\t\t// this produces tiered cost increases for every 2 items\n\t\t\n\t\tif ( $cart_item_count >= 1 ) {\n\t\t\t\n\t\t\t$cart_items = WC()->cart->get_cart_contents();\n\t\t\t\n\t\t\tforeach( $cart_items as $item ) {\n\t\t\t\t\n\t\t\t\tif ( $item['product_id'] == 529 || $item['product_id'] == 542 ) {\n\t\t\t\t\t\n\t\t\t\t\tif( $item['quantity'] == 1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cost += 6;\n\t\t\t\t\t\t\n\t\t\t\t\t} elseif ( $item['quantity'] == 2 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cost += 8;\n\t\t\t\t\t\t\n\t\t\t\t\t} elseif ( $item['quantity'] == 3 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cost += 10;\n\t\t\t\t\t\t\n\t\t\t\t\t} elseif ( $item['quantity'] >= 4 && $item['quantity'] <= 8 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cost += 12;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cost += $item['quantity'] * 1.5;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $cost;\n}" ]
[ "0.73825455", "0.67635363", "0.6667434", "0.6462335", "0.6318997", "0.62537485", "0.61736953", "0.6113484", "0.60957515", "0.6002453", "0.5979313", "0.59733385", "0.59671116", "0.59244585", "0.5916088", "0.5878113", "0.5864756", "0.58486265", "0.583431", "0.58190787", "0.58135825", "0.5770923", "0.575995", "0.57465255", "0.57241464", "0.57150525", "0.57104504", "0.56531554", "0.5652997", "0.56511956", "0.5635436", "0.56230766", "0.5620804", "0.5612369", "0.56057346", "0.5595181", "0.5586424", "0.5578811", "0.5575442", "0.55699176", "0.5562447", "0.5545736", "0.55304146", "0.55289537", "0.55282915", "0.55053496", "0.54934394", "0.54872924", "0.5485586", "0.54806566", "0.5470783", "0.5462628", "0.54603845", "0.54465294", "0.54463005", "0.5440329", "0.5437758", "0.54125446", "0.53991467", "0.5397861", "0.5395248", "0.5395248", "0.5395248", "0.5384408", "0.5384227", "0.53803885", "0.53796214", "0.53788376", "0.5375053", "0.5370406", "0.5364917", "0.53606784", "0.5360615", "0.53605664", "0.53579026", "0.5356259", "0.5356249", "0.53525674", "0.5333512", "0.53194004", "0.53130174", "0.5312014", "0.5310079", "0.53029966", "0.53025794", "0.53025794", "0.53025794", "0.5297654", "0.5296296", "0.52955073", "0.52938104", "0.5291548", "0.5286353", "0.52835995", "0.5283152", "0.5272577", "0.5266795", "0.52622163", "0.5258948", "0.52425426" ]
0.7816782
0
08.25.2015 ghh this function deals with looking up a model in order to calculate its cost for the current dealership
function getUnitCost( $modelid, $dealerid, $cost ) { global $db; //08.21.2015 ghh - first we're going to see if there is a dealer specific price for //this item and if so we'll just pass it back $query = "select Cost from UnitModelCost where ModelID=$modelid and DealerID=$dealerid"; if (!$result = $db->sql_query($query)) { RestLog("Error 16562 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500,"16562 - There was a problem attempting find the dealer cost"); //Internal Server Error return false; } $row = $db->sql_fetchrow( $result ); //if there is a cost then lets just return it. if ( $row['Cost'] > 0 ) return $row['Cost']; return $cost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCost();", "public function model()\n {\n return Cost::class;\n }", "public function show(VehicleRequest $request)\n {\n \n $input = $request->input();\n $cost = $request->input('purchase_cost');\n\n\n \n // depreciation\n $depreciation = new depreciationCost($cost);\n $depreciation_amount = $depreciation->depreciateCalc();\n\n\n // interest \n $carInterest = new interestCost($cost);\n $interest_amount = $carInterest->interestCalc();\n $hire_amount = $carInterest->hirePurchase();\n\n // interest total\n $interest_total = $interest_amount + $hire_amount;\n\n\n $carInsurance = new insuranceCost($cost);\n $insurance_amount = $carInsurance->insuranceCalc();\n\n \n $cat = $request->input('category');\n\n //subscription\n $subscription_cost =$request->input('subs');\n\n\n //parking default\n $parking_cost = 93500;\n\n //liscence default\n $liscence_cost = 0;\n //dd($liscence_cost);\n\n $fixed_cost = $liscence_cost + $parking_cost + $subscription_cost + $insurance_amount + $interest_total + $depreciation_amount;\n \n\n\n //fixed cost per km\n $fixed_costs_km = round ($fixed_cost / 30000, 2);\n \n \n\n \n \n //Operating Cost\n\n $oil_cost = $request->input('oils');\n $drive = $request->input('oils');\n $services_cost = $request->input('services');\n $repairs_cost = $request->input('repairs');\n $tyres_cost = $request->input('tyres');\n \n\n //get distance and fuel price\n $capacity_id = $request->input('capacity');\n $fuel_worth = $this->getFuels($capacity_id);\n $distance = $this->getDistance($capacity_id);\n \n\n $fuel_cost = new runningCost($fuel_worth, $distance,);\n $fuel = $fuel_cost->fuelCalc();\n\n\n \n $operating_costs = $oil_cost + $services_cost + $repairs_cost + $tyres_cost + $fuel;\n\n \n //Total Running Cost per KM\n\n \n $running_cost = $fixed_costs_km + $operating_costs;\n\n \n \n \n return view('frontend.costs')->with(compact('fixed_cost','operating_costs','parking_cost','liscence_cost','depreciation_amount','interest_total','subscription_cost','insurance_amount','parking_cost','oil_cost','services_cost','repairs_cost','tyres_cost','drive', 'fuel', 'fixed_costs_km', 'running_cost'));\n }", "abstract public function calculate(Shippable $model): float;", "public function actionDeliveryCost($code){\n //check country\n $city= City::find()->where('Name=\"'.$code.'\"')->one();\n //var_dump($city);\n if($city->CountryCode == 'EGY'){\n //calculate weight\n $sum=0;\n foreach(Shopcart::goods() as $good) {\n $sum+= $good->item->product_weight ;\n\n }\n // return \"the new cost--\".$city->Name .$city->CountryCode;\n //$city->CountryCode;\n $cost= $this->GetCost($city->Name,$sum);\n if($cost =='' or $cost ==0){\n return Setting::get('deliver_cost');\n }else{return $cost ;}\n\n }else{\n return Setting::get('deliver_cost'); //.'-99'. $city->CountryCode;\n }\n\n }", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "public function setModel()\n {\n return Cost::class;\n }", "function getItemCost( $itemid, $dealerid, $pricecode, $cost, $list )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select DealerCost from ItemCost where ItemID=$itemid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16527 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16527 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['DealerCost'] > 0 )\n\treturn $row['DealerCost'];\n\n//if there was no cost then the next step is to see if there is a price code\nif ( $pricecode != '' )\n\t{\n\t$query = \"select Discount from PriceCodesLink where DealerID=$dealerid\n\t\t\t\t\tand PriceCode=$pricecode\";\n\n\tif (!$result = $db->sql_query($query))\n\t\t{\n\t\tRestLog(\"Error 16528 in query: $query\\n\".$db->sql_error());\n\t\tRestUtils::sendResponse(500,\"16528 - There was a problem finding your price code\"); //Internal Server Error\n\t\treturn false;\n\t\t}\n\n\t//08.28.2015 ghh - if we did not find a dealer specific code then next we're going to \n\t//look for a global code to see if we can find that\n\tif ( $db->sql_numrows( $result ) == 0 )\n\t\t{\n\t\t$query = \"select Discount from PriceCodesLink where DealerID=0\n\t\t\t\t\t\tand PriceCode=$pricecode\";\n\n\t\tif (!$result = $db->sql_query($query))\n\t\t\t{\n\t\t\tRestLog(\"Error 16626 in query: $query\\n\".$db->sql_error());\n\t\t\tRestUtils::sendResponse(500,\"16626 - There was a problem finding your price code\"); //Internal Server Error\n\t\t\treturn false;\n\t\t\t}\n\n\t\t//if we found a global price code entry then enter here\n\t\tif ( $db->sql_numrows( $result ) > 0 )\n\t\t\t{\n\t\t\t$row = $db->sql_fetchrow( $result );\n\t\t\tif ( $row['Discount'] > 0 )\n\t\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\t\telse\n\t\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\t//if we found a dealer specific code then enter here\n\t\t$row = $db->sql_fetchrow( $result );\n\n\t\tif ( $row['Discount'] > 0 )\n\t\t\t$cost = bcmul( bcadd(1, $row['Discount']), $cost );\n\t\telse\n\t\t\t$cost = bcmul( bcadd( 1, $row['Discount']), $list );\n\t\t}\n\t}\n\nreturn $cost;\n}", "public function get_services_cost(){\n //find all the requested services on a deadbody\n $sql = \"SELECT * FROM requested_service WHERE dead_no={$this->id}\";\n $this->requested_services = RequestedService::find_by_sql($sql);\n $total_debit = 0;\n //for each requested service find price and add to total debit\n foreach ($this->requested_services as $requested_service) {\n $service = Service::find_by_id($requested_service->service_no);\n $total_debit += $service->price;\n }\n return $total_debit;\n }", "public function run()\n {\n //\n $commercialCompreheniveCost = [\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>4.50\n ],\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>5.75\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>7000000, \n 'rate'=>5.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>7000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>3\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>2.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>2000000, \n 'rate'=>7.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>2000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>6\n ],\n [\n 'commercial_class_id'=>5,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>6,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>7,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>8,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>12.5\n ],\n ];\n \n foreach($commercialCompreheniveCost as $key => $value){\n\n CommercialComprehensiveCost::create($value);\n\n }\n }", "public function getGoods($double_RRs = false)\n{\n\n global $DEA, $rules, $racesNoApothecary, $lng;\n\n $rr_price = $DEA[$this->race]['other']['rr_cost'] * (($double_RRs) ? 2 : 1);\n $apoth = !in_array($this->race_id, $racesNoApothecary);\n\n return array(\n // MySQL column names as keys\n 'apothecary' => array('cost' => $rules['cost_apothecary'], 'max' => ($apoth ? 1 : 0), 'item' => $lng->GetTrn('common/apothecary')),\n 'rerolls' => array('cost' => $rr_price, 'max' => $rules['max_rerolls'], 'item' => $lng->GetTrn('common/reroll')),\n 'ff_bought' => array('cost' => $rules['cost_fan_factor'], 'max' => $rules['max_fan_factor'], 'item' => $lng->GetTrn('matches/report/ff')),\n 'ass_coaches' => array('cost' => $rules['cost_ass_coaches'], 'max' => $rules['max_ass_coaches'], 'item' => $lng->GetTrn('common/ass_coach')),\n 'cheerleaders' => array('cost' => $rules['cost_cheerleaders'], 'max' => $rules['max_cheerleaders'], 'item' => $lng->GetTrn('common/cheerleader')),\n );\n}", "public function getCost() {\n return 15 + $this->carService->getCost();\n }", "public function createCostAvgObject() {\n\t\t/* Check to see if dealer and date combo already exists in DB table. \n\t\t * If so, will need to retrieve data from tables.\n\t\t * If not, will need to bypass table queries and create tables dynamically based on 'services' table\n\t\t */\n\t\tif((isset($_SESSION['profit_dlr_id']) && isset($_SESSION['profit_date'])) || (isset($_SESSION['export_dlr_id']) && isset($_SESSION['export_date']))) {\n\t\t\tif(isset($_SESSION['export_dlr_id']) && isset($_SESSION['export_date'])) {\n\t\t\t\t$dealer = $_SESSION['export_dlr_id'];\n\t\t\t\t$date = $_SESSION['export_date'];\n\t\t\t} else {\n\t\t\t\t$dealer = $_SESSION['profit_dlr_id'];\n\t\t\t\t$date = $_SESSION['profit_date'];\n\t\t\t}\n\t\t\t\n\t\t\tif($this->checkTableData($dealer, $date)) {\n\t\t\t\n\t\t\t\t// Run query of all services to get total for comparison to below query results\n\t\t\t\t$services_info = new ServicesInfo();\n\t\t\t\t$service_list_a = $services_info->getServicesTableData($id_list = NULL); // Will return an array of 8 items (with svc_id and svc_name)\n\t\t\t\t// echo var_dump($service_list_a);\n\t\t\t\t\n\t\t\t\t$sql = \"SELECT a.svc_id, b.svc_name \n\t\t\t\t\t\tFROM cost_avg_data a\n\t\t\t\t\t\tLEFT JOIN services b ON (a.svc_id = b.svc_id)\n\t\t\t\t\t\tWHERE a.dealer_record_id = :dealer_record_id AND a.record_date = :record_date\n\t\t\t\t\t\tGROUP BY a.svc_id \n\t\t\t\t\t\tORDER BY a.svc_id\";\n\t\t\t\ttry {\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(\":dealer_record_id\", $dealer, PDO::PARAM_INT);\n\t\t\t\t\t$stmt->bindParam(\":record_date\", $date, PDO::PARAM_STR);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$svc_results = $stmt->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\t\t$stmt->closeCursor();\n\t\t\t\t\t$service_list_b = array();\n\t\t\t\t\t$service_id_list = array();\n\t\t\t\t\tforeach ($svc_results as $output) {\n\t\t\t\t\t\t$service_list_b[$output['svc_name']] = $output['svc_id'];\n\t\t\t\t\t\t$service_id_list[]= $output['svc_id'];\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tdie($e->getMessage());\n\t\t\t\t}\n\t\t\t\t// echo '$service_list_a: <br>';\n\t\t\t\t// var_dump($service_list_a);\n\t\t\t\t// echo '$service_list_b: <br>';\n\t\t\t\t// var_dump($service_list_b);\n\t\t\t\t// echo '$service_id_list: <br>';\n\t\t\t\t// echo var_dump($service_id_list),'<br><br>';\n\t\t\t\t// die();\n\t\t\t\t\n\t\t\t\t// Query all unit table records for specific dealer and date\n\t\t\t\t$sql = \"SELECT c.svc_id, c.svc_name, a.cost_id, a.cost_desc, a.cost_code, a.cost_ro_count, a.cost_parts_sale, a.cost_parts_cost, a.cost_labor_sale\n\t\t\t\t\t\tFROM cost_avg_data a\n\t\t\t\t\t\tLEFT JOIN dealers b ON (b.dealer_record_id = a.dealer_record_id)\n\t\t\t\t\t\tLEFT JOIN services c ON (c.svc_id = a.svc_id)\n\t\t\t\t\t\tWHERE a.dealer_record_id = :dealer_record_id\n\t\t\t\t\t\tAND a.record_date = :record_date\n\t\t\t\t\t\tORDER BY a.cost_id\";\n\t\t\t\ttry {\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(\":dealer_record_id\", $dealer, PDO::PARAM_INT);\n\t\t\t\t\t$stmt->bindParam(\":record_date\", $date, PDO::PARAM_STR);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$cost_tables = $stmt->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\t\t$stmt->closeCursor();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tdie($e->getMessage());\n\t\t\t\t}\n\t\t\t\t//echo '$cost_tables:<br>', var_dump($cost_tables),'<br>';\n\t\t\t\t//die();\n\t\t\t\t\n\t\t\t\t// Build comma-delimited list from $service_id_list for use in services query below (from getServicesTableData() function)\n\t\t\t\t$query_id_list = '';\n\t\t\t\tfor ($i=0; $i<sizeof($service_id_list); $i++) {\n\t\t\t\t\tif ($i == (sizeof($service_id_list) - 1)) {\n\t\t\t\t\t\t$query_id_list .= $service_id_list[$i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$query_id_list .= $service_id_list[$i].', ';\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t// echo '$query_id_list: <br>',var_dump($query_id_list),'<br><br>';\n\t\t\t\t\n\t\t\t\t// If service lists do not have the same number of items, add remaining service categories and cost table arrays \n\t\t\t\t// to $service_list_b and $cost_tables arrays so that default tables also appear\n\t\t\t\tif (sizeof($service_list_a) != sizeof($service_list_b)) {\n\t\t\t\t\t// echo 'entered sizeof if statement<br>';\n\t\t\t\t\t// Run services query using $query_id_list for 'NOT IN' clause\n\t\t\t\t\t$services_append_array = $services_info->getServicesTableData($query_id_list); // This works.\n\t\t\t\t\t// echo'$services_append_array: ',var_dump($services_append_array),'<br>';\n\t\t\t\t\t// var_dump($services_append_array);\n\t\t\t\t\t// die();\n\t\t\t\t\tforeach ($services_append_array as $value) {\n\t\t\t\t\t\t$service_list_b[$value['svc_name']] = $value['svc_id'];\n\t\t\t\t\t\t$cost_tables[] = array('svc_id' => $value['svc_id'], 'svc_name' => $value['svc_name'], 'cost_desc' => '', 'cost_code' => '', 'cost_ro_count' => '', 'cost_parts_sale' => '', 'cost_parts_cost' => '', 'cost_labor_sale' => '');\n\t\t\t\t\t\t//$cost_array = ($cost_append_array[$value['svc_name']][] = array(\"svc_id\" => $value['svc_id'], \"svc_name\" => '', \"cost_desc\" => '', \"cost_code\" => '', \"cost_ro_count\" => '', \"cost_parts_sale\" => '', \"cost_parts_cost\" => '', \"cost_labor_sale\" => ''));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t/** \n\t\t\t\t* Create two-dimensional array from above query results.\n\t\t\t\t* 1) After obtaining list of service ID's and names (via GROUP BY) and full array(array()) of table rows (2 queries),\n\t\t\t\t* 2) Iterate through each service name and through each table row\n\t\t\t\t* 3) Check to see if 'svc_name' array element == $svc (obtained from 1st service query)\n\t\t\t\t* 4) If it is equal, then add the array row to $new_array, with $svc as the array key (this will be the service name)\n\t\t\t\t*/\n\t\t\t\t$cost_table_array = array();\n\t\t\t\tforeach ($service_list_b as $svc_name => $value) {\n\t\t\t\t\tforeach ($cost_tables as $cost_table) {\n\t\t\t\t\t\tif ($cost_table['svc_name'] == $svc_name) {\n\t\t\t\t\t\t\t$cost_table_array[$svc_name][] = $cost_table;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// echo '$cost_table_array:<br>',var_dump($cost_table_array),'<br>';\n\t\t\t} else { // If there is no table data available, will need to build tables dynamically based on 'services' table\n\t\t\t\t$cost_table_array = $this->buildDefaultCostTables();\n\t\t\t}\n\t\t} else {\n\t\t\t$cost_table_array = $this->buildDefaultCostTables();\n\t\t}\n\t\treturn $cost_table_array;\n\t}", "public function calculation()\n {\n $this->autoRender=false;\n $this->loadModel('Contract');\n $this->loadModel('Delivery');\n $this->Contract->recursive=-1;\n $contracts=$this->Contract->find('all');\n $this->Delivery->recursive=-1;\n foreach ($contracts as $contract)\n {\n $contract_id=$contract['Contract']['id'];\n \n $pli_pac_con=($contract['Contract']['pli_pac']>0)?$contract['Contract']['pli_pac']:0;\n $pli_aproval_con=($contract['Contract']['pli_aproval']>0)?$contract['Contract']['pli_aproval']:0;\n $rr_collection_progressive_con=($contract['Contract']['rr_collection_progressive']>0)?$contract['Contract']['rr_collection_progressive']:0;\n \n $invoice_submission_progressive_con=($contract['Contract']['invoice_submission_progressive']>0)?$contract['Contract']['invoice_submission_progressive']:0;\n $payment_cheque_collection_progressive_con=($contract['Contract']['payment_cheque_collection_progressive']>0)?$contract['Contract']['payment_cheque_collection_progressive']:0;\n $payment_credited_to_bank_progressive_con=($contract['Contract']['payment_credited_to_bank_progressive']>0)?$contract['Contract']['payment_credited_to_bank_progressive']:0;\n \n $conditions=array(\n 'conditions'=>array(\n 'Delivery.contract_id'=>$contract_id,\n 'Delivery.actual_delivery_date NOT LIKE'=>\"0000-00-00\",\n //'Delivery.invoice_submission_progressive LIKE'=>\"0000-00-00\",//this condition may change\n ),\n 'group'=>array(\n 'Delivery.contract_id',\n 'Delivery.actual_delivery_date'\n )\n );\n $deliveries=$this->Delivery->find('all',$conditions);\n $sql=\"\";\n foreach ($deliveries as $deliverie)\n {\n \n $actual_delivery_date=strtotime($deliverie['Delivery']['actual_delivery_date']);\n $id=$deliverie['Delivery']['id'];\n \n $pli_pac1 = $actual_delivery_date+$pli_pac_con * 86400;\n $pli_pac = date('Y-m-d',$pli_pac1);\n\n $pli_aproval1 = $pli_pac1 + $pli_aproval_con * 86400;\n $pli_aproval = date('Y-m-d', $pli_aproval1);\n //planned_rr_collection_date\n $rr_collection_progressive1=$pli_aproval1+$rr_collection_progressive_con* 86400;\n $rr_collection_progressive= date('Y-m-d', $rr_collection_progressive1);\n //invoice_submission_progressive\n $invoice_submission_progressive1 =$rr_collection_progressive1+ $invoice_submission_progressive_con * 86400;\n $invoice_submission_progressive = date('Y-m-d', $invoice_submission_progressive1); \n //payment_cheque_collection_progressive\n $payment_cheque_collection_progressive1=$invoice_submission_progressive1+$payment_cheque_collection_progressive_con * 86400;\n $payment_cheque_collection_progressive = date('Y-m-d', $payment_cheque_collection_progressive1);\n //payment_credited_to_bank_progressive\n $payment_credited_to_bank_progressive1=$payment_cheque_collection_progressive1+$payment_credited_to_bank_progressive_con * 86400;\n $payment_credited_to_bank_progressive = date('Y-m-d', $payment_credited_to_bank_progressive1);\n \n $sql.=\"UPDATE deliveries SET invoice_submission_progressive = '\".$invoice_submission_progressive.\"',payment_cheque_collection_progressive='\".$payment_cheque_collection_progressive.\"',payment_credited_to_bank_progressive='\".$payment_credited_to_bank_progressive.\"' WHERE contract_id= $contract_id and actual_delivery_date='\".$deliverie['Delivery']['actual_delivery_date'].\"';\";\n }\n if($sql){\n \n $this->Delivery->query($sql);\n }\n } \n }", "function getCost(){\n return $this->cost;\n }", "public function totalCost(): float;", "public function cost()\n {\n return $this->getPrice();\n }", "function getSellPricePrevious($targetMonth,$targetYear,$process,$id){\r\n\r\n\t$table = new Model_ChainVehicle();\r\n\t$select = $table->select();\r\n\t$select->where('id ='.$id);\t\r\n\t$detail = $table->fetchRow($select);\r\n\r\n\r\n\t\r\n\tif($process == 'previous'){\r\n\t$select = $table->select();\r\n\tif($detail->dealer){\r\n\t$select->where('dealer like ?',$detail->dealer);\r\n\t}\r\n\t$select->where('brand like ?',$detail->brand);\r\n\t$select->where('unit like ?',$detail->unit);\r\n\t$select->where('year like ?',$targetYear.'');\r\n\t$select->where('month like ?',$targetMonth.'');\t\r\n\t$select->where('status like ?','approved');\t\r\n\t$detail2 = $table->fetchRow($select);\r\n\treturn $detail2->selling_price;\r\n\t}\r\n\t/******************************************/\r\n\telse if($process == 'colorMain'){\r\n\t\t$select = $table->select();\r\n\t\tif($detail->dealer){\r\n\t\t$select->where('dealer like ?',$detail->dealer);\r\n\t\t}\r\n\t\t$targetYear = returnYearx($detail->month,$detail->year);\r\n\t\t$targetMonth = returnMonthx($detail->month);\r\n\t\t\r\n\t\t$select->where('brand like ?',$detail->brand);\r\n\t\t$select->where('unit like ?',$detail->unit);\r\n\t\t$select->where('year like ?',$targetYear.'');\r\n\t\t$select->where('month like ?',$targetMonth.'');\t\r\n\t\t$select->where('status like ?','approved');\t\r\n\t\t$detail2 = $table->fetchRow($select);\r\n\t\r\n\tif($detail2){\r\n\t\tif($detail->selling_price != 0){\r\n\t\t\tif($detail->selling_price < $detail2->selling_price){\r\n\t\t\t\treturn '#CC0000'; /** Decrease **/ }\r\n\t\t\telse if($detail->selling_price > $detail2->selling_price){\r\n\t\t\t\treturn '#0000FF'; /** Increase **/ }\r\n\t\t\telse if($detail->selling_price == $detail2->selling_price){\r\n\t\t\t\treturn '#FFFF00'; /** No Change **/ }\t\t\t\r\n\t\t}// end of seeling price !=0\r\n\t\telse {\r\n\t\t\treturn '#999966'; /** Drop Out **/ }\r\n\t\t}\t\r\n\telse{ return '#66CC00'; /** Not Found New **/ }\r\n\r\n\r\n\t} // end of colorMain\r\n/******************************************/\r\n\telse if($process == 'colorSub'){\r\n\t\t$select = $table->select();\r\n\t\tif($detail->dealer){\r\n\t\t$select->where('dealer like ?',$detail->dealer);\r\n\t\t}\r\n\t\t$select->where('brand like ?',$detail->brand);\r\n\t\t$select->where('unit like ?',$detail->unit);\r\n\t\t$select->where('month like ?',$targetMonth.'');\r\n\t\t$select->where('year like ?',$targetYear.'');\r\n\t\t$select->where('status like ?','approved');\t\t\t\r\n\t\t$detailCurr = $table->fetchRow($select);\r\n\r\n\t\t$select2 = $table->select();\r\n\t\tif($detail->dealer){\r\n\t\t$select2->where('dealer like ?',$detail->dealer);\r\n\t\t}\r\n\t\t$targetYearZ = returnYearx($targetMonth,$targetYear);\r\n\t\t$targetMonthZ = returnMonthx($targetMonth);\r\n\r\n\t\t$select2->where('brand like ?',$detail->brand);\r\n\t\t$select2->where('unit like ?',$detail->unit);\r\n\t\t$select2->where('month like ?',$targetMonthZ.'');\r\n\t\t$select2->where('year like ?',$targetYearZ.'');\r\n\t\t$select2->where('status like ?','approved');\t\t\t\r\n\t\t$detailPrev = $table->fetchRow($select2);\r\n\t\t\r\n\r\n\t\tif($detailPrev){\r\n\t\t\tif($detailCurr->selling_price != 0){\r\n\t\t\t\tif($detailCurr->selling_price < $detailPrev->selling_price){\r\n\t\t\t\t\treturn '#CC0000'; /** Decrease **/ }\r\n\t\t\t\telse if($detailCurr->selling_price > $detailPrev->selling_price){\r\n\t\t\t\t\treturn '#0000FF'; /** Increase **/ }\r\n\t\t\t\telse if($detailCurr->selling_price == $detailPrev->selling_price){\r\n\t\t\t\t\treturn '#FFFF00'; /** No Change **/ }\t\t\t\r\n\t\t\t}// end of seeling price !=0\r\n\t\t\telse {\r\n\t\t\t\treturn '#999966'; /** Drop Out **/ }\r\n\t\t\t}\t\r\n\t\telse{ return '#66CC00'; /** Not Found New **/ }\r\n\t\r\n\r\n\t}// end of if process color \t\r\n\t\r\n\t\r\n\r\n/******************************************/\r\n\t\r\n\t \t\r\n\t}", "function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&amp;gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&amp;gt;post('cost/find', array(\r\n 'from' =&amp;gt; $from,\r\n 'to' =&amp;gt; $to,\r\n 'weight' =&amp;gt; $weight.'000',\r\n 'courier' =&amp;gt; 'jne',\r\n'API-Key' =&amp;gt;'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\r\n ));\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&amp;gt;code == 0)\r\n {\r\n $prices = $result['price'];\r\n $city = $result['city'];\r\n \r\n echo 'Ongkos kirim dari ' . $city-&amp;gt;origin . ' ke ' . $city-&amp;gt;destination . '&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;';\r\n \r\n foreach ($prices-&amp;gt;item as $item)\r\n {\r\n echo 'Layanan: ' . $item-&amp;gt;service . ', dengan harga : Rp. ' . $item-&amp;gt;value . ',- &amp;lt;br /&amp;gt;';\r\n }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan jalur pengiriman dari surabaya ke jakarta';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}", "public function breakdown(): CostBreakdownContract;", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}", "protected function giveCost()\n\t{\n\t\t$solarSaving = 2;\n\t\t$this->valueNow = 210.54 / $solarSaving;\n\t\treturn $this->valueNow;\n\t}", "public function getCashFlowModel($loanId)\n {\n //$modelType = Config::get('constants.CONST_ANALYST_MODEL_TYPE_CREDIT');\n $modelType = 'Cash Flow Model';\n\n DB::enableQueryLog();\n\n $loan = null;\n $loanType = null;\n $amount = null;\n $loanTenure = null;\n $endUseList = null;\n $userProfile = null;\n $ratingModel = null;\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n }\n if (isset($loan)) {\n $loanType = $loan->type;\n $amount = $loan->loan_amount;\n $loanTenure = $loan->loan_tenure;\n $endUseList = $loan->end_use;\n $userId = $loan->user_id;\n $userProfile = UserProfile::where('user_id', '=', $userId)->get()->first();\n\n $cashflowInitial = CashFlowInitial::where('loan_id', '=', $loanId)->first();\n $srcFundschk = SrcOfFundsData::where('loan_id', '=', $loanId)->first();\n // $usesFundschk = UsesOfFundsData::where('loan_id', '=', $loanId)->first();\n\n if (isset($srcFundschk)) {\n for ($i = 0; $i < 11; $i++) {\n $srcFunds[] = DB::table('src_of_funds_data')\n ->where('loan_id', '=', $loanId)\n ->where('src_id', '=', $i)\n ->get();\n }\n }\n $usesFundschk = UsesOfFundsData::where('loan_id', '=', $loanId)->first();\n $SrcTotal = SrcTotal::where('loan_id', '=', $loanId)->first();\n $usesTotal = UsesTotal::where('loan_id', '=', $loanId)->first();\n $openingSrcUse = OpeningSrcUse::where('loan_id', '=', $loanId)->first();\n $surplusSrcUses = SurplusSrcUses::where('loan_id', '=', $loanId)->first();\n $closingSrcUses = ClosingSrcUses::where('loan_id', '=', $loanId)->first();\n if (isset($usesFundschk)) {\n for ($i = 0; $i < 19; $i++) {\n $dataFunds[] = DB::table('uses_of_funds_data')\n ->where('loan_id', '=', $loanId)\n ->where('uses_id', '=', $i)\n ->get();\n }\n }\n\n //$loanPeriod = CashFlowInitial::find($loanId);\n\n\n $period_name = $cashflowInitial->period_name;\n $no_of_period = $cashflowInitial->no_of_period;\n $opening_cash_balance = $cashflowInitial->opening_cash_balance;\n }\n //$validLoanHelper = new validLoanUrlhelper();\n $setDisable = null;\n $validLoanHelper = new validLoanUrlhelper();\n $user = Auth::getUser();\n $setDisable = $this->getIsDisabled($user, true);\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $srcOfFunds = SrcOfFund::all()->pluck('name');\n $useOfFund = UseOfFund::all()->pluck('name');\n\n\n\n\n $subViewType = 'loans.financial._cash_flow_model_table';\n $formaction = 'Loans\\LoansController@postCashFlowModel';\n return view('loans.createedit', compact('subViewType', 'formaction', 'srcFunds', 'SrcTotal', 'openingSrcUse', 'surplusSrcUses', 'closingSrcUses', 'usesTotal', 'dataFunds', 'loan', 'cashflowInitial', 'srcOfFunds', 'useOfFund', 'loanId', 'loanType', 'endUseList', 'validLoanHelper', 'amount', 'loanTenure', 'period_name', 'no_of_period', 'opening_cash_balance', 'setDisable', 'loanUserProfile'));\n }", "public function cost()\n {\n return $this->hasOne(CostService::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::COST_FOREIGN_KEY);\n }", "public function cost()\n {\n return $this->price;\n }", "function get_target_model($username,$model_name){\n\trequire_once('../conf/config.php');\n\t//Connect to mysql server\n\t$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n\tif(!$link){\n\t\tdie('Failed to connect to server: ' . mysql_error());\n\t}\n\t//Select database\n\t$db = mysql_select_db(DB_DATABASE);\n\tif(!$db){\n\t\tdie(\"Unable to select database\");\n\t}\n\t/*\n\t\n\tfunction get_models(f,ZZ)\n\tquery=select * from models where username='f' and object_name='ZZ'\n\tArray\n\t(\n\t[username] => f\n\t[object_name] => ZZ\n\t[object_desc] => newest test mar 1\n\t[model_type] => MTREE\n\t[string_type] => \n\t[pixel_count] => 50\n\t[folds] => 50\n\t[pixel_first] => 1\n\t[pixel_last] => 50\n\t[pixel_length] => 200.00\n\t[unit_of_measure] => in\n\t[total_strings] => 24\n\t[direction] => \n\t[orientation] => 0\n\t[topography] => UP_DOWN_NEXT\n\t[topography] => BOT_TOP\n\t[h1] => 120.00\n\t[h2] => 0.00\n\t[d1] => 40.00\n\t[d2] => 0.00\n\t[d3] => 0.00\n\t[d4] => 0.00\n\t)\n\t*/\n\t//\t\n\t$query =\"select * from models where username='$username' and object_name='$model_name'\";\n\t$result=mysql_query($query) or die(\"<b>A fatal MySQL error occured</b>.\\n<br />Query: \" . $query . \"<br />\\nError: (\" . mysql_errno() . \") \" . mysql_error()); \n\tif(!$result){\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n\t$NO_DATA_FOUND=0;\n\tif(mysql_num_rows($result) == 0){\n\t\t$NO_DATA_FOUND=1;\n\t}\n\t$query_rows=array();\n\t// While a row of data exists, put that row in $row as an associative array\n\t// Note: If you're expecting just one row, no need to use a loop\n\t// Note: If you put extract($row); inside the following loop, you'll\n\t// then create $userid, $fullname, and $userstatus\n\t//\n\tif(!isset($folds)) $folds=1;\n\tif($folds<1) $folds=1;\n\twhile($row = mysql_fetch_assoc($result)){\n\t\textract($row);\n\t}\n\t$pixel_count_even=$folds * intval($pixel_count/$folds); // this is the total pixels that are evenly divisible.\n\tif($folds==1){\n\t\t$maxPixels=$pixel_count;\n\t\t$maxStrands=$total_strings;\n\t}\n\telse{\n\t\t$maxPixels = intval($pixel_count/$folds); // \n\t\t$maxStrands=intval(0.5+($total_strings*$pixel_count)/$maxPixels);\n\t\tif(strtoupper($start_bottom)=='Y'){\n\t\t\t$maxStrands=intval(0.5 + ($total_strings*$pixel_count_even)/$maxPixels);\n\t\t}\n\t}\n\t//\techo \"pixel_count=$pixel_count, pixel_count_even=$pixel_count_even, maxStrands=$maxStrands, maxPixels=$maxPixels</pre>\";\n\t$return_array[0]=$maxStrands;\n\t$return_array[1]=$maxPixels;\n\t$return_array[2]=$model_type;\n\treturn $return_array;\n}", "function getModel($model)\n{\n $models = [];\n /* $models['Address'] = new Address;\n $models['Agency'] = new Agency;\n $models['AgencyBranch'] = new AgencyBranch;\n $models['AgencySolicitorPartnership'] = new AgencySolicitorPartnership;\n $models['Cache'] = new Cache;\n $models['ConveyancingCase'] = new ConveyancingCase;\n $models['User'] = new User;\n $models['UserAddress'] = new UserAddress;\n $models['UserPermission'] = new UserPermission;\n $models['UserRole'] = new UserRole;*/\n $models['TargetsAgencyBranch'] = new TargetsAgencyBranch;\n return $models[$model];\n}", "function dCost($i,$j){\n\t\t\t\treturn $GLOBALS[\"diagCostsTable\"][$i][$j];\n\t\t\t}", "public function getCost()\n {\n return $this->get(self::_COST);\n }", "function costEstimation()\n {\n return $this->hasOne('App\\CostEstimation')->where(['isactive' => 1]);\n }", "public function searchCostBill() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n $criteria = new CDbCriteria;\n $criteria->order = 'id DESC';\n $criteria->compare('id', $this->id);\n $criteria->compare('bill_no', $this->bill_no, true);\n // $criteria->compare('bill_date', $this->bill_date, true);\n $criteria->compare('bill_from_date', $this->bill_from_date, true);\n $criteria->compare('bill_to_date', $this->bill_to_date, true);\n $criteria->compare('customer_id', $this->customer_id);\n // $criteria->compare('purchase_order_id', $this->purchase_order_id);\n $criteria->compare('item_id', $this->item_id);\n $criteria->compare('bill_type', $this->bill_type, true);\n $criteria->compare('print_type', $this->print_type, true);\n $criteria->compare('added_on', $this->added_on, true);\n $criteria->compare('particulars', $this->particulars, true);\n $criteria->condition=\"bill_type='cost_bill'\";\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function getUnitCostAttribute()\n {\n $item = ItemModel::where('id', $this->item_id)->first();\n if($item) {\n if($item->cost) {\n return $item->cost;\n } else {\n if(ProductEnglishValueModel::where('product_id', $item->product_id)->first()) {\n return ProductEnglishValueModel::where('product_id', $item->product_id)->first()->sale_usd_price;\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n }", "public function cost()\n {\n return $this->beverage->cost() + $this->cost;\n }", "public function getBonus($model){\n // Sanity check\n if(!isset($model) || trim($model) === '') throw new \\Exception('Specificati modelul');\n\n // Set method and action\n $method = 'products';\n $action = 'getBonus';\n\n // Set data\n $data = array('model' => $model);\n\n // Send request and retrieve response\n $result = Dispatcher::send($method, $action, $data);\n\n return $result;\n }", "function getSaddleCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"saddle\"] == \"saddle\") {\n\t$saddleLabor = (($quantity/SADDLEPERHOUR) * HOUR);\n\t$saddleCost = ($quantity * STAPLE);\n\t}\nelse {\n\t$saddleLabor = 0;\n\t$saddleCost = 0;\n\t}\n$labor += $saddleLabor;\n$rawCost += $saddleCost;\n}", "public function aggiornaCostiBaseModello($modello){\n \n if($this->codice_modello>0){\n //controllo se esistono i costi\n $costi=$this->getCostiBaseModello($this->codice_modello);\n\n if( count($costi) > 0 ){\n\n $this->db->where('codice_modello',$this->codice_modello);\n $this->db->update(\"lm_costi_base\",$modello);\n\n\n }else{\n \n $modello[\"codice_modello\"]=$this->codice_modello;\n $this->db->insert(\"lm_costi_base\",$modello);\n \n }\n\n } \n }", "function getExtensionCost($game_id, $company_id, $round_number){\t\t\t\r\n\t\t\t$capacity=new Model_DbTable_Decisions_Pr_Capacity();\r\n\t\t\t$production=new Model_DbTable_Decisions_Production();\r\n\t\t\t$factories=$production->getFactories($game_id, $company_id, $round_number);\r\n\t\t\t$factory_number=1;\r\n\t\t\tif($factories!=null){\r\n\t\t\t\tforeach ($factories as $counterfactories){\r\n\t\t\t\t\t$region[$factory_number]=$factories['factory_number_'.$factory_number];\r\n\t\t\t\t\t$factory_number++;\r\n\t\t\t\t}\r\n\t\t\t\t$factory_number_aux=1;\r\n\t\t\t\tif($factory_number_aux<=$factory_number)\r\n\t\t\t\tforeach ($factories as $factory){\r\n\t\t\t\t\t$extension_factory=$capacity->getExtensionWasCreated($game_id, $company_id, $factory_number_aux);\r\n\t\t\t\t\tfor ($round = 1; $round <= $round_number; $round++) {\r\n\t\t\t\t\t\t$round_created[$round]=$extension_factory['factory_number_'.$factory_number_aux]['round_number_created_'.$round];\r\n\t\t\t\t\t\tfor ($round_aux = 1; $round_aux <= $round; $round_aux++) {\r\n\t\t\t\t\t\t\tif($round>=$round_created[$round_aux]){\r\n\t\t\t\t\t\t\t\t$extension[$round]=$extension_factory['factory_number_'.$factory_number_aux]['capacity_'.$round_aux];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t$extension[$round_aux]=0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$cost_aux=$this->getProductionCost($game_id, $round_number, $region[$factory_number_aux], 'fixed');\r\n\t\t\t\t\t\t\t$machines=$this->getOrganizationParam($game_id, 'machines');\r\n\t\t\t\t\t\t\t$cost['factory_number_'.$factory_number_aux][$round]=($extension[$round]*($cost_aux/$machines))*0.7;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$factory_number_aux++;\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($factories as $factory) {\r\n\t\t\t\t\t//$result+=$cost['factory_number_'.$factory['factory_number']][$round_number];\r\n\t\t\t\t\t$result+=$cost['factory_number_'.$factory][$round_number];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$result=0;\r\n\t\t\t}\r\n\t\t\treturn $result;\t\t\t\r\n\t\t}", "public static function updateBeforeLoad($model)\n {\n $model = Order::getShippingDetail($model);\n // Order type and dropdown values for setting customer and agent\n $model = \\common\\models\\User::RequestedUserDetail($model);\n // Product detail for price and quantity\n \n \n // check status of order\n $orderReturn = array_search('Return Request', \\common\\models\\Lookup::$status);\n $orderTransfer = array_search('Transfer Request', \\common\\models\\Lookup::$status);\n // order type for return and transfer\n if ($orderReturn == $model->status) {\n $model->order_type = 'Return';\n $currentStock = \\common\\models\\helpers\\Statistics::CurrentStock($model->child_user);\n } else {\n $currentStock = \\common\\models\\helpers\\Statistics::CurrentStock($model->request_agent_name);\n }\n if ($orderTransfer == $model->status) {\n $model->order_type = 'Transfer';\n }\n $model->total_stock = $currentStock;\n return $model;\n }", "public function priceCalculateOrgBranches($user_id, $start_date, $end_date){\n $this->loadModel('ShiftUser');\n $this->loadModel('Organizationfunction');\n $this->loadModel('MultiplyPaymentFactor');\n $myOrganizations = $this->OrganizationUser->myOrganizationLists($user_id);\n \n $overAllCost = 0;\n $overAllHourWorked = 0;\n foreach($myOrganizations as $myOrganization){\n $org_id = $myOrganization['OrganizationUser']['organization_id'];\n $branch_id = $myOrganization['Branch']['id'];\n $wage = $myOrganization['OrganizationUser']['wage'];\n // for holiday\n $holidays = $this->Organizationfunction->holidays($org_id, $branch_id, $start_date, $end_date);\n foreach($holidays as $holiday){\n $holiday_arr[] = $holiday['Organizationfunction']['function_date'];\n }\n \n // for payment Rate \n $paymentFactorRates = $this->MultiplyPaymentFactor->paymentFactorRates($org_id, $branch_id);\n \n foreach($paymentFactorRates as $paymentFactorRate){\n $paymentFactorRateArray[$paymentFactorRate['Multiplypaymentfactortype']['title']] = $paymentFactorRate['MultiplyPaymentFactor']['multiply_factor']; \n }\n \n // for shiftrange\n $shiftRanges = $this->ShiftUser->myOrgShiftRange($user_id, $org_id, $branch_id, $start_date, $end_date); \n \n \n $output = array();\n $count = 0;\n $total_cost = 0;\n $sat_sun_count = 0;\n $hour_worked_sec = 0;\n \n foreach($shiftRanges as $datas){\n $time_diff = 0;\n $time_diff_hour = 0;\n $rate = 0;\n $cost = 0;\n \n $starttime = strtotime($datas['Shift']['starttime']);\n $endtime = strtotime($datas['Shift']['endtime']);\n $time_diff = $endtime - $starttime;\n if($time_diff < 0){\n $time_diff = $time_diff + 24*3600; \n }\n $time_diff_hour = $time_diff / 3600;\n $hour_worked_sec = $hour_worked_sec + $time_diff;\n \n if(in_array($datas['ShiftUser']['shift_date'], $holidays)){\n $output['yes'][$count][]= $datas['ShiftUser']['shift_date'];\n if(isset($paymentFactorRateArray['Holiday']) && !empty($paymentFactorRateArray['Holiday'])){\n $rate = $paymentFactorRateArray['Holiday'];\n }else{\n $rate = 1; \n }\n $output['yes'][$count]['rate'] = $rate;\n $output['yes'][$count]['shift_duration'] = $time_diff_hour;\n $cost = $rate * $time_diff_hour * $wage;\n $output['yes'][$count]['cost'] = $cost;\n $total_cost = $total_cost + $cost;\n }else{\n $output['no'][$count][]= $datas['ShiftUser']['shift_date'];\n $day_name = date('l', strtotime($datas['ShiftUser']['shift_date']));\n $output['no'][$count]['day'] = $day_name;\n if(isset($paymentFactorRateArray[$day_name]) && !empty($paymentFactorRateArray[$day_name])){\n $rate = $paymentFactorRateArray[$day_name];\n $sat_sun_count++;\n }else{\n $rate = 1;\n }\n \n $output['no'][$count]['rate'] = $rate;\n $output['no'][$count]['shift_duration'] = $time_diff_hour;\n $cost = $rate * $time_diff_hour * $wage;\n $output['no'][$count]['cost'] = $cost;\n $total_cost = $total_cost + $cost;\n }\n $count++;\n \n }\n $overAllCost = $overAllCost + $total_cost;\n $hour_worked = $hour_worked_sec / 3600;\n $overAllHourWorked = $overAllHourWorked + $hour_worked;\n \n $output['total_cost'] = $overAllCost;\n //$output['holiday'] = count($holidays);\n //$output['sat_sun_count'] = $sat_sun_count;\n $output['hour_worked'] = $overAllHourWorked;\n \n //echo $overAllCost; \n //debug($output);\n }\n //echo $overAllCost;\n /*\n foreach($myOrganizations as $key=>$org_id){\n $branches = $this->OrganizationUser->Branch->BranchesList($org_id);\n foreach($branches as $branch_id=>$branch_title){\n $shift_range[$org_id][$branch_id] = $this->ShiftUser->myOrgShiftRange($user_id, $org_id, $branch_id, $start_date, $end_date);\n // for holidays\n $holidays = $this->Organizationfunction->holidays($org_id, $branch_id, $start_date, $end_date);\n foreach($holidays as $holiday){\n $holiday_arr[] = $holiday['Organizationfunction']['function_date'];\n }\n }\n }\n */\n \n \n //$test = array($user_id, $start_date, $end_date);\n $this->set(array(\n 'output'=>$output,\n '_serialize'=>array('output')\n ));\n }", "public function getShippingCost();", "abstract function getModel();", "public function _get_plates_costs() {\n $this->db->select('orangeplate_price, blueplate_price, repaid_cost, inv_addcost, beigeplate_price');\n $this->db->from('ts_configs');\n $res=$this->db->get()->row_array();\n return $res;\n }", "public function getCost()\n {\n return $this->cost;\n }", "public function getCost()\n {\n return $this->cost;\n }", "public function getCost()\n {\n return $this->cost;\n }", "function calc_extra_sp_cost($Discount = 1){\r\n\t$list = array('D','E','A');\r\n\tforeach($list as $v){\r\n\t\tif(preg_match('/CostSP<([0-9]+)>/',$this->Eq[$v]['spec'],$array)){\r\n\t\t\t$a = intval($array[1]);\r\n\t\t\t$this->SP_Cost += ceil($a * $Discount);\r\n\t\t}\r\n\t}\r\n}", "public function calcularCosto(){\n $detalles = DetalleOrden::where('codOrden','=',$this->codOrden)->get();\n $sumaTotal = 0;\n foreach ($detalles as $x) {\n $sumaTotal = $sumaTotal + ($x->precio*$x->cantidad);\n }\n\n return $sumaTotal;\n\n }", "protected function giveCost()\n {\n $novoValor = 4;\n $this->valueNow = 210.54 / $novoValor;\n return $this->valueNow;\n }", "protected abstract function model();", "protected function _getResourcePurchasedModel()\r\n\t{\r\n\t\treturn $this->getModelFromCache('Brivium_CreResIntegration_Model_Purchased');\r\n\t}", "public function cost() {\n $cost = $this->beverage->cost();\n switch ($this->beverage->getSize()) {\n case 'tall':\n $cost += 1;\n break;\n case 'grande':\n $cost += 3;\n break;\n case 'venti':\n $cost += 6;\n break;\n }\n return $cost;\n }", "public function getStoreToOrderRate();", "function get_movie_cost()\n {\n $query=\"select * from ticket_cost_tbl\";\n \n $qry = $this->db->query($query);\n // echo $this->db->last_query();exit();\n return $qry->result();\n \n \n }", "public function getCost(): double \n {\n return $this->cost;\n }", "function getLamCost ($totalSheets, &$rawCost, &$labor, $quantity, $Nup) {\n\tif ($_POST[\"lam\"] == \"lam\") {\n\t\t$lamCost = 0;\n\t\t$lamCost += ($totalSheets * LAMCOST);\n\t}\n\telse {\n\t\t$lamCost = 0;\n\t\t}\n$rawCost += $lamCost;\n\n\n// if booklet + lam\n\tif ($_POST[\"lamcover\"] == \"lamcover\") {\n\t\t$lamCoverLabor = 0;\n\t\t$lamCoverLabor += (( $quantity / $Nup ) * LAMTIME * HOUR );\n\t\t$lamCoverCost = 0;\n\t\t$lamCoverCost += ($quantity * LAMCOST);\n\t}\n\telse {\n\t\t$lamCoverLabor = 0;\n\t\t$lamCoverCost = 0;\n\t}\n$labor += $lamCoverLabor;\n$rawCost += $lamCoverCost;\n\n\n//Determine Lam Labor\n\tif ($_POST[\"lam\"] == \"lam\") {\n\t\t$lamLabor = 0;\n\t\t$lamLabor += ((($totalSheets/4) * LAMTIME) * HOUR);\n\t}\n\telse {\n\t\t$lamLabor = 0;\n\t}\n$labor += $lamLabor;\n}", "public function getActualOverheadOtherCosts(){\n return $this->hasMany(Overhead_other_costs::class, 'mfp_procurement_id', 'id'); \n }", "public function calc_hotel_management_fee ($price, $info, $hotel_code)\r\n\t{\r\n\t\t$dat = array();\r\n\t\t$dat['status'] = false;\r\n\t\tif(!empty($info['c_user_id'] )) {\r\n\t\t\t$stmt = \"SELECT * FROM specific_markup_hotel where corporate_id = \". $info['c_user_id'] . \" AND hotel_id = \".$hotel_code .\" \";\r\n\t\t\t$query = $this->CI->db->query($stmt);\r\n\t\t\t$result = $query->result_array();\r\n\t\t} else {\r\n\t\t\t\r\n\t\t}\r\n\t\tif($query->num_rows > 0) {\r\n\t\t\t$result = $result[0];\r\n\t\t\tif($result['management_fee_type'] == 'plus') {\r\n\t\t\t\t$dat['data']['srv_chrg1c'] = $result['management_fee_value'];\r\n\t\t\t\tif ( !empty($info['e_company_state_gst_code']) ) {\r\n\t\t\t\t\tif($info['e_company_state_gst_code'] == 27) {\r\n\t\t\t\t\t\t$dat['data']['serv_educ'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$dat['data']['serv_taxc'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !empty($info['e_company_state']) ) {\r\n\t\t\t\t\t\tsimilar_text ( $info['e_company_state'], 'maharashtra', $perc);\r\n\t\t\t\t\t\tif($perc > 50 ) {\r\n\t\t\t\t\t\t\t$dat['data']['serv_educ'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(!empty($info['c_company_state_gst_code'])) {\r\n\t\t\t\t\t\t\tif($info['c_company_state_gst_code'] == 27) {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tsimilar_text ( $info['c_company_state'], 'maharashtra', $perc);\r\n\t\t\t\t\t\t\tif($perc > 50 ) {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = $result['management_fee_value'] * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t// if percentage\r\n\t\t\t\t$m_fee = ($price * $result['management_fee_value'])/100;\r\n\t\t\t\t$dat['data']['srv_chrg1c'] = $m_fee;\r\n\t\t\t\tif ( !empty($info['e_company_state_gst_code']) ) {\r\n\t\t\t\t\tif($info['e_company_state_gst_code'] == 27) {\r\n\t\t\t\t\t\t$dat['data']['serv_educ'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$dat['data']['serv_taxc'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !empty($info['e_company_state']) ) {\r\n\t\t\t\t\t\tsimilar_text ( $info['e_company_state'], 'maharashtra', $perc);\r\n\t\t\t\t\t\tif($perc > 50 ) {\r\n\t\t\t\t\t\t\t$dat['data']['serv_educ'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(!empty($info['c_company_state_gst_code'])) {\r\n\t\t\t\t\t\t\tif($info['c_company_state_gst_code'] == 27) {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tsimilar_text ( $info['c_company_state'], 'maharashtra', $perc);\r\n\t\t\t\t\t\t\tif($perc > 50 ) {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_taxc'] = $m_fee * 0.18;\r\n\t\t\t\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} // end if\r\n\r\n\t\t} else {\r\n\t\t\t$dat['data']['srv_chrg1c'] = 0;\r\n\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t$dat['status'] = true;\r\n\t\t}\r\n\r\n\t\treturn $dat;\r\n\t\t\r\n\t}", "function profit()\n\t{\n\t\t$total = 0;\n\t\t$ante = $this->properties->get('ante');\n\t\tforeach ($this->all() as $record)\n\t\t\tif (!empty($record->making))\n\t\t\t\t$total += $record->balance - $ante;\n\n\t\treturn $total;\n\t}", "public function totalq1($modalite)\r\n\t{\r\n\t$conge = new Default_Model_Conge();\r\n\t$debut_mois = $this->getAnnee_reference().'-01-01';\r\n\t$fin_mois = $this->getAnnee_reference().'-12-31'; // il faut la remplacer par l'annee de reference\r\n\t\r\n\t\r\n\t$jours_ouvres_de_annee_ref = $conge->joursOuvresDuMois($debut_mois,$fin_mois);\r\n\t$nbr_heurs_ouvrees_annee = ($jours_ouvres_de_annee_ref -14) *7.4;\r\n\t$personne = new Default_Model_Personne();\r\n\t$id_entite =1; // MBA : pourquoi entite 1 pour personne? \r\n\t$personne = $personne->fetchall('id_entite ='.$id_entite. '&&'. 'id ='.$this->getPersonne()->getId());\r\n\t//var_dump($personne);\r\n\tif (null!==$personne)\r\n\t\r\n\t{\r\n\t\tif ($modalite == 4)\r\n\t\t{\r\n\t\t\t$nbr_heurs_ouvrees_annee = ($jours_ouvres_de_annee_ref -14) *7.4;\r\n\t\t\tif($nbr_heurs_ouvrees_annee >1607)\r\n\t\t\t{\r\n\t\t\t\treturn 0.5;\r\n\t\t\t}\r\n\t\t\telseif($nbr_heurs_ouvrees_annee <1607.5)\r\n\t\t\t{\r\n\t\t\t\treturn 1.0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telseif ($modalite == 5 ||$modalite == 6 )\r\n\t\t{\r\n\t\t\t$nbr_jours_ouvrees_annee = $jours_ouvres_de_annee_ref-243;\r\n\t\t\tif($nbr_jours_ouvrees_annee < 10)\r\n\t\t\t{\r\n\t\t\t\treturn 10.0;\r\n\t\t\t}\r\n\t\t\telseif($nbr_jours_ouvrees_annee >10)\r\n\t\t\t{\r\n\t\t\t\treturn $nbr_jours_ouvrees_annee;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\telseif ($modalite == 1 ||$modalite == 2 ||$modalite == 3)\r\n\t\t{\r\n\t\t\t\treturn 10.0;\r\n\t\t}\r\n\t\r\n\t}\r\n\t\r\n\telse return 0;\r\n\t\r\n\t}", "function getAfe($prjKode = '', $sitKode = '', $workId = '', $kodeBrg = '') {\n $sql =\"DROP TEMPORARY TABLE IF EXISTS ActualCost;\n CREATE TEMPORARY TABLE ActualCost\n (\n id int(11) NOT NULL AUTO_INCREMENT,\n prj_kode varchar(255) DEFAULT '',\n sit_kode varchar(255) DEFAULT '',\n val_kode varchar(6) DEFAULT '',\n qty decimal(12,4) DEFAULT '0.0000',\n harga decimal(15,4) DEFAULT '0.0000',\n total decimal(15,4) DEFAULT '0.0000',\n workid char(255) DEFAULT '',\n kode_brg char(25) DEFAULT '',\n PRIMARY KEY (id)\n );\";\n \n $this->db->query($sql);\n \n $s_sit = ($sitKode !=''|| $sitKode!=null) ? \" AND sit_kode='$sitKode' \" : '';\n $work_id = ($workId != ''|| $workId!=null) ? \"AND workid='$workId' \" : '';\n $kode_brg = ($kodeBrg !=''|| $kodeBrg!=null) ? \"AND kode_brg='$kodeBrg' \" : '';\n \n //AFE\n $sql1 = \"INSERT INTO ActualCost (prj_kode, sit_kode, qty, harga, total, val_kode, id, workid, kode_brg)\n SELECT prj_kode, sit_kode, qty, harga, total, val_kode, id, workid, kode_brg\n FROM transengineer_boq3d\n WHERE\n prj_kode = '$prjKode'\n $s_sit $work_id $kode_brg\n ORDER BY id DESC\n \";\n $this->db->query($sql1);\n \n $sql2 = \"SELECT prj_kode, sit_kode, qty, harga, total, val_kode, id, workid, kode_brg\n FROM ActualCost\n GROUP BY prj_kode, sit_kode, workid, kode_brg\n \n \";\n \n \n $fetch = $this->db->query($sql2);\n $gTotal = $fetch->fetch();\n if ($gTotal['qty'])\n return $gTotal;\n else\n return '';\n \n }", "public function fetchCostData()\n {\n $finance_pid = $this->getSystemSetting('em-finance-pid');\n\n if (!isset($finance_pid))\n throw new \\Exception('Error: no finance Project ID has been passed');\n\n $custom_field = $this->fetchCustomField();\n\n $fields = array(\n 'module_name',\n 'stanford_module',\n 'module_description',\n 'actual_monthly_cost',\n 'maintenance_fee',\n $custom_field ?? ''\n );\n $params = array('project_id' => $finance_pid, 'return_format' => 'json', 'fields' => $fields, 'events' => 'modules_arm_1', 'filterLogic' => '[actual_monthly_cost] != 0');\n $result = json_decode(\\REDCap::getData($params), true);\n\n if ($result && array_key_exists($custom_field, $result[0]))\n return $this->transformMap($result); //Fetch task record\n else\n throw new \\Exception(\"No field by the name of $custom_field found\");\n }", "public function createCostEstimate($request)\n {\n\n $user_id = $request->get('user_id');\n\n $vehicle_id = $request->get('vehicle_id',null);\n\n $location = $request->get('location',null);\n\n $city = $request->get('city',null);\n\n /** get array of object services & supplies */\n $item = $request->input('joborder_service_supplies');\n\n /** get array of user id techinician */\n $technician_id = $request->input('technician_id');\n\n\n DB::beginTransaction();\n\n /**\n * Get users\n */\n $user = $this->user\n ->addWith(['information.enterprise.vehicles','vehicles'])\n ->firstOrfail($user_id);\n\n try{\n /**\n * Create Bookings\n */\n $data = [\n 'vehicle_id' => $vehicle_id,\n 'address' => $request->get('address',''),\n 'concern' => $request->get('concern',''),\n 'concern_type' => $request->get('concern_type',null),\n 'date' => $request->get('date',null),\n 'time' => $request->get('time',null),\n 'status' => $request->get('status','pending'),\n 'booked_by' => $this->authUser->user_type\n ];\n\n /**\n * Consumer type Request\n */\n if($user->user_type === 'consumer')\n {\n $data['user_id'] = $user->id;\n $data['location'] = $location;\n $data['city'] = $city;\n }\n\n /**\n * Enterprise Type Request\n */\n if($user->user_type === 'enterprise')\n {\n $data['user_id'] = $user->id;\n $data['enterprise_id'] = $user->information->enterprise_id;\n }\n\n /** booking created */\n $booking = $this->booking->create($data);\n\n /**\n * Create Joborders\n */\n $data = [\n 'requested_at' => $request->get('requested_at',null),\n 'concern' => $request->get('concern',null),\n 'assessment' => $request->get('assessment',null),\n 'solution' => $request->get('solution',null),\n 'vehicle_id' => $vehicle_id,\n 'status' => $request->get('status','pending'),\n 'user_id' => $user->id,\n 'concern_type' => $request->get('concern_type',null),\n 'schedule' => $request->get('schedule',null),\n 'location' => $request->get('location',null),\n 'city' => $city,\n 'booking_id' => $booking->id,\n 'total' => $request->get('total',null)\n ];\n\n /**\n * Enterprise Type Request\n */\n if($user->user_type === 'enterprise')\n {\n $data['enterprise_id'] = $user->information->enterprise_id;\n }\n\n $joborder = $this->joborder->create($data);\n\n $joborder->load(['user.information.enterprise']);\n\n /**\n * Create Joborder Code\n */\n $this->joborder->update(['id' => $joborder->id],[\n 'code' => sprintf('%04d',$joborder->id),\n ]);\n\n\n /**\n * Send Message\n */\n $threadId = md5($joborder->user_id);\n if($joborder->user->information->enterprise_id !== null){\n $threadId = md5('enterprise-'.$joborder->user->information->enterprise->id);\n }\n\n $data = [\n 'thread_id' => $threadId,\n 'user_id' => $this->authUser->id,\n 'chat' => 'Joborder Created #' . $joborder->joborder_id . $joborder->code,\n 'is_read' => 'sent',\n 'joborder_id' => $joborder->id,\n ];\n\n $chatCreated = $this->message->create($data);\n\n $chatCreated->load(['joborder']);\n\n /**\n * Broadcast Messages\n */\n broadcast(new ChatMessages($chatCreated))->toOthers();\n\n /**\n * Update Booking status\n */\n if($request->has('booking_id') === TRUE)\n {\n $this->booking->update(['id' => $booking->id],[\n 'status' => $request->get('status','pending')\n ]);\n }\n\n /**\n * Save Service And Supplies\n */\n foreach ($item as $key => $value)\n {\n $value['joborder_id'] = $joborder->id;\n $this->joborderItem->create((array)$value);\n }\n\n /**\n * Save Data in Pivot\n */\n $joborder->users()->attach($technician_id);\n\n }catch(Exception $e){\n DB::rollback();\n\n return $this->response('error',[ $e->getMessage() ],Code::HTTP_BAD_REQUEST);\n }\n DB::commit();\n\n /**\n * Send SNS Notification\n */\n if($user->user_type === 'admin'){\n\n /**\n * Get All Users of Thread Id\n */\n $participant = $this->message->addWhere(['thread_id' => $chatCreated->thread_id])->addGroupBy('user_id')->fetch(FALSE,TRUE,FALSE);\n\n\n foreach ($participant as $key => $value){\n\n /**\n * Get All Devices of Users\n */\n $device = clone $this->device;\n $usersDevice = $device->addWhere(['user_id' => $value['user_id']])->fetch(FALSE,TRUE,FALSE);\n\n /**\n * Send Notif To ALl Mobile\n */\n if(count($usersDevice) !== 0){\n\n foreach ($usersDevice as $key => $value){\n\n Notification::sendToArn($chatCreated->chat,$value,['data' => $chatCreated],'mycasa_message');\n }\n }\n }\n }\n\n $joborder = $this->joborder->firstOrFail($joborder->id);\n\n return $this->response('success',$joborder,Code::HTTP_CREATED);\n\n }", "public function getActualOverheadWeightmentCharges(){\n return $this->hasMany(Overhead_weighment_charges::class, 'mfp_procurement_id', 'id'); \n }", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "function get_objectdescription2($Model) {\nglobal $camp_link; // link to campaign db\n\n\t$query = \"SELECT object_desc FROM object_properties WHERE Model = '$Model';\";\n\tif($result = $camp_link->query($query)) {\n\t\twhile ($obj = $result->fetch_object()) {\n\t\t\treturn($obj->object_desc);\n\t\t}\n\t} else {\n\t\techo \"$query<br />\\n\";\n\t\tdie('getObjectdescription2 query error [' . $camp_link->error . ']');\n\t}\n\t\t// free result set\n\t$result->free();\n}", "public function calc_hotel_management_fee_gst($price, $info, $hotel_code) \r\n\t{\r\n\t\t$dat = array();\r\n\t\t// $dat['status'] = false;\r\n\t\t$dat['data']['srv_chrg1c'] = 0;\r\n\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t$dat['status'] = true;\r\n\t\tif(!empty($info['c_user_id'] )) {\r\n\t\t\t$stmt = \"SELECT * FROM specific_markup_hotel where corporate_id = \". $info['c_user_id'] . \" AND hotel_id = \".$hotel_code .\" \";\r\n\t\t\t$query = $this->CI->db->query($stmt);\r\n\t\t\t$result = $query->result_array();\r\n\t\t} else {\r\n\t\t\t\r\n\t\t}\r\n\t\tif($query->num_rows > 0) {\r\n\t\t\t$result = $result[0];\r\n\t\t\tif($result['management_fee_type'] == 'plus') {\r\n\t\t\t\t$dat['data']['srv_chrg1c'] = $result['management_fee_value'];\r\n\t\t\t} else {\r\n\t\t\t\t// if percentage\r\n\t\t\t\t$m_fee = ($price * $result['management_fee_value'])/100;\r\n\t\t\t\t$dat['data']['srv_chrg1c'] = $m_fee;\r\n\r\n\t\t\t} // end if\r\n\r\n\t\t} \r\n\t\tif ( !empty($info['gst_state']) ) {\r\n\t\t\tif($info['gst_state'] == 27) {\r\n\t\t\t\t$dat['data']['serv_educ'] = $info['basic'] * 0.18;\r\n\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t$dat['status'] = true;\r\n\t\t\t} else {\r\n\t\t\t\t$dat['data']['serv_taxc'] = $info['basic'] * 0.18;\r\n\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t$dat['status'] = true;\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tif( !empty($info['gst_state_name']) ) {\r\n\t\t\t\tsimilar_text ( $info['gst_state_name'], 'maharashtra', $perc);\r\n\t\t\t\tif($perc > 50 ) {\r\n\t\t\t\t\t$dat['data']['serv_educ'] = $info['basic'] * 0.18;\r\n\t\t\t\t\t$dat['data']['serv_taxc'] = 0;\r\n\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$dat['data']['serv_taxc'] = $info['basic'] * 0.18;\r\n\t\t\t\t\t$dat['data']['serv_educ'] = 0;\r\n\t\t\t\t\t$dat['status'] = true;\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\treturn $dat;\r\n\r\n\t}", "public function run()\n {\n Cost::create($this->input(1, 1, 1, 87000, 8700, 0.9));\n Cost::create($this->input(1, 2, 1, 157000, 15700, 0.9));\n Cost::create($this->input(1, 3, 1, 214000, 21400, 0.9));\n Cost::create($this->input(1, 4, 1, 158000, 15800, 0.9));\n Cost::create($this->input(1, 5, 1, 258000, 25800, 0.9));\n Cost::create($this->input(1, 6, 1, 216000, 21600, 0.9));\n Cost::create($this->input(1, 7, 1, 171000, 17100, 0.9));\n Cost::create($this->input(1, 8, 1, 157000, 15700, 0.9));\n Cost::create($this->input(1, 9, 1, 253000, 25300, 0.9));\n Cost::create($this->input(1, 10, 1, 205000, 20500, 0.9));\n Cost::create($this->input(1, 11, 1, 245000, 24500, 0.9));\n Cost::create($this->input(1, 12, 1, 246000, 24600, 0.9));\n Cost::create($this->input(1, 13, 1, 136000, 13600, 0.9));\n }", "protected function calculatePrices()\n {\n }", "public function findCderAndFormatStockArr()\n {\n return null;\n\n $cderId = $this->getCderId();\n\n if(!$cderId ) return null;\n\n $capder = CAPDer::with(['range', 'make', 'NVDTechnical','NVDPrices' => function($query){\n $query->orderBy('PR_Id', 'DESC');\n } , 'standardOptions'])->find($cderId);\n\n $priceService = app(PricingService::class);\n $taxService = app(TaxCalculationService::class);\n $capPrice = $capder->NVDPrices->first();\n\n //FIXME thamesValley will give us purchase_price and retail price in excel sheet\n $purchasePrice = rand(5000,10000); //dummy implementation\n $retailPrice = $purchasePrice + ($purchasePrice * rand(5,20) / 100); //dummy implementation\n\n try{\n $price = $priceService->getNewCarPrice($purchasePrice, $retailPrice);\n }\n catch (\\Exception $e)\n {\n LogHelper::save('ERROR', new \\Exception($e->getMessage() .\"Excel data:\".json_encode($this->excelRow, JSON_PRETTY_PRINT)));\n return null;\n }\n\n if(!$this->isValidPrice($price))\n {\n LogHelper::save('ERROR', new \\Exception(\"Price problem :\". json_encode([$this->excelRow, $price], JSON_PRETTY_PRINT)));\n return null;\n }\n\n $stock = new \\stdClass();\n $stock->stock_ref = trim($this->excelRow->stk_no);\n $stock->chassis_no = $this->excelRow->chassis;\n $stock->car_type = $this->isNew() ? 'new' : 'used';\n $stock->make = $this->formatMake($capder->make->cman_name);\n $stock->model_id = $capder->range->cran_code;\n $stock->model = strtolower(trim($capder->range->cran_name));\n $stock->derivative_id = trim($capder->cder_ID);\n $stock->cap_code = trim($capder->cder_capcode);\n $stock->derivative = trim($capder->cder_name);\n $stock->supplier_spec = $this->excelRow->version;\n $stock->body_type = $capder->isConvertible() ? 'convertible' : CapDer::getBodyType(trim($capder->capmod->bodyStyle->bs_description));\n $stock->fuel_type = CAPDer::getFuelType(trim($capder->cder_fueltype));\n $stock->transmission = CAPDer::getTransmission(trim($capder->cder_transmission));\n $stock->colour_spec = strtolower($this->excelRow->colour);\n\n $colourService = app(ColourService::class);\n $stock->colour = $colourService->parse(strtolower($this->excelRow->colour));\n\n $stock->doors = $capder->cder_doors;\n $stock->standard_option = $capder->standardOptionsString;\n $stock->additional_option = trim($this->excelRow->options, ', ');\n $stock->additional_option_price = null;\n $stock->registration_no = null;\n $stock->registration_date = null;\n $stock->mpg = $this->getTechnicalData($capder->NVDTechnical, 'MPG');\n $stock->bhp = $this->getTechnicalData($capder->NVDTechnical, 'BPH');\n $stock->co2 = $this->getTechnicalData($capder->NVDTechnical, 'CO2');\n $stock->engine_size = $this->getTechnicalData($capder->NVDTechnical, 'ENGINE_SIZE');\n $stock->current_mileage = 0;\n $stock->grade = null;\n\n $stock->sale_location = $this->mapSaleLocation( 'thames_valley_tw_stock', $this->excelRow->location);\n $stock->cap_price = $capPrice->PR_Basic;\n $stock->vat = $capPrice->PR_Vat;\n $stock->delivery = $capPrice->PR_Delivery;\n\n $stock->purchase_price = $price['purchase_price'] ?? null;\n $stock->customer_price = $price['customer_price'] ?? null;\n $stock->customer_discount_percentage = $price['customer_discount_percentage'] ?? null;\n $stock->customer_discount_amount = $price['customer_discount_amount'] ?? null;\n $stock->purchase_discount_percentage = $price['purchase_discount_percentage'] ?? null;\n $stock->purchase_discount_amount = $price['purchase_discount_amount'] ?? null;\n $stock->current_price = $price['current_price'];\n\n $tax = $taxService->getTaxAmount( $stock->co2, $stock->fuel_type);\n $stock->tax_amount_six_month = $tax['6_months_tax'] ?? null;\n $stock->tax_amount_twelve_month = $tax['12_months_tax'] ?? null;\n return (array) $stock;\n }", "function calculate_delivery_cost($volume,$location_distance,$quantity){\n $total_volume = $volume * $quantity;\n // assume that the volume of space available in a motocycle is 500\n $motocycle_vol = 500;\n // assume that the volume of space available in a motocycle is 1000\n $cab_volume = 1000;\n if($total_volume <= $motocycle_vol){\n $means = 1; // 1 for motocycle ans 2 for cab\n }elseif ($total_volume <= $cab_volume && $total_volume > $motocycle_vol){\n $means = 2;\n }\n $cost_per_dist = ($means == 1)? 100 : 70;\n $total_cost = $cost_per_dist * $location_distance; // assume location distance is in km\n return $total_cost;\n}", "abstract protected function getModel();", "public function get_translation_fee()\n {\n $this->load->model('cases_model', 'cases');\n $this->load->model('currencies_model', 'currencies');\n $this->load->model('estimates_model', 'estimates');\n $case_number = $this->input->post('case_number');\n $number_words = $this->input->post('number_words');\n $country_id = $this->input->post('country_id');\n $translation_rate = $this->input->post('translation_rate');\n $estimate_fee_level = $this->input->post('estimate_fee_level');\n $estimate_currency = $this->input->post('estimate_currency');\n $translation_fee = 0;\n $currency_sign = '$';\n if (!is_null($case = $this->cases->find_case_by_number($case_number))) {\n $estimate_countries = $this->estimates->get_estimate_countries($case['id'], $case['user_id'], $estimate_fee_level);\n if (!is_null($customer_fees = $this->estimates->get_customer_fees_by_countries($case['user_id'], $case['case_type_id'], $case['case_number'], $estimate_countries, $case['entity']))) {\n $translation_fee = ceil($translation_rate * $number_words + $customer_fees[$country_id]['translation_rates_for_claims'] * $case['number_words_in_claims']);\n\n if ($estimate_currency == 'euro') {\n $currency_sign = '€';\n $euro_exchange_rate = $this->currencies->get_currency_rate_by_code('EUR');\n\n $translation_fee = ceil($translation_fee / $euro_exchange_rate);\n }\n }\n }\n echo $currency_sign . $translation_fee;\n }", "public function getWarehouseCharge( $mani_no)\n {\n $year = date('Y');\n $assessmentCreatedYear =$this->globalFunctionController->getAassessmentCreatedYear($mani_no);\n\n if ($assessmentCreatedYear) {\n $year = $assessmentCreatedYear;\n }\n//get slab charge variable globaly\n $firstSlabCharge = 0;\n $secondSlabCharge = 0;\n $thirdSlabCharge = 0;\n\n $firstSlabDay = 0;\n $secondSlabDay = 0;\n $thirdSlabDay = 0;\n\n $w = DB::select('SELECT ReceiveWeight,receive_date,deliver_date,goods_id,posted_yard_shed,package_no,m_id,yard_shed\n FROM(SELECT m.goods_id,m.package_no,m.id AS m_id,m.posted_yard_shed AS posted_yard_shed,m.approximate_delivery_date AS deliver_date,\n (SELECT truck_entry_regs.truckentry_datetime FROM truck_entry_regs WHERE truck_entry_regs.manf_id=m.id ORDER BY truck_entry_regs.manf_id DESC LIMIT 1)AS truckentry_datetime,\n (SELECT syws.unload_receive_datetime FROM shed_yard_weights AS syws \n JOIN truck_entry_regs AS trs ON trs.id=syws.truck_id \n JOIN manifests AS ms ON ms.id=trs.manf_id\n WHERE ms.manifest= m.manifest ORDER BY syws.unload_receive_datetime ASC LIMIT 1)AS receive_date,\n (SELECT yard_shed FROM yard_details WHERE m.posted_yard_shed=yard_details.id) AS yard_shed,\n (SELECT SUM(truck_entry_regs.tweight_wbridge) FROM truck_entry_regs WHERE truck_entry_regs.manf_id=m.id ORDER BY truck_entry_regs.id DESC LIMIT 1)AS ReceiveWeight\n FROM manifests m WHERE m.manifest=? \n )t', [$mani_no]);\n\n\n $receive_date = $w[0]->receive_date;\n $deliver_date = $w[0]->deliver_date;\n $goods_id = $w[0]->goods_id;\n $posted_yard_shed = $w[0]->posted_yard_shed;\n $yard_shed = $w[0]->yard_shed;\n $package_no = $w[0]->package_no;\n $item_wise_charge = null;\n $mani_id = $w[0]->m_id;\n\n $freeEndDay = $this->globalFunctionController->GetFreedayEndForWarehouseRent($mani_id, $receive_date);//return $receive_date + 3 days excluding holidays\n $ChargeStartDay = $this->globalFunctionController->ChargeStartDay($freeEndDay);\n $wareHouseRentDay = $this->globalFunctionController->number_of_working_days($receive_date, $ChargeStartDay, $deliver_date);\n\n\n if ($freeEndDay > $deliver_date) {\n $wareHouseRentDay = 0;\n }\n\n if ($wareHouseRentDay <= 0) {\n $freeEndDay = $deliver_date;\n }\n\n $check_the_port_has_tariff = DB::select('SELECT COUNT(ts.id) AS found_tariff FROM tariff_schedule AS ts WHERE ts.port_id=? AND ts.tariff_year=?', [Session::get('PORT_ID'), $year]);\n\n // dd($check_the_port_has_tariff[0]->found_tariff);\n\n if ($check_the_port_has_tariff[0]->found_tariff > 0) {\n // $tariff_port_id=Session::get('PORT_ID');\n\n\n $item_wise_yard_charge = DB::select('SELECT id.item_type,id.goods_id,id.dangerous,ts.yard_first_slab AS first_slab,ts.yard_second_slab AS second_slab,ts.yard_third_slab AS third_slab,ic.Description,\n (\n CASE id.item_type\n WHEN 4 THEN (CEIL (id.item_quantity/1000))\n ELSE id.item_quantity\n END\n ) AS item_quantity\n FROM item_details AS id \n JOIN tariff_schedule AS ts ON ts.goods_id=id.goods_id\n JOIN item_codes AS ic ON ic.id=id.item_Code_id\n WHERE id.manf_id=? AND ts.tariff_year=? AND id.yard_shed=0 AND id.port_id=? AND ts.port_id=?', [$mani_id, $year, Session::get('PORT_ID'), Session::get('PORT_ID')]);\n\n $item_wise_shed_charge = DB::select('SELECT id.item_type,id.goods_id,id.dangerous,ts.Shed_first_slab AS first_slab,ts.Shed_second_slab AS second_slab,ts.Shed_third_slab AS third_slab,ic.Description,\n (\n CASE id.item_type\n WHEN 4 THEN (CEIL (id.item_quantity/1000))\n ELSE id.item_quantity\n END\n ) AS item_quantity\n FROM item_details AS id \n JOIN tariff_schedule AS ts ON ts.goods_id=id.goods_id\n JOIN item_codes AS ic ON ic.id=id.item_Code_id\n WHERE id.manf_id=? AND ts.tariff_year=? AND id.yard_shed=1 AND id.port_id=? AND ts.port_id=?', [$mani_id, $year, Session::get('PORT_ID'), Session::get('PORT_ID')]);\n\n\n } else {\n\n $item_wise_yard_charge = DB::select('SELECT id.item_type,id.goods_id,id.dangerous,ts.yard_first_slab AS first_slab,ts.yard_second_slab AS second_slab,ts.yard_third_slab AS third_slab,ic.Description,\n (\n CASE id.item_type\n WHEN 4 THEN (CEIL (id.item_quantity/1000))\n ELSE id.item_quantity\n END\n ) AS item_quantity\n FROM item_details AS id \n JOIN tariff_schedule AS ts ON ts.goods_id=id.goods_id\n JOIN item_codes AS ic ON ic.id=id.item_Code_id\n WHERE id.manf_id=? AND ts.tariff_year=? AND id.yard_shed=0 AND id.port_id=? AND ts.port_id IS NULL', [$mani_id, $year, Session::get('PORT_ID')]);\n\n $item_wise_shed_charge = DB::select('SELECT id.item_type,id.goods_id,id.dangerous,ts.Shed_first_slab AS first_slab,ts.Shed_second_slab AS second_slab,ts.Shed_third_slab AS third_slab,ic.Description,\n (\n CASE id.item_type\n WHEN 4 THEN (CEIL (id.item_quantity/1000))\n ELSE id.item_quantity\n END\n ) AS item_quantity\n FROM item_details AS id \n JOIN tariff_schedule AS ts ON ts.goods_id=id.goods_id\n JOIN item_codes AS ic ON ic.id=id.item_Code_id\n WHERE id.manf_id=? AND ts.tariff_year=? AND id.yard_shed=1 AND id.port_id=? AND ts.port_id IS NULL', [$mani_id, $year, Session::get('PORT_ID')]);\n }\n\n\n $mani_id = DB::table('manifests AS a')\n ->where('a.manifest', [$mani_no])\n ->select('a.id')\n ->get();\n $warehouseRent = DB::table('assesment_details AS a')\n ->where('a.manif_id', $mani_id[0]->id)\n ->where('a.sub_head_id', 2)\n ->select('a.tcharge')\n ->get();\n\n\n\n\n//return 'first slab:'.$firstSlabCharge. ' Second slab:'.$secondSlabCharge.' Third slab:'.$thirdSlabCharge;\n $TotalSlabCharge = DB::select('SELECT ad.tcharge AS total_warehouse_charge FROM assesment_details AS ad WHERE ad.manif_id=? AND ad.sub_head_id=2 AND ad.partial_status=0', [$mani_id[0]->id]);\n\n //dd($mani_id[0]->id);\n\n if ($TotalSlabCharge) {\n $total_warehouse_charge = $TotalSlabCharge[0]->total_warehouse_charge;\n\n } else {\n $total_warehouse_charge = 0;\n }\n\n\n //get slab charge variable globaly\n $firstSlabCharge = 0;\n $secondSlabCharge = 0;\n $thirdSlabCharge = 0;\n\n $firstSlabDay = 0;\n $secondSlabDay = 0;\n $thirdSlabDay = 0;\n\n if ($wareHouseRentDay >= 1 && $wareHouseRentDay <= 21) {//1 slab will be calculated------------------1\n $firstSlabDay = $wareHouseRentDay;\n\n\n } else if ($wareHouseRentDay >= 22 && $wareHouseRentDay <= 50) {//2 slab will be calculated------------------2\n $firstSlabDay = 21;\n $secondSlabDay = ($wareHouseRentDay - 21);\n\n } else if ($wareHouseRentDay >= 51) {//3 slab will be calculated---------------------------------3\n $firstSlabDay = 21;\n $secondSlabDay = 29;\n $thirdSlabDay = ($wareHouseRentDay - 21 - 29);\n\n\n } else {\n\n $firstSlabDay = 0;\n $secondSlabDay = 0;\n $thirdSlabDay = 0;\n\n }\n\n\n return array(\n\n \"WareHouseRentDay\" => $wareHouseRentDay,\n 'FreeEndDate' => $freeEndDay,\n 'ChargeStartDay' => $ChargeStartDay,\n 'item_wise_shed_charge' => $item_wise_shed_charge,\n 'item_wise_yard_charge' => $item_wise_yard_charge,\n 'receive_date' => $receive_date,\n 'deliver_date' => $deliver_date,\n 'goods_id' => $goods_id,\n 'posted_yard_shed' => $posted_yard_shed,\n 'package_no' => $package_no,\n 'FirstSlabDay' => $firstSlabDay,\n 'SecondSlabDay' => $secondSlabDay,\n 'thirdSlabDay' => $thirdSlabDay,\n\n \"FirstSlabCharge\" => $firstSlabCharge,\n \"SecondSlabCharge\" => $secondSlabCharge,\n 'ThirdSlabCharge' => $thirdSlabCharge,\n 'TotalSlabCharge' => $total_warehouse_charge\n\n );\n\n }", "function getinvoicedatabyrefno($relation,$service_id )\n{\n\n$invoicemodel=Invoice::model()->findByAttributes(array('servicecall_id'=>$service_id));\n$a = explode( '|', $relation);\nreturn $invoicemodel[$a[1]];\n\n}", "public function getCreditModel($loanId)\n {\n $modelType = Config::get('constants.CONST_ANALYST_MODEL_TYPE_CREDIT');\n DB::enableQueryLog();\n $loan = null;\n $loanType = null;\n $amount = null;\n $loanTenure = null;\n $endUseList = null;\n $userProfile = null;\n $ratingModel = null;\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n }\n if (isset($loan)) {\n $loanType = $loan->type;\n $amount = $loan->loan_amount;\n $loanTenure = $loan->loan_tenure;\n $endUseList = $loan->end_use;\n $userId = $loan->user_id; \n $userProfile = UserProfile::where('user_id', '=', $userId)->get()->first();\n $ratingModel = AnalystModelRating::with('ratingDetails')->where('model_type', '=', $modelType)->where('loan_id', '=', $loanId)->get()->first();\n }\n $query = DB::getQueryLog();\n $analystModelsCategoriesList = AnalystModelCategory::with('dimensions', 'dimensions.measures')->where('type', '=', $modelType)->where('status', '=', 1)->get();\n\n if (isset($ratingModel)) {\n foreach ($ratingModel->ratingDetails as $ratingDetail) {\n foreach ($analystModelsCategoriesList as $category) {\n if ($category->mergeRecord($ratingDetail)) {\n break;\n }\n }\n }\n } else {\n //New Credit Model Being Saved\n $maxFY = MasterData::maxFY();\n $ratiosList = Ratio::where('loan_id', '=', $loanId)->where('period', '=', $maxFY)->get();\n $ratiosByRatioIdList = $ratiosList->keyBy('ratio_id');\n if (isset($ratiosByRatioIdList) && $ratiosByRatioIdList->count() > 0) {\n foreach ($analystModelsCategoriesList as $category) {\n $category->autoCalculateRatioMeasures($ratiosByRatioIdList);\n }\n }\n foreach ($analystModelsCategoriesList as $category) {\n $category->autoCalculateDefaults($loan);\n }\n }\n $yesNoOptions = MasterData::yesNoTypes(false);\n $creditRatingPointsList = new Collection(array_flip(MasterData::creditRatingPoints()));\n $validLoanHelper = new validLoanUrlhelper();\n $setDisable = null;\n $user = Auth::getUser();\n $setDisable = $this->getIsDisabled($user, true);\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $subViewType = 'loans.financial._analyst_credit_model';\n $formaction = 'Loans\\LoansController@postCreditModel';\n return view('loans.createedit', compact(\n 'subViewType',\n 'formaction',\n 'loan',\n 'loanId',\n 'loanType',\n 'endUseList',\n 'amount',\n 'loanTenure',\n 'analystModelsCategoriesList',\n 'yesNoOptions',\n 'userProfile',\n 'ratingModel',\n 'validLoanHelper',\n 'creditRatingPointsList',\n 'setDisable',\n 'loanUserProfile'\n ));\n }", "abstract function model();", "abstract function model();", "abstract function model();", "abstract function model();", "function calculateEnergyUse(){\n $this->boilerEnergy = $this->outletSteam->energyFlow + $this->blowdown->energyFlow - $this->feedwater->energyFlow;\n $this->fuelEnergy = $this->boilerEnergy / $this->boilerEff; \n $this->checkWarnings();\n }", "function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}", "public function getBaseTotalInvoicedCost();", "public function getInfoModel() {\n //\n // 3COM\n return PNMSnmp::get($this, '1.3.6.1.2.1.47.1.1.1.1.13.1', Yii::app()->params['cacheTtlGetSnmp']);\n }", "function getDataByID($strDataID)\n{\n global $db;\n $tbl = new cGaConsumablePurchase();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrTemp = getEmployeeInfoByID($db, $dataEdit[$strDataID]['id_employee'], \"employee_id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id_item'];\n $arrResult['dataRequestDate'] = $dataEdit[$strDataID]['request_date'];\n $arrResult['dataItemAmount'] = $dataEdit[$strDataID]['item_amount'];\n $arrResult['dataRemark'] = $dataEdit[$strDataID]['remark'];\n $arrResult['dataConsPurchaseNo'] = $dataEdit[$strDataID]['consumable_purchase_no'];\n $arrResult['dataConsReqNo'] = $dataEdit[$strDataID]['id_consumable_request'];\n //foreach($arrTripCost[$dataDonation ['trip_type']\n return $arrResult;\n}", "private function calculateCost() : void\n {\n $graph = [];\n $data = $this->data->whereNotIn('container_id', $this->containers);\n\n $countAccumulateProductTypes = count($this->accumulateProductTypes);\n foreach ($data as $key => $value) {\n $graph[$key] = $this->getCost($this->accumulateProductTypes, $value, $countAccumulateProductTypes);\n }\n $this->graph = collect($graph);\n }", "public function getModel() {\n if ($this->model) {\n return $this->model; \n }\n if (is_array($this->rawData)) {\n foreach ($this->rawData as $value) { \n if (preg_match('/(^CP-.*)/', $value, $m)) {\n $this->model = str_replace(\" \",\"\",$m[1]); \n break; \n }\n } \n }\n return $this->model;\n }", "function valore_costi_esterni_gas($id_ordine,$id_gas){\r\n\r\n $costo_trasporto = valore_costo_trasporto_ordine_gas($id_ordine,$id_gas); \r\n $costo_gestione = valore_costo_gestione_ordine_gas($id_ordine,$id_gas);\r\n $costi = $costo_trasporto+\r\n $costo_gestione;\r\n \r\n return (float)$costi; \r\n}", "function characterEquipment($character_id, $player_id, $journey_id, $store_id) {\n\t\n\t\taddToDebugLog(\"characterEquipment(), Function Entry - supplied parameters: Player ID: \" . $player_id . \"; Journey ID: \" . $journey_id . \"; Character ID: \" . $charcter_id . \"; Store ID: \" . $store_id . \", INFO\");\n\t\t\n\t\t// Get Character Name\n\t\t$character_name = getCharacterDetails($character_id, 'character_name');\n\t\n\t\techo \"<table cellpadding=3 cellspacing=0 border=1>\";\n\t\techo \"<tr><td colspan=5 align=center><h2>\" . $character_name . \"</h2></tr>\";\n\t\techo \"<tr bgcolor=#bbb><td>Item<td align=center>Weight<td align=center>Value<td align=center>Actions</tr>\";\n\t\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot NOT LIKE 'potion%' AND slot NOT LIKE 'pet%' ORDER BY slot ASC, ac_boost, attack_boost DESC;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\n\t\t// 0: ID\n\t\t// 1: Name\n\t\t// 2: AC Boost\n\t\t// 3: ATK Boost\n\t\t// 4: Weight\n\t\t// 5: Slot\n\t\n\t\t$weight_total = 0;\n\t\t$current_slot = \"\";\n\t\tfor ($e = 0; $e < $rows; $e++) {\n\t\n\t\t\tif ($result[$e][5] != $current_slot) {\n\t\t\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>\" . ucfirst($result[$e][5]) . \"</tr>\";\n\t\t\t\t$current_slot = $result[$e][5];\n\t\t\t}\n\t\n\t\t\t$bonus = $result[$e][2] + $result[$e][3];\n\t\t\techo \"<tr><td>+\" . $bonus . \" \" . $result[$e][1]; // Bonus + Item\n\t\t\techo \"<td align=center>\" . $result[$e][4]; // Weight\n\t\t\t\n\t\t\t//Value\n\t\t\t$value = $bonus * 50;\n\t\t\techo \"<td align=center>\" . $value;\n\t\n\t\t\t// Determine if the item of equipment is equipped or not\n\t\t\t$is_equipped = isEquipped($result[$e][5], $result[$e][0], $character_id);\n\t\t\t$weight_total = $weight_total + $result[$e][4];\n\t\t\tif ($is_equipped == 1) {\n\t\t\t\techo \"<td align=center bgcolor=#6f3>Equipped\";\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"<td align=center>\";\n\t\t\t\techo \"<a href='store.php?slot=\" . $result[$e][5] . \"&item_id=\" . $result[$e][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\t\techo \" | <a href='store.php?slot=\" . $result[$e][5] . \"&item_id=\" . $result[$e][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=equip&slot=\" . $result[$e][5] . \"'>Equip</a>\";\n\t\t\t}\n\t\t\t\t\n\t\t\techo \"</tr>\";\n\t\t\t\t\n\t\t}\n\t\n\t\t// Display Character potions\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot LIKE 'potion%' ORDER BY ac_boost, attack_boost DESC;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\t\n\n\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>Potions</tr>\";\n\t\t\n\t\tfor ($p = 0; $p < $rows; $p++) {\n\t\t\t\n\t\t\techo \"<tr><td>\" . $result[$p][1]; // Item\n\t\t\techo \"<td align=center>-\"; // Weight\n\t\t\t\t\n\t\t\t//Value\n\t\t\t$potion_name = explode(' ', $result[$p][1]);\n\t\t\t$value = $potion_name[3] * 100;\n\t\t\techo \"<td align=center>\" . $value;\n\t\t\t\n\t\t\t// Write actions Sell\n\t\t\techo \"<td align=center>\";\n\t\t\techo \"<a href='store.php?slot=\" . $result[$p][5] . \"&item_id=\" . $result[$p][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\techo \"</tr>\";\t\t\t\n\t\t\t\n\t\t}\n\n\t\t// Display Character pets\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE character_id = \" . $character_id . \" AND slot LIKE 'pet%';\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\t\n\t\techo \"<tr><td colspan=5 bgcolor=#ddd align=center>Pets</tr>\";\n\t\t\n\t\tfor ($p = 0; $p < $rows; $p++) {\n\t\t\t\t\n\t\t\t$details = explode(',', $result[$p][1]);\n\t\t\t$type = substr($result[$p][5], 4);\n\t\t\t\n\t\t\techo \"<tr><td>\" . $details[0] . \", Lvl \" . $details[1] . \" \" . ucfirst($type); // Item\n\t\t\techo \"<td align=center>-\"; // Weight\n\t\t\n\t\t\t//Value\n\t\t\t$value = ($details[1] * 500) + 5000;\n\t\t\techo \"<td align=center>\" . $value;\n\t\t\t\t\n\t\t\t// Write actions Sell\n\t\t\techo \"<td align=center>\";\n\t\t\techo \"<a href='store.php?slot=\" . $result[$p][5] . \"&item_id=\" . $result[$p][0] . \"&character_id=\" . $character_id . \"&player_id=\" . $player_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"&action=sell'>Sell</a>\"; // $slot, $item_id, $character_id\n\t\t\techo \"</tr>\";\n\t\t\t\t\n\t\t}\n\t\t\n\t\t// Get character strength\t\t\n\t\t$character_strength = getCharacterDetailsInfo($character_id, 'strength');\n\t\t$effects = getEffectBoosts($character_id);\n\t\t$traits = getTraitBoosts($character_id);\n\t\t$total_strength = $character_strength + $effects[\"str\"] + $traits[\"str\"];\n\t\t\n\t\techo \"<tr><td align=right>Total Weight<td align=center>\" . $weight_total;\n\t\techo \"<td align=center>\" . $total_strength . \"<td align=left>Strength</tr>\";\n\t\t\n\t\t// Character Gold\n\t\t$character_gold = getCharacterDetailsInfo($character_id,'gold');\n\t\techo \"<tr><td align=right colspan=2>Character Gold<td align=center>\" . $character_gold . \"<td></tr>\";\n\t\t\n\t\techo \"</table>\";\n\t \n\t}", "public function charges();", "public function getInfo($model);", "public function compute_prorate_cost($rs) {\n // Build up an array of weights to prorate against\n $weights = array();\n $this->prorated_costs = -1;\n $this->prorated_acc_costs = -1;\n $load_cost = $rs[0]['load_cost'];\n $accessorial_cost = $rs[0]['accessorial_cost'];\n if (!empty($load_cost) || !empty($accessorial_cost)) {\n foreach ($rs as $row) {\n $weights[$row['OplPoNum']] = $row['OplTotalWeight'] + $row['OplPalletWeight'];\n }\n\n $prorater = new \\Prorate();\n\n if (!empty($load_cost)) {\n $this->prorated_costs = $prorater->prorateValue($load_cost, $weights, 2);\n }\n\n if (!empty($accessorial_cost)) {\n $this->prorated_acc_costs = $prorater->prorateValue($accessorial_cost, $weights, 2);\n }\n }\n $this->use_costs = ($this->prorated_costs != -1);\n $this->use_acc_costs = ($this->prorated_acc_costs != -1);\n }", "function calc_value_potion ($level, $alch_perk, $phys_perk, $bene_perk, $pois_perk, $pure_perk) {\n\t\tdb_CRUD::select('ingredient_effect', 'eid, iid, magnitude_modifier, gold_modifier', \"iid in (select iid from effect where specials = 'y')\", 'eid');\n\t\t$nonStandard_data = db_CRUD::get_result();\n\t\t$cost_arr = array();\n\t\tforeach($this->temp_potion as $potion) {\n\t\t\t$cost_arr = array();\n\t\t\t//for each effect in potion: calculate price of effect\n\t\t\tforeach($potion->effect as $eff) {\n\t\t\t\t$select = \"eid, base_cost, base_magnitude, base_duration, poison, specials\";\n\t\t\t\t$where = \"eid = $eff\";\n\t\t\t\tdb_CRUD::select('effect', $select, $where);\n\t\t\t\t$result = db_CRUD::get_result();\n\t\t\t\t$mag_mod = 0;\n\t\t\t\t$gold_mod = 0;\n\t\t\t\t//if ingredient includes special variants: check if ingredient used is non-standard\n\t\t\t\tif($result[5] == 'y') {\n\t\t\t\t\tforeach($nonStandard_data as $nsd) {\n\t\t\t\t\t\tif($potion->ingredient1 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($potion->ingredient2 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($potion->ingredient_cnt == 3 && $potion->ingredient3 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$mag_mod = 1;\n\t\t\t\t\t$gold_mod = 1;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//specialized effect magnitude formulas\n\t\t\t\tif($eff != 30 && $eff != 34 && $eff != 50 && $eff != 49) {\n\t\t\t\t\t$mag = $result[2] * $mag_mod * 4 * pow(1.5, $level/100) * (1 + $alch_perk/100);\n\t\t\t\t\tif($eff == 46 || $eff == 47 || $eff || 48)\n\t\t\t\t\t\t$mag *= (1 + $phys_perk/100);\n\t\t\t\t\tif($result[5] == 'y')\n\t\t\t\t\t\t$mag *= (1 + $pois_perk/100);\n\t\t\t\t\telse\n\t\t\t\t\t\t$mag *= (1 + $bene_perk/100);\n\t\t\t\t\t$dur = $result[3];\n\t\t\t\t}\n\t\t\t\t//common effect duration formulas\n\t\t\t\telse {\n\t\t\t\t\t$dur = $result[3] * 4 * pow(1.5, $level/100) * (1 + $alch_perk/100);\n\t\t\t\t\tif($result[5] == 'y')\n\t\t\t\t\t\t$dur *= (1 + $pois_perk/100);\n\t\t\t\t\telse\n\t\t\t\t\t\t$mag *= (1 + $bene_perk/100);\n\t\t\t\t\t$mag = $result[2];\n\t\t\t\t}\n\t\t\t\tif($mag != 0 && $dur != 0) \n\t\t\t\t\t$eff_cost = floor($result[1] * $gold_mod * pow($mag, 1.1) * 0.0794328 * pow($dur, 1.1));\n\t\t\t\telse if($mag == 0)\n\t\t\t\t\t$eff_cost = floor($result[1] * $gold_mod * 0.0794328 * pow($dur, 1.1));\n\t\t\t\telse\n\t\t\t\t\t$eff_cost = floor($result[1] * pow($mag, 1.1));\n\t\t\t\t$cost_arr[] = array($eff_cost, $result[4]);\n\t\t\t} //end foreach $eff\n\t\t\t//if purity perk is active: find most valuable effect to decide potion/poison\n\t\t\tif($pure_perk == 'y') {\n\t\t\t\t$max = 0;\n\t\t\t\t$x = 0;\n\t\t\t\tforeach($cost_arr as $i => $cost) {\n\t\t\t\t\tif($cost[0] > $max) {\n\t\t\t\t\t\t$max = $cost[0];\n\t\t\t\t\t\t$x = $i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$potion->poison = $cost_arr[$x][1];\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($cost_arr as $cost) {\n\t\t\t\t\tif($cost[1] == $cost_arr[$x][1]) {\n\t\t\t\t\t\t$total += $cost[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if no purity perk, sum all effect values\n\t\t\telse {\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($cost_arr as $cost) {\n\t\t\t\t\t$total += $cost[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$potion->value = $total;\n\t\t} //end foreach $potion\n\t}", "abstract protected function model();", "abstract protected function model();" ]
[ "0.6441135", "0.6173662", "0.60810155", "0.6068854", "0.5973467", "0.594401", "0.59191006", "0.57530713", "0.57348126", "0.5643641", "0.5623484", "0.56046253", "0.55899996", "0.5576606", "0.55431503", "0.5489911", "0.54556817", "0.5444968", "0.5442407", "0.5439247", "0.54386044", "0.54301053", "0.5408218", "0.53922635", "0.5372855", "0.5344261", "0.53437626", "0.533622", "0.5334882", "0.53106964", "0.53096217", "0.52967155", "0.5293385", "0.52931166", "0.5281532", "0.52757573", "0.5256811", "0.52509874", "0.52237886", "0.5183185", "0.51812255", "0.5178581", "0.5165411", "0.5165411", "0.5165411", "0.51534414", "0.51466906", "0.5145076", "0.51449895", "0.51444954", "0.51392525", "0.5137816", "0.5137061", "0.51286376", "0.5124924", "0.5123961", "0.511928", "0.5114081", "0.51053023", "0.5100823", "0.50994647", "0.5099076", "0.5090618", "0.5044236", "0.5044236", "0.5044236", "0.5044236", "0.5044236", "0.5044236", "0.5044236", "0.50363773", "0.5036142", "0.502659", "0.5023579", "0.50206083", "0.50167966", "0.5013728", "0.50060755", "0.50024194", "0.50013644", "0.50003576", "0.49929035", "0.49929035", "0.49929035", "0.49929035", "0.4987596", "0.4979349", "0.49773285", "0.4976658", "0.49723732", "0.49703532", "0.4956054", "0.49427828", "0.49420694", "0.49360016", "0.493361", "0.49322316", "0.49302414", "0.4925757", "0.4925757" ]
0.71803933
0
08.26.2015 ghh added to make sure nothing nasty can be sent through any of the vars given to merx.
function safetycheck( $vars, $responsetype ) { //08.26.2015 ghh - first we figure out if we're dealing with get or //post because we can work directly with get but need to convert post //from json object if ( $responsetype == 'get' ) { foreach ( $vars as $v ) $temp[] = addslashes( $v ); return $temp; } else { return $vars; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _pog($v) {\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : (isset($_GET[$v]) ? bwm_clean($_GET[$v]) : NULL);\r\n}", "function check_required_vars($params = array())\n\t{\n\t\tglobal $SID, $phpEx, $data;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (empty($data[$param]))\n\t\t\t{\n\t\t\t\tredirect(append_sid(\"garage.$phpEx?mode=error&EID=3\", true));\n\t\t\t}\n\t\t}\n\n\t\treturn ;\n\t}", "function rescue_shortened_post_request()\n{\n global $MODSECURITY_WORKAROUND_ENABLED;\n if ($MODSECURITY_WORKAROUND_ENABLED) {\n return;\n }\n\n $setting_value = mixed();\n $setting_name = mixed();\n foreach (array('max_input_vars', 'suhosin.post.max_vars', 'suhosin.request.max_vars') as $setting) {\n if ((is_numeric(ini_get($setting))) && (intval(ini_get($setting)) > 10)) {\n $this_setting_value = intval(ini_get($setting));\n if (($setting_value === null) || ($this_setting_value < $setting_value)) {\n $setting_value = $this_setting_value;\n $setting_name = $setting;\n }\n }\n }\n\n if (($setting_value !== null) && ($setting_value > 1/*sanity check*/)) {\n if ((count($_POST) >= $setting_value - 5) || (array_count_recursive($_POST) >= $setting_value - 5)) {\n if ((has_zone_access(get_member(), 'adminzone')) || (running_script('upgrader'))) {\n $post = parse_raw_http_request();\n if ($post !== null) {\n $_POST = $post;\n return;\n }\n }\n\n warn_exit(do_lang_tempcode('_SUHOSIN_MAX_VARS_TOO_LOW', escape_html($setting_name)));\n }\n }\n}", "protected function wrong_arguments() {\n\t\t\twp_die();\n\t\t}", "private static function checkRequest(): void\n {\n if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {\n Core::fatalError(__('GLOBALS overwrite attempt'));\n }\n\n /**\n * protect against possible exploits - there is no need to have so much variables\n */\n if (count($_REQUEST) <= 1000) {\n return;\n }\n\n Core::fatalError(__('possible exploit'));\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }", "function c_request($varstipus,$origen,$strict=false)\n{\n\tif (!is_array($origen))\t{$origen=merge_request($origen);} \t//en comptes d'un array, passa PG o similar \n\n\t$pattern=array('REAL'=>\"/[^0-9\\.-]/\",'CHAR'=>\"/[^A-Za-z0-9_\\-\\.]/\",'STRING'=>\"/\\\"|'/\");\n\t$varstipus=explode(\",\",$varstipus);\n\tforeach ($varstipus as $vargrup)\n\t{\n\t\t$vargrup=explode(\"=>\",$vargrup);\n\t\t$vars=explode(\"|\",$vargrup[0]);\n\t\t$tipus=trim(strtoupper($vargrup[1]));\n\n\t\tforeach ($vars as $var)\n\t\t{\n\t\t\t$var=trim($var);\n\t\t\tif (isset($origen[$var]))\n\t\t\t{\n\t\t\t\tswitch($tipus)\n\t\t\t\t{\n\t\t\t\t\tcase 'INT':\t//nomès numeros enters\n\t\t\t\t\t\t$origen[$var]=(int)$origen[$var];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'MQ':\n\t\t\t\t\t\t$origen[$var]=MQ($origen[$var]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 'REAL': //numeros decimals i negatius\n\t\t\t\t\tcase 'CHAR': //nomes texte i números\n\t\t\t\t\tcase 'STRING': //eliminar cometes\n\t\t\t\t\t\t$origen[$var]=preg_replace($pattern[$tipus], $strict?\"_\":\"\", $origen[$var]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn $origen;\n}", "function strict() {\r\n\t\treturn true;\r\n\t}", "function process_str_vars($params = array())\n\t{\n\t\tglobal $HTTP_POST_VARS, $HTTP_GET_VARS;\n\n\t\twhile( list($var, $param) = @each($params) )\n\t\t{\n\t\t\tif (!empty($HTTP_POST_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_POST_VARS[$param])));\n\t\t\t}\n\t\t\telse if (!empty($HTTP_GET_VARS[$param]))\n\t\t\t{\n\t\t\t\t$data[$param] = str_replace(\"\\'\", \"''\", trim(htmlspecialchars($HTTP_GET_VARS[$param])));\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "function repeatVars() {\n\treturn false;\n}", "function cc_post_fail_if_not_valid( $var ) {\n\tif ( !cc_post_is_valid( $var ) ) {\n\t\tthrow new IllegalSuperglobalException( $var, '_POST',\n\t\t\t\t\t\t PostVariables::val() );\n\t}\n}", "function input_check_mailinj($value, $sendto)\n{\n # mail adress(ess) for reports...\n $report_to = $sendto;\n\n # array holding strings to check...\n $suspicious_str = array\n (\n\t \"content-type:\"\n\t ,\"charset=\"\n\t ,\"mime-version:\"\n\t ,\"multipart/mixed\"\n\t ,\"bcc:\"\n );\n\n // remove added slashes from $value...\n $value = stripslashes($value);\n\n //SETUP REPLY EMAIL ADDRESS\n $fifth = '-f ' . $report_to;\n\n //SETUP THE FROM ADDRESS\n $headers = \"From: <\" . $report_to . \">\\n\";\n $headers .= \"MIME-Version: 1.0\\n\";\n $headers .= \"Content-type: text/plain; charset=iso-8859-1\\r\\n\";\n $email_body = '<table width=\"100%\" border=\"0\"\n cellspacing=\"0\" cellpadding=\"0\"\nstyle=\"font-family:Vivaldi;font-size:12px;text-align:left\">'.\"\\n\";\n\n\n foreach($suspicious_str as $suspect)\n {\n\t # checks if $value contains $suspect...\n\t if(eregi($suspect, strtolower($value)))\n\t {\n\t\t // replace this with your own get_ip function...\n\t\t $ip = (empty($_SERVER['REMOTE_ADDR'])) ? 'empty'\n\t\t\t : $_SERVER['REMOTE_ADDR'];\n\t\t $rf = (empty($_SERVER['HTTP_REFERER'])) ? 'empty'\n\t\t\t : $_SERVER['HTTP_REFERER'];\n\t\t $ua = (empty($_SERVER['HTTP_USER_AGENT'])) ? 'empty'\n\t\t\t : $_SERVER['HTTP_USER_AGENT'];\n\t\t $ru = (empty($_SERVER['REQUEST_URI'])) ? 'empty'\n\t\t\t : $_SERVER['REQUEST_URI'];\n\t\t $rm = (empty($_SERVER['REQUEST_METHOD'])) ? 'empty'\n\t\t\t : $_SERVER['REQUEST_METHOD'];\n\n\t\t # if so, file a report...\n\t\t if(isset($report_to) && !empty($report_to))\n\t\t {\n\t\t\t @mail\n\t\t\t (\n\t\t\t\t\t $report_to\n\t\t\t\t ,\"[ABUSE] mailinjection @ \" .\n\t\t\t\t $_SERVER['HTTP_HOST'] . \" by \" . $ip\n\t\t\t\t ,\"Stopped possible mail-injection @ \" .\n\t\t\t\t $_SERVER['HTTP_HOST'] . \" by \" . $ip .\n\t\t\t\t \" (\" . date('d/m/Y H:i:s') . \")\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** IP/HOST\\r\\n\" . $ip . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** USER AGENT\\r\\n\" . $ua . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REFERER\\r\\n\" . $rf . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REQUEST URI\\r\\n\" . $ru . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REQUEST METHOD\\r\\n\" . $rm . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** SUSPECT\\r\\n--\\r\\n\" . $value . \"\\r\\n--\"\n\t\t\t\t\t , $headers, $fifth\n\t\t\t );\n\t\t }\n\n\t\t # ... and kill the script.\n\t\t die\n\t\t (\n\t\t\t '<p>Script processing cancelled: string\n\t\t\t (`<em>'.$value.'</em>`) contains text portions that\n\t\t\t are potentially harmful to this server. <em>Your input\n\t\t\t has not been sent!</em> Please try\n\t\t\t rephrasing your input.</p>'\n\t\t );\n\t }\n }\n}", "function strict() {\n return false;\n }", "function extraVars() {\n\t\tif (func_num_args()) {\n\t\t\tif (is_array(func_get_arg(0))) {\n\t\t\t\t$this->_extraVars = func_get_arg(0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->_extraVars = array(func_get_arg(0)=>'');\n\t\t\t}\t\t\t\n\t\t}\n\t\telse return $this->_extraVars;\n\t}", "function check_all_incomming_vars($request_array, $save_name = null) {\n//checks all the incomming vars\n// V0.8 forces the use of an non empty array\n// if (empty($request_array)) {\n// $request_array = $_REQUEST;\n// } else {\n if (!is_array($request_array)) {\n die(__FUNCTION__ . \" need an array to work\");\n }\n// }\n $form = array();\n foreach ($request_array as $index => $value) {\n if (!is_array($value)) {\n $form[$index] = \\k1lib\\forms\\check_single_incomming_var($value);\n } else {\n $form[$index] = check_all_incomming_vars($value);\n }\n }\n if (!empty($save_name)) {\n \\k1lib\\common\\serialize_var($form, $save_name);\n }\n return $form;\n}", "function fix_request(){\n\t$var=array();\n\tforeach($_GET as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_GET[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\tforeach($_POST as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_POST[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\t$_REQUEST=$var;\n}", "private function reworkArgs() {\n $this->functionArgs = array_diff(self::goodSplit($this->functionArgs, ','), array(''));\n }", "function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }", "Public function validateHacker($var)\n\t\t{\n\t\t\t$CadenasProhibidas = array(\"Content-Type:\",\n\t\t\t\"MIME-Version:\", //evita email injection\n\t\t\t\"Content-Transfer-Encoding:\",\n\t\t\t\"Return-path:\",\n\t\t\t\"Subject:\",\n\t\t\t\"From:\",\n\t\t\t\"Envelope-to:\",\n\t\t\t\"To:\",\n\t\t\t\"bcc:\",\n\t\t\t\"cc:\",\n\t\t\t\"UNION\", // evita sql injection\n\t\t\t\"DELETE\",\n\t\t\t\"DROP\",\n\t\t\t\"SELECT\",\n\t\t\t\"INSERT\",\n\t\t\t\"UPDATE\",\n\t\t\t\"CRERATE\",\n\t\t\t\"TRUNCATE\",\n\t\t\t\"ALTER\",\n\t\t\t\"INTO\",\n\t\t\t\"DISTINCT\",\n\t\t\t\"GROUP BY\",\n\t\t\t\"WHERE\",\n\t\t\t\"RENAME\",\n\t\t\t\"DEFINE\",\n\t\t\t\"UNDEFINE\",\n\t\t\t\"PROMPT\",\n\t\t\t\"ACCEPT\",\n\t\t\t\"VIEW\",\n\t\t\t\"COUNT\",\n\t\t\t\"HAVING\",\n\t\t\t\n\t\t\t\"'\",\n\t\t\t'\"',\n\t\t\t\"{\",\n\t\t\t\"}\",\n\t\t\t\"[\",\n\t\t\t\"]\",\n\t\t\t\"HOTMAIL\", // evita introducir direcciones web\n\t\t\t\"WWW\",\n\t\t\t\".COM\",\n\t\t\t\"@\",\n\t\t\t\"W W W\",\n\t\t\t\". c o m\",\n\t\t\t\"http://\",\n\t\t\t\"$\", //variables y comodines\n\t\t\t\"&\",\n\t\t\t\"*\"\n\t\t\t); \n\t\t\t//Comprobamos que entre los datos no se encuentre alguna de \n\t\t\t//las cadenas del array. Si se encuentra alguna cadena se \n\t\t\t//dirige a una página de Forbidden \n\t\t\t$vandera=\"\";\n\t\t\tforeach($CadenasProhibidas as $valor)\n\t\t\t{ \n\t\t\t\tif((strpos(strtolower($var), strtolower($valor)) !== false))\n\t\t\t\t{ \n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function checkAllParams(){\n\t\tif(isset($_REQUEST['appid'][100]) || isset($ref[1000]) || isset($_REQUEST['uid'][200]) ){\n\t\t\tthrow new Exception('paramater length error',10001);\n\t\t}\n\t\tif(isset($_REQUEST['ref']))$_REQUEST['ref']=substr($_REQUEST['ref'], 0,990);\n\t\t\n\t\tif(!$this->check(\"appid\",$_REQUEST['appid']) && !isset($_REQUEST['json'])){\n\t\t\t//ea_write_log(APP_ROOT.\"/error_log/\".date('Y-m-d').\".log\", \"error_appid=\".$_REQUEST['appid'].\" \".$_REQUEST['event'].\" \".$_REQUEST['logs'].\" \\n\");\n\t\t\tthrow new Exception('appid error',10001);\n\t\t}\n\t\t\n\t\t$_REQUEST['appid']=strtolower($_REQUEST['appid']);\n\t\t$this->appidmap();\n\t}", "function sanitization_allowed() {\n\n\t$foo = (int) $_POST['foo']; // OK.\n\t$bar = sanitize_key( $_POST['bar'] ); // OK.\n\n\tcheck_ajax_referer( \"something-{$foo}-{$bar}\" );\n}", "function _postn($v) {\r\n $r = isset($_POST[$v]) ? bwm_clean($_POST[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "function pred(...$vars)\n {\n pre(...$vars);\n die();\n }", "function fix() ;", "function prepare_vars_for_template_usage()\n {\n }", "function yy_r139()\n {\n if ($this->security && substr($this->yystack[$this->yyidx + - 3]->minor, 0, 1) == '_') {\n $this->compiler->error(self::Err1);\n }\n $this->_retvalue = $this->yystack[$this->yyidx + - 3]->minor . \"(\" . implode(',', $this->yystack[$this->yyidx + - 1]->minor) . \")\";\n }", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "function required_param($parname, $type=PARAM_CLEAN, $errMsg=\"err_param_requis\") {\n\n // detect_unchecked_vars addition\n global $CFG;\n if (!empty($CFG->detect_unchecked_vars)) {\n global $UNCHECKED_VARS;\n unset ($UNCHECKED_VARS->vars[$parname]);\n }\n\n if (isset($_POST[$parname])) { // POST has precedence\n $param = $_POST[$parname];\n } else if (isset($_GET[$parname])) {\n $param = $_GET[$parname];\n } else {\n erreur_fatale($errMsg,$parname);\n }\n // ne peut pas �tre vide !!! (required)\n $tmpStr= clean_param($param, $type); //PP test final\n // attention \"0\" est empty !!!\n\n if (!empty($tmpStr) || $tmpStr==0) return $tmpStr;\n else erreur_fatale(\"err_param_suspect\",$parname.' '.$param. \" \".__FILE__ );\n\n\n}", "function remove_unexpected_superglobals($superGlobal, $allowedKeys) {\n foreach ($superGlobal as $key => $val) {\n if (!in_array($key, $allowedKeys))\n unset($superGlobal[$key]);\n }\n return $superGlobal;\n}", "private function parse_args() {\n\t\t//exit;\t\t\n\t}", "function wp_fix_server_vars()\n {\n }", "function page_preprocess_blog(&$vars, $fw = NULL) {\n\t\tforeach($vars['catch_args'] AS &$arg) {\n\t\t\t$arg .= ' - snip';\n\t\t}\n\t}", "function tryAssignInputVars(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t$toreturn = true;\n\t\n\tif(isset($_POST['nric'])) { $nric = $_POST['nric']; }\n\tif(isset($_POST['firstName'])) { $firstName = $_POST['firstName']; }\n\tif(isset($_POST['lastName'])) {$lastName = $_POST['lastName']; }\n\tif(isset($_POST['dob'])) { $dob =$_POST['dob'];}\n\tif(isset($_POST['address1'])) { $address1= $_POST['address1'];}\n\tif(isset($_POST['address2'])) { $address2 = $_POST['address2']; }\n\tif(isset($_POST['poCode'])) { $poCode = $_POST['poCode']; }\n\tif(isset($_POST['homeNum'])) { $homeNum = $_POST['homeNum']; }\n\tif(isset($_POST['handphoneNum'])) { $handphoneNum = $_POST['handphoneNum']; }\n\tif(isset($_POST['email'])) {$email = $_POST['email']; }\n\tif(isset($_POST['description'])) { $description = $_POST['description']; }\n\tif(isset($_POST['faID'])) { $faID = $_POST['faID']; }\n\t\n\treturn $toreturn;\n}", "function avoidgather( )\n{\n global $rsdb;\n global $webdb;\n global $IS_BIZPhp168;\n if ( !$IS_BIZPhp168 )\n {\n return;\n }\n if ( $webdb[AvoidCopy] )\n {\n $rsdb[content] = \"<body oncopy='return false' oncut='return false'>{$rsdb['content']}\";\n }\n if ( $webdb[AvoidSave] )\n {\n $rsdb[content] = \"{$rsdb['content']}<noscript><iframe scr='*.htm'></iframe></noscript>\";\n }\n if ( !$webdb[AvoidGather] )\n {\n return;\n }\n $AvoidGatherpre = rands( 3 ).$webdb[AvoidGatherPre].rands( 3 );\n $rsdb[content] = \"<div class='{$AvoidGatherpre}'>{$webdb['AvoidGatherString']}</div>{$rsdb['content']}<div class='{$AvoidGatherpre}'>{$webdb['AvoidGatherString']}</div>\";\n $AvoidGatherpre = rands( 3 ).$webdb[AvoidGatherPre].rands( 3 );\n $rsdb[content] = str_replace( \"<br>\", \"<br><div class='{$AvoidGatherpre}'>{$webdb['AvoidGatherString']}{$AvoidGatherpre}</div>\", $rsdb[content] );\n $rsdb[content] = str_replace( \"<BR>\", \"<BR><div class='{$AvoidGatherpre}'>{$webdb['AvoidGatherString']}{$AvoidGatherpre}</div>\", $rsdb[content] );\n $AvoidGatherpre = rands( 3 ).$webdb[AvoidGatherPre].rands( 3 );\n $rsdb[content] = str_replace( \"<p>\", \"<p><div class='{$AvoidGatherpre}'>{$webdb['AvoidGatherString']}{$AvoidGatherpre}</div>\", $rsdb[content] );\n}", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->login = trimStrip($_POST['login']);\n $this->surname = trimStrip($_POST['surname']);\n $this->firstname = trimStrip($_POST['firstname']);\n $this->hash = trimStrip($_POST['hash']);\n $this->yearno = (integer)trimStrip($_POST['yearno']);\n $this->groupno = (integer)trimStrip($_POST['groupno']);\n $this->email = trimStrip($_POST['email']);\n $this->calendaryear = intval($_POST['calendaryear']);\n $this->coeff = (float)$_POST['coeff'];\n }", "function xthreads_check_condstr($s) {\r\n\trequire_once MYBB_ROOT.'inc/xthreads/xt_phptpl_lib.php';\r\n\txthreads_sanitize_eval($s);\r\n\treturn xthreads_check_evalstr($s);\r\n}", "function get_post_var($var)\r\n{\r\n if (isset($_POST[$var]) AND !empty($_POST[$var])) {\r\n $val = $_POST[$var];\r\n return sanitizeAny($val);\r\n } else {\r\n return null;\r\n }\r\n}", "function _post($v) { // clean Post - returns a useable $_POST variable or NULL if and only if it is not set\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : NULL;\r\n}", "private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }", "private function _mailtoHack($vars)\n\t{\n\t\tif (!version_compare(JVERSION, '3.0', 'ge') || empty($vars['option']) || empty($vars['link']))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tif ($vars['option'] == 'com_mailto' && empty($vars['view']))\n\t\t{\n\t\t\tJRequest::setVar('link', $vars['link']);\n\t\t}\n\t}", "function wddx_serialize_vars($var_name, $_ = NULL)\n{\n}", "function bar() {\n\t\tif ( empty( $_POST['test'] ) ) { // Bad.\n\t\t\treturn;\n\t\t}\n\n\t\tdo_something( $_POST['test'] ); // Bad.\n\t}", "function AdditionalVars ( $cAdditionalVars=null )\n{\n if ( isset($cAdditionalVars) ) {\n // 由於 serialize 物件時 private 變數會在前面加上 \"\\0類別名稱\\0\", 而 protected 變數\n // 則前面加上 \"\\0*\\0\", 因此不可直接用 trim() 會將最前面的 NULL 字元去掉.\n // 而 perl regular expression 的 \"\\s\" 空白字元僅包含 \" \\t\\n\\r\\f\", 不影響 NULL\n $this->_AdditionalVars = is_array($cAdditionalVars)\n ? $cAdditionalVars\n : preg_split('/\\s*,\\s*/',trim($cAdditionalVars,\" \\t\\r\\n\\f\"));\n return true;\n } else {\n return $this->_AdditionalVars;\n }\n}", "function submission_scrub($value) {\n $bad_things = array('to:','cc:','bcc:','content-type:','mime-version:','multipart-mixed:','content-transfer-encoding:');\n\n // if any of the bad things are in the submission, return an empty string\n foreach ($bad_things as $v) { \n if (stripos($value, $v) !==false)\n return '';\n } \n // replace any newline characters with spaces\n $value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\n // return the value\n return trim($value);\n }", "public function quash_unused() {\n\t\t// Don't put any code in here.\n\t}", "protected function _fixX($x) {}", "function sanitize(){\r\n\t\t $outar = Array();\r\n \t $arg_list = func_get_args();\r\n\t\t foreach($arg_list[0] as $key => $value){\r\n\t\t\t\t $data = $value;\r\n\t\t\t\t $data = PREG_REPLACE(\"/[^0-9a-zA-Z]/i\", '', $data);\r\n\t\t\t\t array_push($outar,$data);\r\n\t\t }\r\n\t\treturn $outar;\r\n\t }", "function cleanString($name) {\n\t\tif (isset($this->getvars[$name])){\n\t\t\t$val = $this->getvars[$name];\n\t\t} else {\n\t\t\t$val = @$this->postvars[$name];\n\t\t}\n\t\tif ($val == '') {\n\t\t\treturn '';\n\t\t}\n\t\tif (is_array($val)) {\n\t\t\tarray_walk_recursive($val, array('Cgn', 'removeCtrlChar'));\n\t\t} else {\n\t\t \tCgn::removeCtrlChar($val);\n\t\t\t$val = (string)$val;\n\t\t}\n\t\treturn $val;\n\n\t}", "public static function UnwantedParameters($chars = array())\n {\n global $application_unwanted_params;\n $application_unwanted_params = $chars;\n }", "function foo_3() {\n\tbar( $_POST['var'] ); // WPCS: CSRF OK.\n\tbar( $_POST['var'] ); // Bad.\n}", "function _wp_register_meta_args_whitelist($args, $default_args)\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "function spam_scrubber($value) {\n\t\t\n\t\t// list of very bad values\n\t\t$very_bad = array('to:', 'cc:', 'bcc:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:');\n\t\t\n\t\t//if any of the very bad strings are in submitted value, return empty string\n\t\tforeach ($very_bad as $v) {\n\t\t\tif (stripos($value, $v) !== false) return '';\n\t\t}\n\t\t\n\t\t// replace any newline characters with spaces:\n\t\t$value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\t\t\n\t\t//return the value\n\t\treturn trim($value);\n\t}", "function wheels_request_filter( $query_vars ) {\n\tif ( isset( $_GET['s'] ) && empty( $_GET['s'] ) && ! is_admin() ) {\n\t\t$query_vars['s'] = ' ';\n\t}\n\n\treturn $query_vars;\n}", "abstract protected function prepareVars(array $data);", "function getVars() {\r\n return !empty($_POST) ? $_POST : (!empty($_GET) ? $_GET : NULL);\r\n }", "function yy_r119(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r148(){$this->_retvalue = '||'; }", "function cleanMultiLine($name) {\n\t\tif (isset($this->getvars[$name])){\n\t\t\t$val = $this->getvars[$name];\n\t\t} else {\n\t\t\t$val = @$this->postvars[$name];\n\t\t}\n\t\tif ($val == '') {\n\t\t\treturn '';\n\t\t}\n\t\t$allow = array();\n\t\t$allow[] = ord(\"\\t\");\n\t\t$allow[] = ord(\"\\n\");\n\t\t$allow[] = ord(\"\\r\");\n\n\t\tif (is_array($val)) {\n\t\t\tarray_walk_recursive($val, array('Cgn', 'removeCtrlChar'), $allow);\n\t\t} else {\n\t\t \tCgn::removeCtrlChar($val, NULL, $allow);\n\t\t\t$val = (string)$val;\n\t\t}\n\t\treturn $val;\n\n\t}", "protected function sanitize() {}", "function yy_r134()\n {\n if ($this->security) {\n $this->compiler->error(self::Err2);\n }\n $this->_retvalue = '->{' . $this->yystack[$this->yyidx + - 1]->minor . $this->yystack[$this->yyidx + 0]->minor . '}';\n }", "function cleanMyPost($poster) {\n $critter = $poster; //great, set to post \n $arr = explode(\"(\", $critter);\n $critter = implode(\" \", $arr);\n $arr = explode(\")\", $critter);\n $critter = implode(\" \", $arr);\n $arr = explode(\"'\", $critter);\n $critter = implode(\" \", $arr);\n $arr = explode(\"-\", $critter);\n $critter = implode(\" \", $arr);\n $arr = explode(\"\\\\\", $critter);\n $critter = implode(\" \", $arr);\n return $critter;\n }", "function yy_r106()\n {\n if ($this->yystack[$this->yyidx + 0]->minor['var'] == 'smarty') {\n $this->_retvalue = $this->compiler->compileTag('Internal_SpecialVariable', array(), $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);\n } else {\n $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']) . $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];\n }\n }", "function fix_magic_quotes() {\n\tglobal $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;\n\n\t// clean gpc of slashes\n\tif (!get_magic_quotes_gpc()) {\n\t\treturn false;\n\t}\n\n\t$_GET = transcribe($_GET);\n\t$_POST = transcribe($_POST);\n\t$_COOKIE = transcribe($_COOKIE);\n\t$_REQUEST = transcribe($_REQUEST);\n\n\t$HTTP_GET_VARS = $_GET;\n\t$HTTP_POST_VARS = $_GET;\n\t$HTTP_COOKIE_VARS = $_COOKIE;\n\n\treturn true;\n\n}", "function getSanitizedValues() {\r\n //TODO: actually clean the values. Could probably put it in the \r\n // case above...\r\n //\r\n //TDOD: consider using $_POST instead of $_GET!\r\n //\r\n // Also, this is probably overkill when we could just copy the\r\n // entirety of $_POST...not that we can guarantee people won't\r\n // jam malicious data into it.\r\n $cleanVals = array();\r\n $cleanVals['datetime'] = date(GlApp::DATE_FORMAT, strtotime($_REQUEST['datetime']));\r\n $cleanVals['mileage'] = $_REQUEST['mileage'];\r\n $cleanVals['location'] = $_REQUEST['location'];\r\n $cleanVals['pricepergallon'] = $_REQUEST['pricepergallon'];\r\n $cleanVals['gallons'] = $_REQUEST['gallons'];\r\n $cleanVals['grade'] = $_REQUEST['grade'];\r\n $cleanVals['pumpprice'] = $_REQUEST['pumpprice'];\r\n $cleanVals['notes'] = htmlspecialchars($_REQUEST['notes']);\r\n \r\n return $cleanVals;\r\n}", "private function checkFields()\r\n {\r\n $vars = array('user', 'pass', 'numbers', 'message', 'date', 'ids', 'data_start', 'data_end',\r\n 'lido', 'status', 'entregue', 'data_confirmacao', 'return_format'\r\n );\r\n\r\n $final = array();\r\n foreach ($vars as $key => $value) {\r\n if ($this->$value !== '') {\r\n $final[$value] = $this->$value;\r\n }\r\n }\r\n return $final;\r\n }", "function test39(mixed $arg) {\n return $arg;\n}", "function _prepare() {}", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "function app_contact_get_var($val = '', $default = '') {\n return !isset($_REQUEST[$val]) ? $default : trim($_REQUEST[$val], ' <>');\n}", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->role = $_POST['role'];\n $this->firstname = trimStrip($_POST['firstname']);\n $this->surname = trimStrip($_POST['surname']);\n $this->email = trimStrip($_POST['email']);\n $this->login = trimStrip($_POST['login']);\n $this->password = trimStrip($_POST['pass1']);\n }", "function fabric_request_filter($query_vars) {\n if (isset($_GET['s']) && empty($_GET['s'])) {\n $query_vars['s'] = ' ';\n }\n\n return $query_vars;\n}", "function queryVars($vars) {\n $vars[] = 'xauth';\n $vars[] = 'redirect_to';\n\n return $vars;\n }", "protected function setRequestArgumentsFromGetPost() {\n\t\t$validArguments = array('vendorName', 'extensionName', 'pluginName', 'controllerName', 'actionName', 'formatName', 'arguments');\n\t\tforeach ($validArguments as $argument) {\n\t\t\tif (GeneralUtility::_GP($argument)) {\n\t\t\t\t$this->requestArguments[$argument] = GeneralUtility::_GP($argument);\n\t\t\t} else if (GeneralUtility::_GP('amp;' . $argument)) {\n\t\t\t\t// Something went wrong...\n\t\t\t\t$this->requestArguments[$argument] = GeneralUtility::_GP('amp;' . $argument);\n\t\t\t}\n\t\t}\n\t}", "function protect1($protected) {\n\t$banlist = array (\"'\", \"\\\"\", \"<\", \"\\\\\", \"|\", \"/\", \"=\", \"insert\", \"select\", \"update\", \"delete\", \"distinct\", \"having\", \"truncate\", \"replace\", \"handler\", \"like\", \"procedure\", \"limit\", \"order by\", \"group by\", \"asc\", \"desc\"); \n\t//$banlist is the list of words you dont want to allow.\n\tif ( eregi ( \"[a-zA-Z0-9@]+\", $protected ) ) { // Makes sure only legitimate Characters are used.\n\t\t$protected = trim(str_replace($banlist, '', $protected)); // Takes out whitespace, and removes any banned words.\n\t\treturn $protected;\n\t\t//echo \"+\";\n\t} else {\n\t\t//echo \"-\";\n\t\techo $protected;\n\t\tdie ( ' Is invalid for that spot, please try a different entry.' ); // Message if thier is any characters not in [a-zA-Z0-9].\n\t} // ends the if ( eregi ( \"[a-zA-Z0-9]+\", $this->protected ) ) {\n}", "function _verify_user_values(&$values)\r\n\t{\r\n\t\tif ($this->_dumb_mode)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t} \r\n\t\tforeach($values as $field => $value)\r\n\t\t{\r\n\t\t\tif (!isset($this->_params[$field]))\r\n\t\t\t{\n\t \tdebug :: write_error(NESE_ERROR_WRONG_MPARAM,\r\n\t \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \n\t \t\t array('param' => $field)\r\n\t \t);\r\n\t\t\t\tunset($values[$field]);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (in_array($this->_params[$field], $this->_required_params))\r\n\t\t\t\t{\n\t\t \tdebug :: write_error(NESE_ERROR_WRONG_MPARAM,\r\n\t\t \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \n\t \t\t array('param is autogenerated and can\\'t be passed' => $field)\r\n\t\t \t);\r\n\r\n\t\t\t\t\tunset($values[$field]);\r\n\t\t\t\t} \r\n\t\t\t} \r\n\t\t} \r\n\t}", "function mf_init_max_input_vars(){\n\t\t$max_input_vars = (int) ini_get('max_input_vars');\n\t\t\n\t\t//if max_input_vars is 0 or empty, then most likely the PHP version is less than PHP 5.3.9\n\t\tif ($max_input_vars <= 0) {\n \treturn true;\n \t}\n\n \t//if max_input_vars already being set to a large value, no need to parse it further\n \tif($max_input_vars >= 10000){\n \t\treturn true;\n \t}\n\n \t//if the number of input is less than max_input_vars, no need to parse it further\n \tif (count($_POST, COUNT_RECURSIVE) < $max_input_vars) {\n \treturn true;\n \t}\n \t\n \t//read raw post data using php://input wrapper, since this one is not affected by max_input_vars\n \t$input_string = file_get_contents(\"php://input\");\n \tif($input_string === false or $input_string === '') {\n \treturn true;\n \t}\n\n\t\t$exploded_array = explode('&', $input_string);\n\t\t$chunked_array = array_chunk($exploded_array, $max_input_vars);\n \t$imploded_array = array_map('mf_implode_array_chuncks', $chunked_array);\n\n \tforeach ($imploded_array as $chunk_data) {\n\t $parsed_vars = array();\n\t parse_str($chunk_data, $parsed_vars);\n\t \n\t //merge parsed variables into POST\n\t mf_merge_parsed_vars_to_post($parsed_vars);\n\t }\n\t}", "function rehtmlspecialchars($arg){\n\t//$arg = str_replace(\"\", \"<\", $arg);\n\t//$arg = str_replace(\" \", \"_\", $arg);\n\t$arg = str_replace(\"/\", \"\", $arg);\n\t$arg = str_replace(\"&\", \"\", $arg);\n\t$arg = str_replace(\"'\", \"\", $arg);\n\t$arg = str_replace(\"#\", \"\", $arg);\n\t$arg = str_replace(\"(\", \"\", $arg);\n\t$arg = str_replace(\")\", \"-\", $arg);\n\t$arg = str_replace(\".\", \"\", $arg);\n\t\n\treturn $arg;\n\t}", "function yy_r13(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array('value'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor)); }", "public function __sanitise() { $this->username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n $hashed_password = password_hash($password, PASSWORD_BCRYPT);\n $this->email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->usertype = filter_input(INPUT_POST, 'lib_code', FILTER_SANITIZE_SPECIAL_CHARS);\n }", "protected function check_var()\n {\n $regex = \"/^TF@[a-zA-Z_\\-$&%*!?]{1}[a-zA-Z0-9_\\-$&%*!?]*$|^LF@[a-zA-Z_\\-$&%*!?]{1}[a-zA-Z0-9_\\-$&%*!?]*$|^GF@[a-zA-Z_\\-$&%*!?]{1}[a-zA-Z0-9_\\-$&%*!?]*$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <var> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n }\n }", "function _inspect($args,$force_plain=false)\n{\n\t$plain=headers_sent() || $force_plain || !running_script('index');\n\n\tif ($plain)\n\t{\n\t\t@ini_set('ocproducts.xss_detect','0');\n\n\t\t$GLOBALS['SCREEN_TEMPLATE_CALLED']='';\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-type: text/plain; charset='.get_charset());\n\t\t\theader('Content-Disposition: inline'); // Override what might have been set\n\t\t}\n\n\t\techo 'DEBUGGING. INSPECTING VARIABLES...'.chr(10);\n\t} else\n\t{\n\t\theader('Content-type: text/html; charset='.get_charset());\n\t\theader('Content-Disposition: inline'); // Override what might have been set\n\t}\n\n\tforeach ($args as $arg_name=>$arg_value)\n\t{\n\t\tif (!is_string($arg_name)) $arg_name=strval($arg_name+1);\n\n\t\tif ($plain)\n\t\t{\n\t\t\techo chr(10).chr(10).$arg_name.' is...'.chr(10);\n\t\t\tif ((is_object($arg_value) && (is_a($arg_value,'ocp_tempcode'))))\n\t\t\t{\n\t\t\t\techo 'Tempcode: '.$arg_value->evaluate().' (';\n\t\t\t\tvar_dump($arg_value);\n\t\t\t\techo ')';\n\t\t\t} else\n\t\t\t{\n\t\t\t\tvar_dump($arg_value);\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tif ((is_object($arg_value) && (is_a($arg_value,'ocp_tempcode'))))\n\t\t\t{\n\t\t\t\tattach_message($arg_name.' is...'.chr(10).'Tempcode: '.$arg_value->evaluate());\n\t\t\t} else\n\t\t\t{\n\t\t\t\tattach_message($arg_name.' is...'.chr(10).var_export($arg_value,true));\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($plain)\n\t{\n\t\techo chr(10).chr(10).'--------------------'.chr(10).chr(10).'STACK TRACE FOLLOWS...'.chr(10).chr(10);\n\n\t\tdebug_print_backtrace();\n\t\texit();\n\t}\n}", "function yy_r1(){\n $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null;\n }", "function check_single_incomming_var($var, $request = FALSE, $url_decode = FALSE) {\n if ((is_string($var) || is_numeric($var)) && !is_array($var)) {\n if (($request == TRUE) && isset($_REQUEST[$var])) {\n $value = $_REQUEST[$var];\n } elseif ($request == FALSE) {\n $value = $var;\n } else {\n $value = NULL;\n }\n if ($value === '') {\n return NULL;\n } elseif (($value === 0)) {\n return 0;\n } elseif (($value === '0')) {\n return '0';\n } else {\n// $value = htmlspecialchars($value);\n }\n if ($url_decode) {\n $value = urldecode($value);\n }\n if (\\json_decode($value) === NULL) {\n// $search = ['\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"];\n// $replace = ['\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'];\n// $value = str_replace($search, $replace, $value);\n// $value = @mysql_real_escape_string($value);\n }\n return $value;\n } else {\n return NULL;\n }\n}", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }", "function show_common_vars()\n\t\t{\n\t\t\t$this->message[] = $this->GUI->get_error(false, _DEBUG);\n\t\t\t$this->message[] = $this->runtime->get_error(false, _DEBUG);\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'wf_message'\t=> implode('<br />',array_filter($this->message)),\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function actionfrmcheckrm($var = \"\") {\r\n //echo $_REQUEST[$var].\"$var-->$val\";\r\n if (isset($_REQUEST[$var]) && ($_REQUEST[$var] != \"\")) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function destrictify($change_content_type=true,$mysql_too=false)\n{\n\t// Turn off strictness\n\tif ((!headers_sent()) && ($change_content_type))\n\t\t@header('Content-type: text/html; charset='.get_charset());\n\t$GLOBALS['SCREEN_TEMPLATE_CALLED']='';\n\t$GLOBALS['TITLE_CALLED']=true;\n\terror_reporting(E_ALL & ~E_NOTICE & ~(defined('E_DEPRECATED')?E_DEPRECATED:0));\n\tif (function_exists('set_time_limit')) @set_time_limit(200);\n\tif ((get_forum_type()=='ocf') && ($mysql_too)) $GLOBALS['SITE_DB']->query('SET sql_mode=\\'\\'',NULL,NULL,true);\n\t@ini_set('ocproducts.type_strictness','0');\n\tglobal $PREVIOUS_XSS_STATE;\n\tarray_push($PREVIOUS_XSS_STATE,ini_get('ocproducts.xss_detect'));\n\t$include_path='./';\n\t$include_path.=PATH_SEPARATOR.get_file_base().'/';\n\t$include_path.=PATH_SEPARATOR.get_file_base().'/sources_custom/';\n\t$include_path.=PATH_SEPARATOR.get_file_base().'/uploads/website_specific/';\n\tif (get_zone_name()!='') $include_path.=PATH_SEPARATOR.get_file_base().'/'.get_zone_name().'/';\n\t@ini_set('include_path',$include_path);\n\t//disable_php_memory_limit();\tDon't do this, recipe for disaster\n\t@ini_set('allow_url_fopen','1');\n\t@ini_set('suhosin.executor.disable_emodifier','0');\n\t@ini_set('suhosin.executor.multiheader','0');\n\t$GLOBALS['NO_DB_SCOPE_CHECK']=true;\n\t$GLOBALS['NO_QUERY_LIMIT']=true;\n}", "function force() { \n if (is_array($this->force_this)) { \n for($i=0 ; $i< count($this->force_this) ; $i++) { \n if ($this->force_this[$i][1] == \"SIMPLE\" && !$this->passed($this->force_this[$i][0])) {\n die(\"\\n\\nMissing \" . $this->force_this[$i][0] . \"\\n\\n\"); \n }\n\n if ($this->force_this[$i][1] == \"FULL\" && !$this->full_passed($this->force_this[$i][0])) {\n die(\"\\n\\nMissing \" . $this->force_this[$i][0] .\" <arg>\\n\\n\"); \n } \n } \n } \n }", "private function _protectionFunctions()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t// ... //\n\t\t\n\t\t// Preventing XSS and SQL Injection's keywords from the GET request\n \tforeach ( $MySmartBB->_GET as $get )\n \t{\n \t\t\tif ( (preg_match(\"/\\<[^\\>]*script*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*object*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*iframe*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*applet*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*meta*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*style*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*form*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/\\<[^\\>]*img*\\\"?[^\\>]*\\>/\", $get)) or\n \t\t\t(preg_match(\"/select/\", $get)) or\n \t\t\t(preg_match(\"/union/\", $get)) or\n \t\t\t(preg_match(\"/--/\", $get)) )\n {\n \t\t\tdie( 'Forbidden Action' );\n \t\t\t}\n \t\t}\n \t\t \t\t\n \t\t// ... //\n \t\t\n \t\t// Stop any external post request.\n \t\t// At least prevent novice crackers.\n \t\tif ( $MySmartBB->_SERVER['REQUEST_METHOD'] == 'POST' )\n \t{\n \t\t// ... //\n \t\t\n \t\t\t$from = explode( '/', $MySmartBB->_SERVER[ 'HTTP_REFERER' ] );\n \t\t\t$host = explode( '/', $MySmartBB->_SERVER[ 'HTTP_HOST' ] );\n\n \t\t\t// ... //\n \t\t\t\n \t\t\tif ( $from[ 2 ] != $host[ 0 ] )\n \t\t\t\tdie( 'Forbidden Action' );\n \t\t\t\n \t\t\t// ... //\n \t\t}\n \t\t\n \t\t// ... //\n\t}", "public function disableStrictVariables()\n {\n $this->strictVariables = false;\n }", "function yy_r162(){ $this->_retvalue = '\".('.$this->yystack[$this->yyidx + -1]->minor.').\"'; $this->compiler->has_variable_string = true; }", "function checkExecParams() {\n return TRUE;\n }", "function CollectRegistrationSubmissionPraktijk(&$formvars)\n {\n// $formvars['praktijknummer'] = $this->Sanitize($_POST['praktijknummer']);\n// $formvars['praktijkvolgnummer'] = $this->Sanitize($_POST['praktijkvolgnummer']);\n $formvars['id'] = $this->Sanitize($_POST['CarryOrganisatie']);\n $formvars['naam'] = $this->Sanitize($_POST['organisatie']);\n $formvars['telefoonnummer'] = $this->Sanitize($_POST['telefoonnummer']);\n $formvars['straat'] = $this->Sanitize($_POST['straat']);\n $formvars['huisnummer'] = $this->Sanitize($_POST['huisnummer']);\n $formvars['huisnummer_toev'] = $this->Sanitize($_POST['huisnummer_toev']);\n $formvars['postcode'] = $this->Sanitize($_POST['postcode']);\n $formvars['plaatsnaam'] = $this->Sanitize($_POST['plaatsnaam']);\n $formvars['delete'] = $this->Sanitize($_POST['delete']);\n }", "function yy_r139(){$this->_retvalue = '!='; }", "public function sanitize_input_fields()\n {\n }", "function filterGlobalArrays()\r\n{\r\n ### clean global namespace from register globals ###\r\n if (@ini_get('register_globals')) {\r\n foreach ($_REQUEST as $key => $value) {\r\n unset($GLOBALS[$key]);\r\n }\r\n }\r\n\r\n clearRequestVars();\r\n addRequestVars($_GET);\r\n addRequestVars($_POST);\r\n addRequestVars($_COOKIE);\r\n\r\n $_COOKIE= $_GET= $_POST=array();\r\n}", "protected function cleanVars(array $vars) {\n\t\t$returnVars = array();\n\t\tforeach($vars as $key=>$val) {\n\t\t\tif ($key[0] !== '_') {\n\t\t\t\t$returnVars[$key] = $val;\n\t\t\t}\n\t\t}\n\n\t\treturn $returnVars;\n\t}", "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }" ]
[ "0.57345164", "0.5489058", "0.54833275", "0.5301775", "0.51588583", "0.51447517", "0.5101529", "0.5092761", "0.5090717", "0.50822395", "0.5080333", "0.5054584", "0.5025061", "0.5022579", "0.4995433", "0.49929854", "0.49758363", "0.4968213", "0.49509832", "0.494796", "0.49463856", "0.49400496", "0.49302042", "0.49246457", "0.49160215", "0.49159676", "0.49009994", "0.48968965", "0.48897523", "0.48892316", "0.48812422", "0.48785362", "0.4862498", "0.4862452", "0.48537248", "0.48493668", "0.4841567", "0.4835021", "0.48266903", "0.48158574", "0.47987938", "0.47987932", "0.4790349", "0.47876927", "0.47842252", "0.47831237", "0.4781577", "0.47803295", "0.4780252", "0.4758931", "0.47450122", "0.47441095", "0.47412363", "0.47403327", "0.47302952", "0.47247875", "0.4706218", "0.47007012", "0.46972224", "0.4695012", "0.4680659", "0.46801847", "0.46780214", "0.46763128", "0.4674023", "0.467259", "0.46724305", "0.46719575", "0.46652994", "0.46572015", "0.4656532", "0.46551803", "0.4650071", "0.46487704", "0.46480668", "0.46407065", "0.46331698", "0.46330452", "0.46309635", "0.46253303", "0.4625184", "0.4622853", "0.462197", "0.4615797", "0.46149728", "0.4613075", "0.46111366", "0.46097022", "0.46050102", "0.46028376", "0.45993602", "0.45957735", "0.45909816", "0.45889297", "0.45805332", "0.45800376", "0.4576171", "0.4571265", "0.45697892", "0.4568298" ]
0.5887516
0
08.26.2015 ghh this function retrieves shipvendor name and returns it
function getShipVendorName( $shipvendorid ) { global $db; $query = "select ShipVendorName from ShippingVendors where ShipVendorID=$shipvendorid"; if (!$tmpresult = $db->sql_query($query)) { RestLog("Error 16601 in query: $query\n".$db->sql_error()); RestUtils::sendResponse(500, "16601 - There was a problem getting shipping vendor"); //Internal Server Error return false; } $shiprow = $db->sql_fetchrow( $tmpresult ); return $shiprow['ShipVendorName']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVendorName(): string;", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "public function getShipname()\n {\n return $this->shipname;\n }", "public function getVendorName(): string\n {\n return 'local';\n }", "public function getShipName()\n {\n $ship = $this->pKShip->ShipNumber . \" \" . $this->pKShip->ShipName;\n return $ship;\n }", "public function getVendor()\n {\n return $this->_coreRegistry->registry('current_vendor');\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function GetVendorShippingContact($SuppID,$ShipId='')\r\n\t{\r\n\t\t$AddType='shipping';\t\t\r\n\t\t \r\n\t\t$strAddQuery .= \" and ( ab.Status='1' or ab.Status='0')\";\r\n\t\t$strAddQuery .= (!empty($ShipId))?(\" and ab.AddID='\".$ShipId.\"'\"):(\"\");\t \r\n\r\n\t\t$strSQLQuery = \"SELECT s.CompanyName, ab.* FROM p_address_book ab inner join p_supplier s on ab.SuppID=s.SuppID WHERE ab.SuppID='\".$SuppID.\"' AND ab.AddType = '\".$AddType.\"' \".$strAddQuery.\" order by Status Desc\";\r\n\t\treturn $this->query($strSQLQuery, 1);\r\n\t}", "function getVendorId($vendor_name)\n\t{\n\t\t global $log;\n $log->info(\"in getVendorId \".$vendor_name);\n\t\tglobal $adb;\n\t\tif($vendor_name != '')\n\t\t{\n\t\t\t$sql = \"select vendorid from ec_vendor where vendorname='\".$vendor_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$vendor_id = $adb->query_result($result,0,\"vendorid\");\n\t\t}\n\t\treturn $vendor_id;\n\t}", "public function GetVendor()\n\t{\n\t\treturn $this->vendor;\n\t}", "public function getVendorId() {}", "public function column_vendor( $request ) {\n\t\t$vendor = get_post_meta( $request->ID, '_camppayments_vendor_name', true );\n\t\treturn $vendor;\n\t}", "public function getVendorName($uid=''){\r\n if($uid != ''){\r\n $userDetail = $this->CI->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$uid));\r\n if(!empty($userDetail)) {\r\n $uname = $userDetail[0]['user_uname'];\r\n $p = strtolower($uname);\r\n return $p;\r\n }\r\n else {\r\n return '0';\r\n }\r\n }\r\n else {\r\n return '0';\r\n }\r\n die();\r\n\t}", "public function getVendorCode()\n {\n return $this->vendorCode;\n }", "public function getIosVendorId();", "function MacVendor($mac_address) {\n $url = \"https://macvendors.co/api/vendorname/\" . urlencode($mac_address);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $response = curl_exec($ch);\n\n // $macprovider = 'UNKNOWN';\n if($response) {\n $macprovider = $response;\n } \n \n return $macprovider;\n }", "public function getVendorPartNumber(): string\n {\n return $this->vendorPartNumber;\n }", "public function getVendorId(): ?string;", "protected function _getClientName() {\n //return \"TEST STRING\";\n $mageVersion = Mage::getVersion();\n $mageVerParts = explode('.', $mageVersion, 2);\n\n $opVersion = Mage::getResourceModel('core/resource')->getDbVersion('upop_setup');\n $opVerParts = explode('.', $opVersion, 2);\n\n $part = array();\n $part[] = self::CONFIG_KEY;\n $part[] = $mageVerParts[0];\n $part[] = $mageVerParts[1];\n $part[] = self::APP_NAME;\n $part[] = $opVerParts[0];\n $part[] = $opVerParts[1];\n return implode(',', $part);\n }", "function wac_vendor_name($user){\n\t$firstname = get_user_meta($user->ID,'first_name',true);\n\t$lastname = get_user_meta($user->ID,'last_name',true);\n\t\n\t$fullName = $user->data->user_nicename;\n\tif(!empty($firstname)){\n\t\t$fullName = trim($firstname.' '.$lastname);\n\t}\n\treturn $fullName;\n}", "public function getFieldId()\n {\n \treturn 'product_vendor';\n }", "public function getShipmentName()\n {\n return $this->_fields['ShipmentName']['FieldValue'];\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getShipcom()\n {\n return $this->shipcom;\n }", "public function getShipToLastName();", "public function getGoodsName()\n {\n return $this->goods_name;\n }", "public function getGoodsName()\n {\n return $this->goods_name;\n }", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getVendorCode ()\n\t{\n\t\treturn self::CODE;\n\t}", "public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}", "function title($ship_id)\n\n{\n\n $shipping_data=$this->shipping->get_data_with_single_cond($ship_id,'shipping_details','id');\n\n\n\n $table_name=$shipping_data[0]['table_name'];\n\n $shipping_details=$this->finddeliveries->get_shipment_by_shiiping_id($ship_id,$table_name);\n\n// print_r($shipping_details);\n\n// die;\n\n if($shipping_details[0]['title']!='') {return substr(str_replace(' ','-',$shipping_details[0]['title']),0,10);}elseif($shipping_details[0]['delivery_title']!=''){return substr(str_replace(' ','-',$shipping_details[0]['delivery_title']),0,10);}else {return substr(str_replace(' ','-',$shipping_details[0]['description']), 0,10);}\n\n}", "public function getShopName()\n {\n return 'oscommerce-2.3.4';\n }", "protected function getShopName()\n {\n return $this->shopName;\n }", "public function unknownVendor() {\r\n\t\t$data = array();\r\n\t\t\t$data['name'] = 'Unknown';\r\n\t\t\t$data['link'] = '';\r\n\t\t\t$data['tax_id'] = 'Unknown';\r\n\t\t\t$data['address'] = 'Unknown';\r\n\t\t\t$data['address2'] = 'Unknown';\r\n\t\t\t$data['city'] = 'Unknown';\r\n\t\t\t$data['state'] = 'Unknown';\r\n\t\t\t$data['zip'] = 'Unknown';\r\n\t\t\t$data['country'] = 'Unknown';\r\n\t\t\t$data['has_ship'] = 0;\r\n\t\t\t$data['ship_contact'] = 'Unknown';\r\n\t\t\t$data['ship_phone'] = 'Unknown';\r\n\t\t\t$data['ship_address'] = 'Unknown';\r\n\t\t\t$data['ship_address2'] = 'Unknown';\r\n\t\t\t$data['ship_city'] = 'Unknown';\r\n\t\t\t$data['ship_state'] = 'Unknown';\r\n\t\t\t$data['ship_zip'] = 'Unknown';\r\n\t\t\t$data['ship_country'] = 'Unknown';\r\n\t\t\t$data['first_name'] = 'Unknown';\r\n\t\t\t$data['last_name'] = 'Unknown';\r\n\t\t\t$data['phone'] = 'Unknown';\r\n\t\t\t$data['alt_phone'] = 'Unknown';\r\n\t\t\t$data['fax'] = 'Unknown';\r\n\t\t\t$data['email'] = 'Unknown';\r\n\t\t\t$data['notes'] = 'Unknown';\r\n\t\t\t$data['active'] = 0;\r\n\t\t\t$data['legacy_vendor_code'] = 'Unknown';\r\n\t\t\t$data['legacy_vendor_id'] = 0;\r\n\t\t\t$data['mailing_list'] = 0;\r\n\r\n\t\treturn $data; //array\r\n\t}", "public function getShipToFirstName();", "function getSellerName($sellerId){\n\t\t//$row = mysql_fetch_array($result);\n\t\treturn \"\";\n\t}", "public function get_productName(): string\n {\n // $res is a string;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductName();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTNAME_INVALID;\n }\n }\n $res = $this->_productName;\n return $res;\n }", "public function getGiftcardSenderName();", "function getManufacturerTitle() {\n \tif ($this->getManufacturerUid()) {\n \t\treturn $this->conn_db->getManufacturerTitle($this->getManufacturerUid());\n \t}\n \t\n }", "function getProductName($ms3Oid) {\n\t\t$this->dbgstart();\n\t\t$sql = \"SELECT Name FROM Product WHERE AsimOid = '$ms3Oid'\";\n\t\t$result = $this->db->sql_query($sql);\n\t\tif ($result) {\n\t\t\t$row = $this->db->sql_fetch_row($result);\n\t\t\t$this->dbgend();\n\t\t\treturn $row[0];\n\t\t}\n\t\t$this->dbgend();\n\t\treturn false;\n\t}", "public function getCustomerName();", "public function getProdName()\n {\n return $this->prod_name;\n }", "private function getName ()\n\t\t{\t\n\t\t\t$dbs = new DB ( $this->config['database'] );\n\t\t\t$search = $dbs->query(\"SELECT * FROM tbl_vpn_org WHERE org_id = \" . trim($this->c) );\n\t\t\tif ( count($search) ) {\n\t\t\t\t// Convert result to human code \n\t\t\t\t$this->result['data']['id'] = $search[0]['org_id'];\n\t\t\t\t$this->result['data']['name'] = $search[0]['org_name'];\n\t\t\t\t$this->result['data']['description'] = $search[0]['org_desc'];\n\t\t\t} else \n\t\t\t\t$this->result['data']['result'] = \"Not found\";\n\t\t\n\t\t\t$dbs->CloseConnection ();\t\n\t\t\treturn;\n\t\t}", "function buildScreenName($clientId){\n $db = phpmotorsConnect();\n $sql = 'SELECT clientFirstname, clientLastname FROM clients WHERE clientId = :clientId';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_STR);\n $stmt->execute();\n $fullName = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $fullName;\n }", "function tep_get_manufacturers_name($id) {\n $mquery = tep_db_query(\"select manufacturers_name from manufacturers where manufacturers_id = '\".$id.\"'\");\n $mresult = tep_db_fetch_array($mquery);\n\n return $mresult['manufacturers_name'];\n}", "public function getShipcountry()\n {\n return $this->shipcountry;\n }", "public function getSoftwareName()\n {\n return $this->getParam(self::SOFTWARE_PARAM_NAME);\n }", "public function render_field_vendor() {\n\t\t$value = $this->get_setting( 'vendor', '' );\n\t\t?>\n\t\t<p>\n\t\t\t<input type=\"text\" name=\"satispress[vendor]\" id=\"satispress-vendor\" value=\"<?php echo esc_attr( $value ); ?>\"><br>\n\t\t\t<span class=\"description\">Default is <code>satispress</code></span>\n\t\t</p>\n\t\t<?php\n\t}", "public function getShippingMethodName();", "function tep_get_country_name($country_id) {\n\t$country_array = tep_get_countries($country_id);\n\treturn $country_array['countries_name'];\n}", "private function get_info_warehouse_name($fcode){\n $rs = array();\n $arrWhere = array();\n \n $arrWhere = array('fcode'=>$fcode);\n \n //Parse Data for cURL\n $rs_data = send_curl($arrWhere, $this->config->item('api_list_warehouses'), 'POST', FALSE);\n $rs = $rs_data->status ? $rs_data->result : array();\n \n $wh_name = \"\";\n foreach ($rs as $r) {\n $wh_name = filter_var($r->fsl_name, FILTER_SANITIZE_STRING);\n }\n \n return $wh_name;\n }", "function tep_get_manufacturers_name($manufacturers_id) {\n\t$manufactures_query = tep_db_query(\"select manufacturers_name from \" . TABLE_MANUFACTURERS . \" where manufacturers_id = '\" . (int)$manufacturers_id . \"'\");\n\t$manufactures = tep_db_fetch_array($manufactures_query);\n\treturn $manufactures['manufacturers_name'];\n}", "public function shipIdentifier()\n {\n echo \"I am the Player Ship\\n\";\n }", "public function getServerSoftware(): string\n {\n return \"Magma\";\n }", "public function getProductName(){\n return $this->product_name;\n }", "public function getBrand_name () {\n\t$preValue = $this->preGetValue(\"brand_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->brand_name;\n\treturn $data;\n}", "public function getVendor()\n {\n if ($this->_oVendor === null) {\n $this->_oVendor = $this->getProduct()->getVendor(false);\n }\n\n return $this->_oVendor;\n }", "public function getSourceSystemName()\r\n\t{\r\n\t\tglobal $realtime_webservice_source_system_custom_name, $lang;\r\n\t\t// If custom name not defined\r\n\t\tif (trim($realtime_webservice_source_system_custom_name) == '') {\r\n\t\t\treturn $lang['ws_52'];\r\n\t\t} else {\r\n\t\t\treturn $realtime_webservice_source_system_custom_name;\r\n\t\t}\r\n\t}", "public function getShippingName()\n {\n return trim($this->getShippingFirstName() . ' ' . $this->getShippingLastName());\n }", "public function getStreetName();", "function getSkus() {\n\techo \"Getting Skus </br>\";\n\t$response = getRequest('/api/sku');\n\tprintInfo($response);\n}", "public static function getSystemFromName() {}", "private function get_vendor_base_url($vendor){\n switch (strtolower($vendor)) {\n case 'dotclick':{\n return 'http://csms.dotklick.com/';\n }\n break; \n default:{\n return 'https://akspk.com';\n }\n break;\n }\n }", "public function getVendor()\n {\n return $this->hasOne(VendorServiceExt::className(), ['vendor_id' => 'vendor_id']);\n }", "function fetchManufacturer($Hersteller)\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Name FROM \" . PREFIX . \"_modul_shop_hersteller WHERE Id = '$Hersteller' LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\treturn @$row->Name;\r\n\t}", "public function vendor($vendor_id)\n\t{\n\t\t$this->_vendors_array('all');\n\t\t\n\t\tif (isset($this->vendors_cache[$vendor_id]))\n\t\t{\n\t\t\treturn $this->vendors_cache[$vendor_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->vendors_cache[1];\n\t\t}\n\t}", "function sysName(){\n\tglobal $driver;\n\t$sql\t=\t\"SELECT systemname FROM settings\"; //Retrieve the system name\n\tif($appname\t= $driver->perform_request($sql)):\n\t\t$row\t= $driver->load_data($appname);\n\t\t$sysname\t=\t(!empty($row['systemname']))?($row['systemname']):\" Microfinance \";//Retrieved system name\n\telse:\n\t\t\tdie('<p class=\"error\">ERROR Retrieving Application name.<br/>'.mysql_error().'</p>');\n\tendif;\n\treturn $sysname; //The application name\n}", "public function getDeliveryName()\n {\n return $this->_deliveryName=='' ? $this->getBasename() : $this->_deliveryName;\n \n }", "function get_vendor_for_product()\n{\n\n $sql = \"select * from vendor order by f_name,l_name \";\n $send_query = query($sql);\n confirm($send_query);\n while ($row = fetch_array($send_query)) {\n $vendor_name = <<<DELIMETER\n <option value=\"{$row['id']}\">{$row['id']} :: {$row['f_name']} {$row['l_name']}</option>\nDELIMETER;\n echo $vendor_name;\n }\n\n\n}", "public function getCustomerMiddlename();", "function getcustomername($value)\n\t{\n\t $getnameofcustomer=\"SELECT customer_name FROM `customer_general_detail` WHERE `customer_id`='$value'\";\n\t\t$name_data=$this->get_results( $getnameofcustomer );\n\t\treturn $name_data;\n\t}", "function GetProductName ( $whichProduct )\n{\n\n\tmysql_select_db ( 'products' );\n\t$query = 'SELECT * FROM products where ID like '.$whichProduct;\n\n\t$result = mysql_query($query );\n\n\tif ( $result )\n\t{\n\t\t$num_results = mysql_num_rows ( $result );\n\t\tif ( $num_results == 1 )\n\t\t{\n\t\t\t$row = mysql_fetch_object ( $result );\n\t\t\t$productName = $row->name;\n\t\t}\n\t\telse\n\t\t\t$productName = 'General';\n\t}\n\n\treturn $productName;\n}", "public function getCarrierServiceName()\n {\n $carrierServiceInfo = $this->getCarrierServiceInfo();\n if($carrierServiceInfo){\n return trim($carrierServiceInfo->getCarrierName().' '.$carrierServiceInfo->getServiceName());\n }\n return null;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public function getManufacturer()\n {\n }", "private function LoadVendorByFriendlyName($friendlyName)\n\t{\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tWHERE vendorfriendlyname='\".$GLOBALS['ISC_CLASS_DB']->Quote($friendlyName).\"'\n\t\t\tLIMIT 1\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\treturn $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t}", "static public function get_shipping_line_title( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \t$title = $order->get_method_title(); \n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\tforeach( $shippings as $shipping ){\n \t\t\t\t\t\n \t\t\t\t$title = $shipping->get_method_title();\n \t\t\t\t\t\n\t\t\t\t} \t\n\n \t}\n\n \treturn $title;\n\n \t}", "function getCarrier()\n {\n \t$sh_args = 'getcellnetwork'; //admin client command for getting cellular carrier/network name\n \t$sh_out = atsexec(escapeshellcmd($sh_args));\t//socket call\n \tdebug('(cell_controller.inc|getCarrier()) admin client api command \"getcellnetwork\" output: $sh_out', $sh_out); \t//DEBUG\n \t \n \tif($sh_out != 'phpcmd: fail' && $sh_out != 'phpcmd: invalid command')\n \t{\n \t\tdebug('(cell_controller.inc|getCarrier()) getcellnetwork command completed.'); \t//DEBUG\n \t\treturn $sh_out;\n \t}\n \telse\n \t{\n \t\tdebug('(cell_controller.inc|getCarrier()) getcellnetwork command failed.'); \t//DEBUG\n \t\treturn false;\n \t\t//return 'Failed to detect cellular carrier';\n \t}\n }", "public function getVendorPackageService() {\n\t\treturn $this->get('sly-service-package-vendor');\n\t}", "public function getCountryNameDirectly()\r\n {\r\n\r\n $url_to_exch_code = \"https://freegeoip.net/json/\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country_name'])) {\r\n\r\n return $details['country_name'];\r\n\r\n } else {\r\n\r\n $url_to_exch_code = \"https://geoip.nekudo.com/api/json\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $json = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $details = json_decode($json, true);\r\n\r\n if(!empty($details['country']['name'])) {\r\n\r\n return $details['country']['name'];\r\n\r\n } else {\r\n\r\n return false;\r\n\r\n }\r\n }\r\n\r\n }", "public function getStoreFrontName();", "public function getShopName()\n {\n return $this->shopName;\n }", "public function getAirlineVendorID()\n {\n return $this->airlineVendorID;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }", "public function getVendorKey()\n {\n return $this->getParameter('vendorKey');\n }", "public function getDeviceManufacturer() {}", "public function getSponsorname() {}", "function wac_vendor_company($user){\n\t$company = get_user_meta($user->ID,'_vendor_company',true);\n\tif(!empty($company)){\n\t\treturn $company;\n\t}\n\t\n\treturn wac_vendor_name($user);\n}", "static public function get_info($ua = '') {\n\t\tif ( empty($ua) && isset($_SERVER['HTTP_USER_AGENT']) )\n\t\t\t$ua = $_SERVER['HTTP_USER_AGENT'];\n\n\t\t$ua = preg_replace(\"/FunWebProducts/i\", \"\", $ua);\n\n\t\t$browser_name = $browser_code = $browser_ver = $os_name = $os_code = $os_ver = $pda_name = $pda_code = $pda_ver = null;\n\n\t\tif ( empty($browser_name) ) {\n\t\t\tif (preg_match('/(movabletype|wordpress|typepad|livedoortrackback|fc2|blogserver|hatena diary trackback agent|gooblog|lovelogtrackback|bitwave\\.trackbackping|libwww-perl|jakarta commons-httpclient|java|xoops news\\+trackback ver)[ \\/]([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t$os_name = FALSE;\n\t\t\t\t$pda_name = FALSE;\n\t\t\t\tswitch (strtolower($browser_code)) {\n\t\t\t\tcase 'movabletype':\n\t\t\t\t\t$browser_name = 'MovableType';\n\t\t\t\t\t$browser_code = 'mt';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'wordpress':\n\t\t\t\t\t$browser_name = 'WordPress';\n\t\t\t\t\t$browser_code = 'wp';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'typepad':\n\t\t\t\t\t$browser_name = 'TypePad';\n\t\t\t\t\t$browser_code = 'typepad';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'livedoortrackback':\n\t\t\t\t\t$browser_name = 'livedoor blog';\n\t\t\t\t\t$browser_code = 'livedoor';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fc2':\n\t\t\t\t\t$browser_name = 'FC2 blog';\n\t\t\t\t\t$browser_code = 'fc2';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lovelogtrackback':\n\t\t\t\t\t$browser_name = 'LOVELOG';\n\t\t\t\t\t$browser_code = 'lovelog';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'blogserver':\n\t\t\t\t\t$browser_name = 'Seesaa blog';\n\t\t\t\t\t$browser_code = 'seesaa';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'hatena diary trackback agent':\n\t\t\t\t\t$browser_name = 'Hatena Diary';\n\t\t\t\t\t$browser_code = 'hatena';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'gooblog':\n\t\t\t\t\t$browser_name = 'goo blog';\n\t\t\t\t\t$browser_code = 'gooblog';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bitwave.trackbackping':\n\t\t\t\t\t$browser_name = 'Bitwave.jp';\n\t\t\t\t\t$browser_code = 'bitwave';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'libwww-perl':\n\t\t\t\t\t$browser_name = 'libwww-perl';\n\t\t\t\t\t$browser_code = 'libwww-perl';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'jakarta commons-httpclient':\n\t\t\t\t\t$browser_name = 'Jakarta Commons-HttpClient';\n\t\t\t\t\t$browser_code = 'jakarta-apache';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'java':\n\t\t\t\t\t$browser_name = 'Java';\n\t\t\t\t\t$browser_code = 'java';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'xoops news+trackback ver':\n\t\t\t\t\t$browser_name = 'XOOPS News+TrackBack';\n\t\t\t\t\t$browser_code = 'xoops';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/(drupal|habari|pukiwiki|seesaa|jugem|avantbrowser.com|danger hiptop|anonymouse|pear http_request|coreblog2?)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t$os_name = FALSE;\n\t\t\t\t$pda_name = FALSE;\n\t\t\t\tswitch (strtolower($browser_code)) {\n\t\t\t\tcase 'drupal':\n\t\t\t\t\t$browser_name = 'Drupal';\n\t\t\t\t\t$browser_code = 'drupal';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'habari':\n\t\t\t\t\t$browser_name = 'Habari';\n\t\t\t\t\t$browser_code = 'habari';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pukiwiki':\n\t\t\t\t\t$browser_name = 'PukiWiki';\n\t\t\t\t\t$browser_code = 'pukiwiki';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'seesaa':\n\t\t\t\t\t$browser_name = 'Seesaa blog';\n\t\t\t\t\t$browser_code = 'seesaa';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'jugem':\n\t\t\t\t\t$browser_name = 'JUGEM blog';\n\t\t\t\t\t$browser_code = 'jugem';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'avantbrowser.com':\n\t\t\t\t\t$browser_name = 'Avant Browser';\n\t\t\t\t\t$browser_code = 'avantbrowser';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'danger hiptop':\n\t\t\t\t\t$browser_name = 'Danger HipTop';\n\t\t\t\t\t$browser_code = 'danger';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'anonymouse':\n\t\t\t\t\t$browser_name = 'Anonymouse';\n\t\t\t\t\t$browser_code = 'anonymouse';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pear http_request':\n\t\t\t\t\t$browser_name = 'PEAR HTTP_Request';\n\t\t\t\t\t$browser_code = 'pear';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'coreblog':\n\t\t\t\t\t$browser_name = 'COREBlog (Blog on Zope)';\n\t\t\t\t\t$browser_code = 'zope';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'coreblog2':\n\t\t\t\t\t$browser_name = 'COREBlog2 (Blog on Plone)';\n\t\t\t\t\t$browser_code = 'plone';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/trackback/i', $ua)) {\n\t\t\t\t$browser_name = 'Trackback';\n\t\t\t\t$browser_name = '';\n\t\t\t\t$os_name = FALSE;\n\t\t\t\t$pda_name = FALSE;\n\t\t\t} else if (preg_match('/symbianos\\/([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$os_name = 'SymbianOS';\n\t\t\t\t$os_code = 'symbian';\n\t\t\t\t$os_ver = $matches[1];\n\t\t\t\t$pda_name = FALSE;\n\t\t\t} else if (preg_match('/(docomo|up\\.browser|j-phone|vodafone|softbank)/i', $ua, $matches)) {\n\t\t\t\t$os_name = FALSE;\n\t\t\t\tlist($pda_name, $pda_code, $pda_ver) = self::_pda($ua);\n\t\t\t} else if (preg_match('/wp\\-(iphone|android|blackberry)/i', $ua, $matches)) {\n\t\t\t\t$os_name = FALSE;\n\t\t\t\tlist($pda_name, $pda_code, $pda_ver) = self::_pda($ua);\n\t\t\t\t$browser_name = 'WordPress';\n\t\t\t\tswitch ($pda_code) {\n\t\t\t\tcase 'iphone':\n\t\t\t\t\t$browser_name .= ' for iPhone';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'android':\n\t\t\t\t\t$browser_name .= ' for Android';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'blackberry':\n\t\t\t\t\t$browser_name .= ' for BlackBerry';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$browser_code = 'wp';\n\t\t\t\t$browser_ver = $pda_ver;\n\t\t\t} else if (preg_match('/(blackberry[0-9]+|\\(ip(od|ad|hone);|ddipocket|willcom)/i', $ua, $matches)) {\n\t\t\t\t$os_name = FALSE;\n\t\t\t\tlist($pda_name, $pda_code, $pda_ver) = self::_pda($ua);\n\t\t\t\tswitch ($pda_code) {\n\t\t\t\tcase 'blackberry':\n\t\t\t\t\tif (preg_match('/(j2me|midp)[ \\/\\-]?([a-z0-9\\.]+)?/i', $ua, $matches)) {\n\t\t\t\t\t\t$browser_name = \"J2ME/MIDP Browser\";\n\t\t\t\t\t\t$browser_code = \"j2me\";\n\t\t\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ipod':\n\t\t\t\tcase 'ipad':\n\t\t\t\tcase 'iphone':\n\t\t\t\t\tif (preg_match('/Version\\/([a-z0-9\\.]+)/', $ua, $matches))\n\t\t\t\t\t\t$pda_ver = $matches[1];\n\t\t\t\t\tif (preg_match('/Safari\\/([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t\t\t$browser_name = 'Safari';\n\t\t\t\t\t\t$browser_code = 'safari';\n\t\t\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'willcom':\n\t\t\t\t\tif (preg_match('/(netfront|opera)[ \\/]([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t\t\tswitch ($browser_code) {\n\t\t\t\t\t\tcase 'netfront':\n\t\t\t\t\t\t\t$browser_name = 'Netfront';\n\t\t\t\t\t\t\t$browser_code = 'netfront';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'opera':\n\t\t\t\t\t\t\t$browser_name = 'Opera';\n\t\t\t\t\t\t\t$browser_code = 'opera';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/ibisbrowser/i', $ua)) {\n\t\t\t\t$browser_name = 'ibisBrowser';\n\t\t\t\t$browser_code = 'ibisbrowser';\n\t\t\t\t$os_name = FALSE;\n\t\t\t} else if (preg_match('/jig browser ?([a-z0-9\\.]+)?/i', $ua, $matches)) {\n\t\t\t\t$browser_name = 'jig browser';\n\t\t\t\t$browser_code = 'jig';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\t$os_name = FALSE;\n\t\t\t} else if (preg_match('/(chrome|opera mini|camino|chimera|shiira|lunascape|sleipnir|konqueror|netnewswire|dillo|epiphany|seamonkey|kazehakase|flock|minimo|multizilla|galeon|icab|k-meleon|lynx|elinks|netpositive|omniweb|webpro|netfront|xiino|kunststofftraumte|w3m)[ \\/]([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t$pda_name = FALSE;\n\t\t\t\tswitch ($browser_code) {\n\t\t\t\tcase 'chrome':\n\t\t\t\t\t$browser_name = 'Google Chrome';\n\t\t\t\t\t$browser_code = 'chrome';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'opera mini':\n\t\t\t\t\t$browser_name = 'Opera Mini';\n\t\t\t\t\t$browser_code = 'opera';\n\t\t\t\t\tif (preg_match('/Opera\\/([a-z0-9\\.]+)/i', $ua, $matches))\n\t\t\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os_pda($ua);\n\t\t\t\t\tbreak;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'camino':\n\t\t\t\tcase 'chimera':\n\t\t\t\t\t$browser_name = 'Camino';\n\t\t\t\t\t$browser_code = 'camino';\n\t\t\t\t\t$os_name = \"Mac OS\";\n\t\t\t\t\t$os_code = \"macos\";\n\t\t\t\t\t$os_ver = \"X\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'shiira':\n\t\t\t\t\t$browser_name = 'Shiira';\n\t\t\t\t\t$browser_code = 'shiira';\n\t\t\t\t\t$os_name = \"Mac OS\";\n\t\t\t\t\t$os_code = \"macos\";\n\t\t\t\t\t$os_ver = \"X\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lunascape':\n\t\t\t\t\t$browser_name = 'Lunascape';\n\t\t\t\t\t$browser_code = 'lunascape';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sleipnir':\n\t\t\t\t\t$browser_name = 'Sleipnir';\n\t\t\t\t\t$browser_code = 'sleipnir';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'konqueror':\n\t\t\t\t\t$browser_name = 'Konqueror';\n\t\t\t\t\t$browser_code = 'konqueror';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tif (!$os_name)\n\t\t\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os_pda($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'netnewswire':\n\t\t\t\t\t$browser_name = 'NetNewsWire';\n\t\t\t\t\t$browser_code = 'netnewswire';\n\t\t\t\t\t$os_name = \"Mac OS\";\n\t\t\t\t\t$os_code = \"macos\";\n\t\t\t\t\t$os_ver = \"X\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dillo':\n\t\t\t\t\t$browser_name = 'Dillo';\n\t\t\t\t\t$browser_code = 'dillo';\n\t\t\t\t\t$os_name = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'epiphany':\n\t\t\t\t\t$browser_name = 'Epiphany';\n\t\t\t\t\t$browser_code = 'epiphany';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'seamonkey':\n\t\t\t\t\t$browser_name = 'Mozilla SeaMonkey';\n\t\t\t\t\t$browser_code = 'seamonkey';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'kazehakase':\n\t\t\t\t\t$browser_name = 'Kazehakase';\n\t\t\t\t\t$browser_code = 'kazehakase';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'flock':\n\t\t\t\t\t$browser_name = 'Flock';\n\t\t\t\t\t$browser_code = 'flock';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'minimo':\n\t\t\t\t\t$browser_name = 'Minimo';\n\t\t\t\t\t$browser_code = 'mozilla';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'multizilla':\n\t\t\t\t\t$browser_name = 'MultiZilla';\n\t\t\t\t\t$browser_code = 'mozilla';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'galeon':\n\t\t\t\t\t$browser_name = 'Galeon';\n\t\t\t\t\t$browser_code = 'galeon';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'icab':\n\t\t\t\t\t$browser_name = 'iCab';\n\t\t\t\t\t$browser_code = 'icab';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_mac($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'k-meleon':\n\t\t\t\t\t$browser_name = 'K-Meleon';\n\t\t\t\t\t$browser_code = 'kmeleon';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lynx':\n\t\t\t\t\t$browser_name = 'Lynx';\n\t\t\t\t\t$browser_code = 'lynx';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'elinks':\n\t\t\t\t\t$browser_name = 'ELinks';\n\t\t\t\t\t$browser_code = 'lynx';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'netpositive':\n\t\t\t\t\t$browser_name = 'NetPositive';\n\t\t\t\t\t$browser_code = 'netpositive';\n\t\t\t\t\t$os_name = \"BeOS\";\n\t\t\t\t\t$os_code = \"beos\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'omniweb':\n\t\t\t\t\t$browser_name = 'OmniWeb';\n\t\t\t\t\t$browser_code = 'omniweb';\n\t\t\t\t\t$os_name = \"Mac OS\";\n\t\t\t\t\t$os_code = \"macos\";\n\t\t\t\t\t$os_ver = \"X\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'webpro':\n\t\t\t\t\t$browser_name = 'WebPro';\n\t\t\t\t\t$browser_code = 'webpro';\n\t\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\t\t$os_name = \"PalmOS\";\n\t\t\t\t\t$os_code = \"palmos\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'netfront':\n\t\t\t\t\t$browser_name = 'Netfront';\n\t\t\t\t\t$browser_code = 'netfront';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os_pda($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'xiino':\n\t\t\t\t\t$browser_name = 'Xiino';\n\t\t\t\t\t$browser_code = 'xiino';\n\t\t\t\t\t$os_name = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'kunststofftraumte':\n\t\t\t\t\t$browser_name = 'Kunststoff Traumte';\n\t\t\t\t\t$browser_code = '';\n\t\t\t\t\t$os_name = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w3m':\n\t\t\t\t\t$browser_name = 'W3M';\n\t\t\t\t\t$browser_code = 'w3m';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/(webpro|blazer|j2me|midp)[ \\/\\-]?([a-z0-9\\.]+)?/i', $ua, $matches)) {\n\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t$os_name = \"PalmOS\";\n\t\t\t\t$os_code = \"palmos\";\n\t\t\t\tswitch ($browser_code) {\n\t\t\t\tcase 'webpro':\n\t\t\t\t\t$browser_name = 'WebPro';\n\t\t\t\t\t$browser_code = 'webpro';\n\t\t\t\t\t$pda_name = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'blazer':\n\t\t\t\t\t$browser_name = \"Blazer\";\n\t\t\t\t\t$browser_code = \"blazer\";\n\t\t\t\t\t$pda_name = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'j2me':\n\t\t\t\tcase 'midp':\n\t\t\t\t\t$browser_name = \"J2ME/MIDP Browser\";\n\t\t\t\t\t$browser_code = \"j2me\";\n\t\t\t\t\t$os_name = FALSE;\n\t\t\t\t\t$os_code = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/(opera|safari|firefox|shiretoko|firebird|phoenix|bonecho|granparadiso|minefield|iceweasel)[ \\/]([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t$pda_name = FALSE;\n\t\t\t\tswitch ($browser_code) {\n\t\t\t\tcase 'safari':\n\t\t\t\t\t$browser_name = 'Safari';\n\t\t\t\t\t$browser_code = 'safari';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os($ua);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'firefox':\n\t\t\t\tcase 'shiretoko':\n\t\t\t\tcase 'firebird':\n\t\t\t\tcase 'phoenix':\n\t\t\t\tcase 'bonecho':\n\t\t\t\tcase 'granparadiso':\n\t\t\t\tcase 'minefield':\n\t\t\t\tcase 'iceweasel':\n\t\t\t\t\t$browser_name = 'Mozilla Firefox';\n\t\t\t\t\t$browser_code = 'firefox';\n\t\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os($ua);\n\t\t\t\t\t$pda_name = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'opera':\n\t\t\t\t\t$browser_name = 'Opera';\n\t\t\t\t\t$browser_code = 'opera';\n\t\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_win($ua);\n\t\t\t\t\tif (!$os_name)\n\t\t\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t\t\tif (!$os_name)\n\t\t\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os_pda($ua);\n\t\t\t\t\tif (!$os_name) {\n\t\t\t\t\t\tif ( preg_match('/Wii/i', $ua) ) {\n\t\t\t\t\t\t\t$os_name = \"Nintendo Wii\";\n\t\t\t\t\t\t\t$os_code = \"nintendo-wii\";\n\t\t\t\t\t\t} else if ( preg_match('/Nitro/i', $ua) ) {\n\t\t\t\t\t\t\t$os_name = \"Nintendo DS\";\n\t\t\t\t\t\t\t$os_code = \"nintendo-ds\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Windows CE\n\t\t\t\t\tif ( $os_code == \"windows\" && $os_ver == \"CE\" )\n\t\t\t\t\t\tlist($pda_name, $pda_code, $pda_ver) = self::_pda($ua);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/(e?links \\(|php\\/)([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = $matches[1];\n\t\t\t\t$browser_code = strtolower(trim($browser_name));\n\t\t\t\t$browser_ver = $matches[2];\n\t\t\t\t$pda_name = FALSE;\n\t\t\t\tswitch ($browser_code) {\n\t\t\t\tcase 'links (':\n\t\t\t\t\t$browser_name = 'Links';\n\t\t\t\t\t$browser_code = 'lynx';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'elinks (':\n\t\t\t\t\t$browser_name = 'ELinks';\n\t\t\t\t\t$browser_code = 'lynx';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'php/':\n\t\t\t\t\t$browser_name = 'PHP';\n\t\t\t\t\t$browser_code = 'php';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tlist($os_name, $os_code, $os_ver) = self::_os_unix($ua);\n\t\t\t} else if (preg_match('/(nintendo gameboy)/i', $ua, $matches)) {\n\t\t\t\t$os_name = FALSE;\n\t\t\t\t$pda_name = $matches[1];\n\t\t\t\t$pda_code = strtolower(trim($pda_name));\n\t\t\t\tswitch ($pda_code) {\n\t\t\t\tcase 'nintendo gameboy':\n\t\t\t\t\t$pda_name = \"Nintendo GameBoy\";\n\t\t\t\t\t$pda_code = \"nintendo-gb\";\n\t\t\t\t\tif (preg_match('/Mech.Mozilla\\/([a-z0-9\\.]+)/i', $ua, $matches))\n\t\t\t\t\t\t$pda_ver = $matches[1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/(psp \\(playstation portable\\)\\; |ps2; playstation bb navigator |playstation 3; |spv |nokia ?|sonyericsson ?|lge-|mot-|sie-|sec-|samsung-)([a-z0-9\\.\\-]+)/i', $ua, $matches)) {\n\t\t\t\t$os_name = FALSE;\n\t\t\t\t$pda_name = $matches[1];\n\t\t\t\t$pda_code = strtolower(trim($pda_name));\n\t\t\t\t$pda_ver = $matches[2];\n\t\t\t\tswitch ($pda_code) {\n\t\t\t\tcase 'psp (playstation portable);':\n\t\t\t\t\t$pda_name = \"Sony PSP\";\n\t\t\t\t\t$pda_code = \"sony-psp\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ps2; playstation bb navigator':\n\t\t\t\t\t$pda_name = \"Sony PLAYSTATION 2\";\n\t\t\t\t\t$pda_code = \"sony-ps\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'playstation 3;':\n\t\t\t\t\t$pda_name = \"Sony PLAYSTATION 3\";\n\t\t\t\t\t$pda_code = \"sony-ps\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'spv':\n\t\t\t\t\t$pda_name = \"Orange SPV\";\n\t\t\t\t\t$pda_code = \"orange\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nokia':\n\t\t\t\t\t$pda_name = \"Nokia\";\n\t\t\t\t\t$pda_code = \"nokia\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sonyericsson':\n\t\t\t\t\t$pda_name = \"SonyEricsson\";\n\t\t\t\t\t$pda_code = \"sonyericsson\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lge-':\n\t\t\t\t\t$pda_name = \"LG\";\n\t\t\t\t\t$pda_code = \"lg\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'mot-':\n\t\t\t\t\t$pda_name = \"Motorola\";\n\t\t\t\t\t$pda_code = \"motorola\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sie-':\n\t\t\t\t\t$pda_name = \"Siemens\";\n\t\t\t\t\t$pda_code = \"siemens\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sec-':\n\t\t\t\tcase 'samsung-':\n\t\t\t\t\t$pda_name = \"Samsung\";\n\t\t\t\t\t$pda_code = \"samsung\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (preg_match('/IEMobile[ \\/]([0-9\\.]+):/', $ua, $matches)) {\n\t\t\t\t$browser_name = 'Internet Explorer Mobile';\n\t\t\t\t$browser_code = 'iemobile';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t} else if (preg_match('/MSIE ([a-z0-9\\.]+)/', $ua, $matches)) {\n\t\t\t\t$browser_name = 'Internet Explorer';\n\t\t\t\t$browser_code = 'ie';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\tif ( preg_match('/win64/i', $ua) )\n\t\t\t\t\t$browser_ver .= ' (64bit)';\n\t\t\t} else if (preg_match('/universe\\/([0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = 'Universe';\n\t\t\t\t$browser_code = 'universe';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os_pda($ua);\n\t\t\t}else if (preg_match('/netscape[0-9]?\\/([a-z0-9\\.]+)/i', $ua, $matches)) {\n\t\t\t\t$browser_name = 'Netscape';\n\t\t\t\t$browser_code = 'netscape';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t} else if (preg_match('/^Mozilla\\/5\\.0/', $ua) && preg_match('#rv:([a-z0-9\\.]+)#i', $ua, $matches)) {\n\t\t\t\t$browser_name = 'Mozilla';\n\t\t\t\t$browser_code = 'mozilla';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t} else if (preg_match('/^Mozilla\\/([a-z0-9\\.]+)/', $ua, $matches)) {\n\t\t\t\t$browser_name = 'Netscape Navigator';\n\t\t\t\t$browser_code = 'netscape';\n\t\t\t\t$browser_ver = $matches[1];\n\t\t\t}\n\t\t}\n\n\t\t// Get OS Information\n\t\tif ( empty($os_name) && $os_name !== FALSE )\n\t\t\tlist($os_name, $os_code, $os_ver, $pda_name, $pda_code, $pda_ver) = self::_os($ua);\n\t\tif ( $os_name === FALSE )\n\t\t\t$os_name = $os_code = $os_ver = null;\n\n\t\t// Get PDA Plathome\n\t\tif ( empty($pda_name) && $pda_name !== FALSE )\n\t\t\tlist($pda_name, $pda_code, $pda_ver) = self::_pda($ua);\n\t\tif ( $pda_name === FALSE )\n\t\t\t$pda_name = $pda_code = $pda_ver = null;\n\n\t\treturn array(\n\t\t\t'browser' => array(\n\t\t\t\t'name' => $browser_name ,\n\t\t\t\t'code' => $browser_code ,\n\t\t\t\t'version' => $browser_ver ,\n\t\t\t\t),\n\t\t\t'os' => array(\n\t\t\t\t'name' => $os_name ,\n\t\t\t\t'code' => $os_code ,\n\t\t\t\t'version' => $os_ver ,\n\t\t\t\t),\n\t\t\t'pda' => array(\n\t\t\t\t'name' => $pda_name ,\n\t\t\t\t'code' => $pda_code ,\n\t\t\t\t'version' => $pda_ver ,\n\t\t\t\t),\n\t\t\t);\n\t}", "public static function getDriverName()\n {\n }", "protected function getShopAddress()\n\t{\n\t\t$shop_address = '';\n\t\tif (Validate::isLoadedObject(Context::getContext()->shop))\n\t\t{\n\t\t\t$shop_address_obj = Context::getContext()->shop->getAddress();\n\t\t\tif (isset($shop_address_obj) && $shop_address_obj instanceof Address)\n\t\t\t\t$shop_address = AddressFormat::generateAddress($shop_address_obj, array(), ' - ', ' ');\n\t\t\treturn $shop_address;\n\t\t}\n\n\t\treturn $shop_address;\n\t}", "public function getShipaddress()\n {\n return $this->shipaddress;\n }", "public function getCustname()\n {\n return $this->custname;\n }", "public function getCodeFromVendor()\n {\n $uri = $this->options->vendorOptions->authEntryUri;\n $params = '';\n foreach($this->options->stage1->toArray() as $key => $param) {\n if(empty($param)) {\n $param = $this->getDefaultParam($key);\n }\n $params[$key] = $param;\n }\n $this->session->state = $params[$this->options->stage1->state->accessKey];\n $uri .= '?'.http_build_query($params);\n $this->response->getHeaders()->addHeaderLine('location', $uri);\n $this->response->setStatusCode(302);\n }", "function getItemNameByUUID($uuid){\n\t\t $db = $this->startDB();\n\t\t $output = false;\n\t\t $sql = \"SELECT space_label as label FROM space WHERE uuid = '$uuid' LIMIT 1;\";\n\t\t $result = $db->fetchAll($sql, 2);\n if($result){\n\t\t\t\t$output = $result[0][\"label\"];\n\t\t }\n\t\t return $output;\n\t }", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "public static function getSoftwareName()\n\t\t{\n\t\t\treturn 'Wordpress 3.9.1 en WooCommerce 3.0.0+';\n\t\t}", "public static function getvendorData()\n {\n\n $value=DB::table('users')->where('user_type','=','vendor')->where('drop_status','=','no')->orderBy('id', 'desc')->get(); \n return $value;\n\t\n }", "public function getDistriSellerName()\n {\n return $this->distri_seller_name;\n }" ]
[ "0.7136825", "0.7092398", "0.6576986", "0.6573904", "0.64686435", "0.64611036", "0.6413736", "0.63894826", "0.6336757", "0.61387306", "0.6106339", "0.6106332", "0.60968894", "0.6019106", "0.5995813", "0.5941029", "0.5828133", "0.58256876", "0.5783472", "0.5782342", "0.57806104", "0.5768989", "0.5759349", "0.5743253", "0.57425153", "0.5718628", "0.5718628", "0.57082796", "0.57082796", "0.5700924", "0.56874585", "0.56818604", "0.5678598", "0.56728274", "0.56690085", "0.56634897", "0.56563556", "0.5578001", "0.55733776", "0.5571875", "0.5570621", "0.5563271", "0.55579466", "0.555403", "0.553807", "0.5519699", "0.5512713", "0.55070853", "0.5495908", "0.549535", "0.5494985", "0.54936963", "0.549369", "0.5479716", "0.5479171", "0.54733586", "0.5469548", "0.5467652", "0.5464322", "0.5454532", "0.5453153", "0.54526466", "0.54450285", "0.5443341", "0.54330164", "0.5424373", "0.5422528", "0.5419208", "0.54159534", "0.5413497", "0.54098934", "0.540424", "0.54006004", "0.5394792", "0.5393685", "0.5392583", "0.5385745", "0.53818536", "0.5380854", "0.5373394", "0.5372658", "0.53713", "0.536869", "0.5359908", "0.534218", "0.53419083", "0.53346986", "0.5333855", "0.5329479", "0.53252417", "0.53217894", "0.5318111", "0.53172386", "0.5308349", "0.5308321", "0.5307913", "0.53030354", "0.53015065", "0.53004205", "0.52942944" ]
0.8080949
0
Builds header menu with left and right items
public function getMenu() { $lang=$this->translation; foreach($this->_headerMenu as $hmenukey => $hmenu){ foreach($hmenu as $hkey=>$hval){ $this->_headerMenu[$hmenukey][$hkey]['caption']=$lang->_($hkey); } } $auth = $this->session->get('auth'); if ($auth) { $this->_headerMenu['navbar-right']['oturum'] = array( 'caption' => $lang->_('logout'), 'action' => 'bitir' ); } else { unset($this->_headerMenu['navbar-left']['islemler']); unset($this->_headerMenu['navbar-left']['r4t']); unset($this->_headerMenu['navbar-left']['hesap']); } $controllerName = $this->view->getControllerName(); foreach ($this->_headerMenu as $position => $menu) { echo '<div class="nav-collapse">'; echo '<ul class="nav navbar-nav ', $position, '">'; foreach ($menu as $controller => $option) { if ($controllerName == $controller) { echo '<li class="active">'; } else { echo '<li>'; } if ($controller=='admin'){ if(($auth) and ($auth['auth']==0)){ echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']); }}else{ echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']); } echo '</li>'; } echo '</ul>'; echo '</div>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mai_do_header_left() {\n\tif ( ! ( is_active_sidebar( 'header_left' ) || has_nav_menu( 'header_left' ) ) ) {\n\t\treturn;\n\t}\n\n\t// Header Left widget area\n\tif ( is_active_sidebar( 'header_left' ) ) {\n\t\t_mai_add_widget_header_menu_args();\n\t\tgenesis_widget_area( 'header_left' );\n\t\t_mai_remove_widget_header_menu_args();\n\t}\n\n\t// Header Left menu\n\tif ( has_nav_menu( 'header_left' ) ) {\n\t\techo genesis_get_nav_menu( array( 'theme_location' => 'header_left' ) );\n\t}\n}", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "function generate_header_items() \r\n{\r\n\t// Header widget\r\n\tgenerate_construct_header_widget();\r\n\t\r\n\t// Site logo\r\n\tgenerate_construct_logo();\r\n\t\r\n\t// Site title and tagline\r\n\tgenerate_construct_site_title();\r\n\t\r\n}", "public function headerMenu()\n {\n if ($this->headerMenu === null) {\n $dashboardConfig = $this->dashboardConfig();\n\n if (isset($dashboardConfig['sidemenu'])) {\n $this->headerMenu = $this->createHeaderMenu($dashboardConfig['sidemenu']);\n } else {\n $this->headerMenu = $this->createHeaderMenu();\n }\n }\n\n return $this->headerMenu;\n }", "public function buildHeaderNavigation()\n\t{\n\t\t//Reset the current object\n\t\t$this->resetNavigation();\n\n\t\t//Get all pages and child pages\n\t\t$navigation = $this->buildNavHierachy(new UnorderedList());\n\n\t\t//Convert and return\n\t\treturn $navigation->toHtml();\n\t}", "function mai_do_header_right() {\n\tif ( ! ( is_active_sidebar( 'header_right' ) || has_nav_menu( 'header_right' ) ) ) {\n\t\treturn;\n\t}\n\n\t// Header Right widget area\n\tif ( is_active_sidebar( 'header_right' ) ) {\n\t\t_mai_add_widget_header_menu_args();\n\t\tgenesis_widget_area( 'header_right' );\n\t\t_mai_remove_widget_header_menu_args();\n\t}\n\t// Header Right menu\n\tif ( has_nav_menu('header_right') ) {\n\t\techo genesis_get_nav_menu( array( 'theme_location' => 'header_right' ) );\n\t}\n}", "function v2_mumm_menu_link__menu_header(&$variables) {\n\n $element = $variables ['element'];\n $sub_menu = '';\n\n if ($element ['#below']) {\n $sub_menu = drupal_render($element ['#below']);\n }\n\n if (in_array('search-btn', $element['#localized_options']['attributes']['class'])) {\n\n $output = '<button id=\"search-btn\" class=\"icon icon-search-gray search-btn\" data-trigger-toggle=\"search-box\" title=\"\" name=\"search-btn\" type=\"button\"\n data-tracking data-track-action=\"click\" data-track-category=\"header\" data-track-label=\"search\" data-track-type=\"event\">\n </button>';\n }\n else {\n $class = $element['#localized_options']['attributes']['class'];\n $element['#localized_options']['attributes'] = array(\n 'class' =>$class,\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'header',\n 'data-track-label' => 'book_a_visit',\n 'data-track-type' => 'event',\n );\n\n $output = l($element ['#title'], $element ['#href'] , $element['#localized_options']);\n }\n return $output;\n}", "function farmhouse_header_left_menu() {\n genesis_nav_menu(\n array(\n 'theme_location' => 'header-left',\n 'depth' => 2,\n )\n );\n}", "function refined_magazine_main_header_right_menu()\r\n {\r\n $has_header_image = has_header_image();\r\n global $refined_magazine_theme_options;\r\n $search_class = '';\r\n if ($refined_magazine_theme_options['refined-magazine-enable-menu-section-search'] == 1):\r\n $show_search = 1;\r\n $search_class = 'ct-show-search';\r\n else:\r\n $show_search = 0;\r\n endif;\r\n $sticky_header_option = $refined_magazine_theme_options['refined-magazine-enable-sticky-primary-menu'];\r\n if($sticky_header_option == 1){\r\n $sticky_header_class = 'sticky-header';\r\n\r\n }else{\r\n $sticky_header_class = '';\r\n }\r\n\r\n $menu_alignment = $refined_magazine_theme_options['refined-magazine-change-primary-menu-position'];\r\n if ($menu_alignment == 'default-menu-position') {\r\n $menu_alignment_class = \"ct-center-aligned\";\r\n }else{\r\n $menu_alignment_class = 'ct-left-aligned';\r\n }\r\n if(!empty($search_class)){\r\n $menu_class = $menu_alignment_class.' '.$search_class;\r\n }else{\r\n $menu_class = $menu_alignment_class;\r\n }\r\n ?>\r\n <div class=\"refined-magazine-header-left-logo-wrapper logo-wrapper-block <?php echo $sticky_header_class; ?>\">\r\n <div class=\"site-branding\" <?php if (!empty($has_header_image)) { ?> style=\"background-image: url(<?php echo header_image(); ?>);\" <?php } ?>>\r\n <div class=\"container-inner\">\r\n <div class=\"refined-magazine-header-block refined-magazine-header-left-logo\" id=\"site-navigation\">\r\n <div class=\"refined-magazine-logo-main-container\">\r\n <div class=\"refined-magazine-logo-container text-center\">\r\n <?php\r\n if (function_exists('the_custom_logo')) {\r\n\r\n the_custom_logo();\r\n\r\n }\r\n if (is_front_page() && is_home()) : ?>\r\n <h1 class=\"site-title\"><a href=\"<?php echo esc_url(home_url('/')); ?>\"\r\n rel=\"home\"><?php bloginfo('name'); ?></a></h1>\r\n <?php else : ?>\r\n <p class=\"site-title\"><a href=\"<?php echo esc_url(home_url('/')); ?>\"\r\n rel=\"home\"><?php bloginfo('name'); ?></a></p>\r\n <?php\r\n endif;\r\n\r\n $description = get_bloginfo('description', 'display');\r\n if ($description || is_customize_preview()) : ?>\r\n <p class=\"site-description\"><?php echo $description; /* WPCS: xss ok. */ ?></p>\r\n <?php\r\n endif; ?>\r\n </div> <!-- refined-magazine-logo-container -->\r\n\r\n\r\n <div class=\"navbar-header clear\">\r\n <button class=\"menu-toggle\" aria-controls=\"primary-menu\"\r\n aria-expanded=\"false\"><i class=\"fa fa-bars\" aria-hidden=\"true\"></i></button>\r\n </div>\r\n </div> <!-- .refined-magazine-logo-main-container -->\r\n <div class=\"refined-magazine-menu-container clear <?php echo $menu_class; ?>\">\r\n <nav id=\"\" class=\"main-navigation\">\r\n <ul id=\"primary-menu\" class=\"nav navbar-nav nav-menu\">\r\n <?php\r\n if ($refined_magazine_theme_options['refined-magazine-enable-menu-home-icon'] == 1):\r\n if (is_front_page()) {\r\n $home_class = 'current-menu-item';\r\n } else {\r\n $home_class = '';\r\n }\r\n\r\n ?>\r\n <li class=\"<?php echo $home_class; ?>\"><a href=\"<?php echo esc_url(home_url('/')); ?>\">\r\n <i class=\"fa fa-home\"></i> </a></li>\r\n <?php\r\n endif;\r\n ?>\r\n <?php\r\n wp_nav_menu(array(\r\n 'theme_location' => 'menu-1',\r\n 'items_wrap' => '%3$s',\r\n 'container' => false\r\n ));\r\n ?>\r\n </ul>\r\n </nav><!-- #site-navigation -->\r\n <?php\r\n if ($show_search == 1):\r\n ?>\r\n <div class=\"ct-menu-search\"><a class=\"search-icon-box\" href=\"#\"> <i class=\"fa fa-search\"></i>\r\n </a></div>\r\n <div class=\"top-bar-search\">\r\n <?php get_search_form(); ?>\r\n <button type=\"button\" class=\"close\">\r\n </button>\r\n </div>\r\n <?php\r\n endif;\r\n ?>\r\n </div> <!-- refined-magazine-menu-container -->\r\n </div> <!-- .header-block -->\r\n </div>\r\n </div> <!-- .site-branding -->\r\n <?php\r\n //Check if header advertisement is enabled from customizer\r\n if ($refined_magazine_theme_options['refined-magazine-enable-ads-header'] == 1):\r\n ?>\r\n <div class=\"header-adv-section text-center\">\r\n <div class=\"container-inner clear\">\r\n <?php\r\n\r\n /**\r\n * refined_magazine_header_ads hook.\r\n *\r\n * @since 1.0.0\r\n *\r\n */\r\n do_action('refined_magazine_header_ads');\r\n ?>\r\n </div>\r\n </div>\r\n <?php\r\n\r\n\r\n endif;\r\n ?>\r\n </div>\r\n <?php\r\n\r\n }", "function soho_menu_link__header_menu(array $variables) {\n $output = '';\n unset($variables['element']['#attributes']['class']);\n $element = $variables['element'];\n static $item_id = 0;\n $menu_name = $element['#original_link']['menu_name'];\n\n // set the global depth variable\n global $depth;\n $depth = $element['#original_link']['depth'];\n\n if ( ($element['#below']) && ($depth == \"1\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children '.$element['#original_link']['mlid'].'';\n }\n \n if ( ($element['#below']) && ($depth >= \"2\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children';\n }\n \n $sub_menu = $element['#below'] ? drupal_render($element['#below']) : '';\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']);\n // if link class is active, make li class as active too\n if(strpos($output,\"active\")>0){\n $element['#attributes']['class'][] = \"current-menu-parent\";\n }\n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . '</li>';\n \n}", "function soho_menu_tree__header_menu($variables){\n return '<ul class=\"menu\" id=\"menu-main-menu\">' . $variables['tree'] . '</ul>';\n \n}", "function erp_get_menu_headers() {\n $menu = [];\n return apply_filters( 'erp_menu_headers', $menu );\n}", "function generate_header_items() {\n\t\t$order = apply_filters( 'generate_header_items_order',\n\t\t\tarray(\n\t\t\t\t'header-widget',\n\t\t\t\t'site-branding',\n\t\t\t\t'logo',\n\t\t\t)\n\t\t);\n\n\t\tforeach ( $order as $item ) {\n\t\t\tif ( 'header-widget' === $item ) {\n\t\t\t\tgenerate_construct_header_widget();\n\t\t\t}\n\n\t\t\tif ( 'site-branding' === $item ) {\n\t\t\t\tgenerate_construct_site_title();\n\t\t\t}\n\n\t\t\tif ( 'logo' === $item ) {\n\t\t\t\tgenerate_construct_logo();\n\t\t\t}\n\t\t}\n\t}", "protected function buildMenu() {\n// $structures = DataSource::factory(Structure::cls());\n// $structures->builder()\n// ->where(\"structure_id=0\")\n// ->order('priority');\n// /** @var Structure[] $aStructures */\n// $aStructures = $structures->findAll();\n// foreach ($aStructures as $oStructure) {\n// $menu->addLeftItem($oStructure->name, $oStructure->path);\n// $this->loadMenuItems($menu->findLeftItemByPath($oStructure->path), $oStructure);\n// }\n//\n// $view = new ViewMMenu();\n// $view->menu = $menu;\n// return $view;\n\n $ViewMainMenu = new ViewMainMenu($this->config['name']);\n $this->setMenuItems($ViewMainMenu->itemsList);\n $currentPath = explode('?', $this->Router->getRoute());\n $ViewMainMenu->currentPath = reset($currentPath);\n\n return $ViewMainMenu;\n }", "function header_menu( $data ) {\n\t\t\t\t\t\tif (($locations = get_nav_menu_locations()) && isset($locations[ 'sgn_menu' ])) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Retrieve the menu in location sgn_menu */\n\t\t\t\t\t\t\t$menu = wp_get_nav_menu_object($locations['sgn_menu']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Create an empty array to store our JSON */\n\t\t\t\t\t\t\t$menuItems = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* If the menu isn't empty, start process of building an array, otherwise return a 404 error */\n\t\t\t\t\t\t\tif (!empty($menu)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Assign array of navigation items to $menu_items variable */\n\t\t\t\t\t\t\t\t$menu_items = wp_get_nav_menu_items($menu->term_id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* if $menu_items isn't empty */\n\t\t\t\t\t\t\t\tif ($menu_items) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* for each menu item, verify the menu item has no parent and then push the menu item to the $menuItems array */\n\t\t\t\t\t\t\t\t\tforeach ($menu_items as $key => $menu_item) {\n\t\t\t\t\t\t\t\t\t\tif ($menu_item->menu_item_parent == 0) {\n\t\t\t\t\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t\t\t\t$menuItems, array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'title' => $menu_item->title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'url' => $menu_item->url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'slug' => $menu_item->slug\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t\t\t\t'no_menus',\n\t\t\t\t\t\t\t\t\t'Could not find any menus',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'status' => 404\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Return array of list items with title and url properties */\n\t\t\t\t\t\t\t\treturn $menuItems;\n\t\t\t\t\t}", "function kvell_edge_include_header_vertical_menu( $menus ) {\n\t\t$menus['vertical-navigation'] = esc_html__( 'Vertical Navigation', 'kvell' );\n\t\t\n\t\treturn $menus;\n\t}", "function farmhouse_header_right_menu() {\n genesis_nav_menu(\n array(\n 'theme_location' => 'header-right',\n 'depth' => 2,\n )\n );\n}", "function showHeader() {\n\tglobal $itemid, $dispnum, $cidmaps;\n\t?>\n\n</div> <!-- end content div so we can display rnav properly-->\n\n<!-- right side menu -->\n<div class=\"rnav\"><ul>\n <li><a id=\"<?php echo ($itemid=='' ? 'current':'') ?>\" href=\"config.php?display=<?php echo urlencode($dispnum)?>\"><?php echo _(\"Add Route Map\")?></a></li>\n<?php\nif (isset($cidmaps)) {\n\tforeach ($cidmaps as $cidsource) {\n\t\tif ($cidsource['destid'] != 0) {\n\t\t\techo \"<li><a id=\\\"\".($itemid==$cidsource['destid'] ? 'current':'').\"\\\" href=\\\"config.php?display=\";\n\t\t\techo urlencode($dispnum).\"&action=edit&itemid=\".$cidsource['destid'].\"\\\">{$cidsource['name']}</a></li>\";\n\t\t}\n\t}\n}\n?>\n<li><a href=\"config.php?display=<?php echo urlencode($dispnum); ?>&action=override\">Manage Overrides</a></li>\n</ul></div>\n\n<div class=\"content\">\n<?php\n}", "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "function kvell_edge_get_header_vertical_main_menu() {\n\t\t$opening_class = '';\n\t\t$menu_opening = kvell_edge_options()->getOptionValue('vertical_menu_dropdown_opening');\n\n\t\tif ($menu_opening !== '') {\n\t\t\t$opening_class .= 'edgtf-vertical-dropdown-'.$menu_opening;\n\t\t}\n\n\t\t$params = array(\n\t\t\t'opening_class' => $opening_class\n\t\t);\n\n\t\tkvell_edge_get_module_template_part( 'templates/vertical-navigation', 'header/types/header-vertical', '', $params );\n\t}", "function v2_mumm_menu_tree__menu_header(&$variables) {\n return $variables['tree'];\n}", "function _mai_add_widget_header_menu_args() {\n\tadd_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );\n\tadd_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );\n}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public function getHeaderNavigation($controller = '')\n {\n $menuPath = APPLICATION_PATH . '/configs/backend.menu.yaml';\n if (Globals::isMobile()) {\n $menuPath = APPLICATION_PATH . '/configs/backend.menu.mobile.yaml';\n }\n $config = new Zend_Config_Yaml($menuPath);\n $menu = $config->toArray();\n\n // Defend on linkSystem data\n $this->setMenu($menu);\n \n $session = Globals::getSession();\n if ($session->fullPermission === false) {\n $adminConfig = Globals::getApplicationConfig('admin');\n $exceptModules = explode(',', $adminConfig->except->modules);\n \n foreach ($exceptModules as $module) {\n $module = trim($module);\n if (isset($module, $menu)) {\n unset($menu[$module]);\n }\n }\n }\n \n return $menu;\n }", "public function processHeader()\n {\n $toggle =\n '<button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#' . $this->getWidgetId() . '_collapse\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>';\n\n $brand = '';\n if ($this->getBrand())\n {\n $brand = $this->getBrand();\n $brand = self::$html->decode(self::$html->link($brand[1], $brand[0], ['class' => 'navbar-brand']));\n }\n\n $this->addHeader($this->createWrapper('div', ['class' => 'navbar-header'], $toggle . $brand));\n }", "function soho_menu_tree__header_menu_below($variables){\n return '<ul class=\"sub-menu\">' . $variables['tree'] . '</ul>';\n}", "function gwt_drupal_links__menu_top_right($variables) {\n $links = menu_tree_all_data('menu-top-right', null, 4);\n\n // heading not needed in main menu\n $heading = $variables['heading'];\n // global $language_url;\n $output = '';\n\n $output .= _gwt_drupal_link_render($links, 0, $variables);\n\n return $output;\n}", "private function left_menu()\n\t\t{\n\t\t\t $page_name = functions::get_page_name();\n\t\t\techo '\n\t\t\t\t<ul>\n\t\t\t\t\t';\n\t\t\t\t\t\n\t\t\t\t\t$content_module = array('manage_content.php', 'register_content.php', 'manage_page_content.php', 'register_page_content.php','manage_content_option.php', 'register_content_option.php'\n\t\t\t\t\t,'manage_category.php', 'register_category.php');\n\t\t\t\t\tif(in_array($page_name, $content_module))\n\t\t\t\t\t{\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t<img src=\"images/icon-content.png\" alt=\"Manage CMS\" title=\"Manage CMS\" width=\"24\" height=\"24\" />\n\t\t\t\t\t\t<a href=\"manage_content.php\">CMS</a>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li><a href=\"manage_page_content.php\">Page Content</a></li>\n\t\t\t\t\t\t<li><a href=\"manage_category.php\">Category</a></li>\n\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<li><img src=\"images/icon-content.png\" alt=\"Manage CMS\" title=\"Manage CMS\" width=\"24\" height=\"24\" /><a href=\"manage_content.php\" >CMS</a></li>';\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\techo '<li><img src=\"images/icon-member.png\" alt=\"Manage Member\" title=\"Manage Member\" width=\"24\" height=\"24\" /><a href=\"manage_member.php\" >Member</a></li>\n\t\t\t\t\t<!--<li><img src=\"images/icon-property.png\" alt=\"Manage Property Type\" title=\"Manage Property Type\" width=\"24\" height=\"24\" /><a href=\"manage_property_type.php\" >Property Type</a></li>-->\n\t\t\t\t\t\n\t\t\t\t\t<li><img src=\"images/icon-property.png\" alt=\"Manage Hotel\" title=\"Manage Hotel\" width=\"24\" height=\"24\" /><a href=\"manage_hotel.php\" >Hotel</a></li>\n\t\t\t\t\t<li><img src=\"images/icon-restaurant.jpg\" alt=\"Manage Restaurant\" title=\"Manage Restaurant\" width=\"24\" height=\"24\" /><a href=\"manage_restaurant.php\" >Restaurant</a></li>\n\t\t\t\t\t<li><img src=\"images/icon-venue.png\" alt=\"Manage Venue\" title=\"Manage Venue\" width=\"24\" height=\"24\" /><a href=\"manage_venue.php\" >Venue</a></li>\n\t\t\t\t\t';\n\t\t\t\t\t\t\n\t\techo '</ul>';\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t}", "public function buildHeader() {\n $header['label'] = $this->t('Label');\n $header['workflow'] = $this->t('Workflow');\n $header['status'] = $this->t('Status');\n $header['transition'] = $this->t('Transitions');\n $header['roles'] = $this->t('Email Roles');\n $header['author'] = $this->t('Email Author');\n $header['emails'] = $this->t('Adhoc Emails');\n return $header + parent::buildHeader();\n }", "function erp_render_menu_header( $component ) {\n $headers = erp_get_menu_headers();\n if ( empty( $headers[$component] ) ) {\n return \"\";\n }\n\n $html = sprintf( '<div class=\"erp-page-header\">\n <div class=\"module-icon\">\n %s\n </div>\n <h2>%s</h2>\n </div>',\n $headers[$component]['icon'], $headers[$component]['title'] );\n\n return $html;\n}", "public function buildMenu() {\n $content = array();\n\n $headers = array(\n t(\"Menu keuze\"),\n t(\"Functie\"), \n );\n $rows[] = array(\n t(\"<b>Tabel beheer</b>\"),\n t(\"\"),\n );\n $rows[]= array(\n t(\"<a href= ezac/leden/>Leden administratie</a>\"),\n t(\"Inzage en wijzigen leden informatie\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/leden/update>Lid toevoegen</a>\"),\n t(\"Invoeren gegevens nieuw lid\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/kisten/>Vloot administratie</a>\"),\n t(\"Inzage en wijzigen vloot informatie\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/kisten/update>Kist toevoegen</a>\"),\n t(\"Invoeren gegevens nieuw vliegtuig\"),\n );\n $rows[] = array(\n t(\"<b>Startadministratie</b>\"),\n t(\"\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/starts>Startadministratie</a>\"),\n t(\"Overzicht startadministratie\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/starts/create/>Start invoer</a>\"),\n t(\"Invoeren nieuwe start\"),\n );\n $rows[] = array(\n t(\"<b>Voortgang / Bevoegdheden administratie</b>\"),\n t(\"\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/vba>Overzicht</a>\"),\n t(\"Overzicht VBA gegevens\"),\n );\n $rows[] = array(\n t(\"<a href= ezac/vba>Invoeren</a>\"),\n t(\"Invoeren verslagen en bevoegdheden\"),\n );\n\n $table = array(\n '#type' => 'table',\n '#caption' => t(\"EZAC administratie hoofdmenu\"),\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('Geen gegevens beschikbaar.'),\n '#sticky' => TRUE,\n '#prefix' => '<div id=\"menu-div\">',\n '#suffix' => '</div>',\n '#weight' => 2,\n );\n\n return $table;\n }", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "function erp_add_menu_header( $component, $title, $icon = \"\" ) {\n add_filter('erp_menu_headers', function($menu) use( $component, $title, $icon ) {\n $menu[ $component ] = [ 'title' => $title, 'icon' => $icon ];\n return $menu;\n });\n}", "private function build_navigation() {\n\t\t$content = \"<nav id='formlift-header' class='formlift-nav'>\";\n\t\tforeach ( $this->sections as $section ) {\n\t\t\t$content .= $section->get_header();\n\t\t}\n\n\t\treturn $content . \"<button type='submit' style='margin: 45px' class='button button-large'>SAVE CHANGES</button></nav>\";\n\t}", "public function topMenuNavigation() {\n\t\t$out = '';\n\t\tif($modules = DataObject::get('WorkflowCategory', '', 'priority ASC')) {\n\t\t\tforeach ($modules as $module) {\n\t\t\t\tif (Permission::check(strtoupper(str_replace(\" \", \"_\", $module->name)))) {\n\t\t\t\t\t$icon = '';\n\t\t\t\t\tif($image = DataObject::get_by_id('Image', $module->imageID)) {\n\t\t\t\t\t\tif($smImage = $image->setSize(16,16)) {\n\t\t\t\t\t\t\t$icon = $smImage->URL;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$out .= \"\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: '{$module->name}', \n\t\t\t\t\t\ticon: '{$icon}',\n\t\t\t\t\t\tmenu: {$this->moduleItems($module->ID)}\n\t\t\t\t\t},\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public function _built_right_menu()\n\t{\n\t\treturn '';\n\t}", "public function _built_right_menu()\n\t{\n\t\treturn '';\n\t}", "protected function _build_header(){\n\t\t$html = '';\n\t\t\n\t\t$html .= '<div class=\"container-narrow marginTop60\">';\r\n\t\t$html .= '<a href=\"'.home_url('/').'\">';\r\n\t\t$html .= '<img src=\"'.get_header_image().'\" height=\"'.get_custom_header()->height .'\"\r\n\t\twidth=\"'.get_custom_header()->width.'\" alt=\"\" class=\"marginTop40 marginBottom20\"\r\n\t\talign=\"center\"/>\r\n\t\t</a>';\r\n\t\t$html .= '<p class=\"centerText\">'.get_bloginfo('description').'</p>';\r\n\t\t$html .= '<hr class=\"marginBottom20 width50\">';\r\n\t\t$html .= '</div>';\n\t\t\n\t\techo $html;\n\t}", "function mai_do_header() {\n\t$left = mai_get_do_action( 'mai_header_left' );\n\t$right = mai_get_do_action( 'mai_header_right' );\n\t$has_mobile = apply_filters( '_mai_mobile_menu', true ); // Mobile menu kill switch. In landing.php also.\n\t$mobile = ! mai_is_side_menu_enabled() ? mai_get_mobile_menu() : '';\n\n\t/**\n\t * Add classes to know when the header has left or right header content.\n\t *\n\t * @param array $attributes The header attributes.\n\t *\n\t * @return array The modified attributes.\n\t */\n\tadd_filter( 'genesis_attr_site-header', function( $attributes ) use ( $left, $right ) {\n\n\t\tif ( ! ( $left || $right ) ) {\n\t\t\t$attributes['class'] .= ' no-header-content';\n\t\t}\n\n\t\tif ( $left ) {\n\t\t\t$attributes['class'] .= ' has-header-left';\n\t\t}\n\n\t\tif ( $right ) {\n\t\t\t$attributes['class'] .= ' has-header-right';\n\t\t}\n\n\t\treturn $attributes;\n\n\t});\n\n\t/**\n\t * Filter the (site) header context of the genesis_structural_wrap.\n\t * Add new before/after header content hooks.\n\t *\n\t * @return string|HTML The content\n\t */\n\tadd_filter( 'genesis_structural_wrap-header', function( $output, $original_output ) use ( $left, $right, $has_mobile, $mobile ) {\n\n\t\tif ( 'open' == $original_output ) {\n\n\t\t\t// Default classes.\n\t\t\t$row['class'] = 'site-header-row row middle-xs';\n\n\t\t\t// Alignment.\n\t\t\t$row['class'] .= $has_mobile ? ' between-xs' : ' around-xs';\n\n\t\t\t// Justification. If no left or right, and we have mobile. If no mobile we already have around-xs.\n\t\t\t$row['class'] .= ( ! ( $left || $right ) && $has_mobile ) ? ' around-md' : '';\n\n\t\t\t// Output with row open.\n\t\t\t$output = $output . sprintf( '<div %s>', genesis_attr( 'site-header-row', $row ) );\n\n\t\t} elseif ( 'close' == $original_output ) {\n\n\t\t\t// Build header left markup.\n\t\t\tif ( $left ) {\n\n\t\t\t\t$left_atts['class'] = 'header-left col col-xs';\n\n\t\t\t\tif ( $right ) {\n\t\t\t\t\t$left_atts['class'] .= ' col-md-6 col-lg first-lg text-xs-right';\n\t\t\t\t} else {\n\t\t\t\t\t$left_atts['class'] .= ' first-xs';\n\t\t\t\t}\n\n\t\t\t\t$left = sprintf( '<div %s>%s</div>', genesis_attr( 'header-left', $left_atts ), $left );\n\n\t\t\t}\n\n\t\t\t// Build header right markup.\n\t\t\tif ( $right ) {\n\n\t\t\t\t$right_atts['class'] = 'header-right col col-xs';\n\n\t\t\t\tif ( $left ) {\n\t\t\t\t\t$right_atts['class'] .= ' col-md-6 col-lg text-xs-left';\n\t\t\t\t} else {\n\t\t\t\t\t$right_atts['class'] .= ' text-xs-right';\n\t\t\t\t}\n\n\t\t\t\t$right = sprintf( '<div %s>%s</div>', genesis_attr( 'header-right', $right_atts ), $right );\n\n\t\t\t}\n\n\t\t\t// Output with row close.\n\t\t\t$output = $left . $right . $output . $mobile . '</div>';\n\n\t\t}\n\n\t\treturn $output;\n\n\t}, 10, 2 );\n\n\t// Add Flexington classes to the title area\n\tadd_filter( 'genesis_attr_title-area', function( $attributes ) use ( $left, $right ) {\n\n\t\t// Default classes\n\t\t$attributes['class'] .= ' col col-xs-auto';\n\n\t\t// If left and right content, or logo\n\t\tif ( $left && $right ) {\n\n\t\t\t$attributes['class'] .= ' col-md-12 col-lg-auto';\n\n\t\t\tif ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) {\n\t\t\t\t$attributes['class'] .= ' text-xs-center';\n\t\t\t}\n\t\t}\n\n\t\t// If left or right content\n\t\tif ( $left || $right ) {\n\n\t\t\t$attributes['class'] .= ' start-xs';\n\t\t\tif ( $left && ! $right ) {\n\t\t\t\t$attributes['class'] .= ' last-xs';\n\t\t\t}\n\n\t\t} else {\n\t\t\t$attributes['class'] .= ' center-xs';\n\t\t}\n\n\t\treturn $attributes;\n\n\t});\n\n}", "function makeSideMenu($title, $menu){\n $output = '<h3 class=\"sidetitle\">'.$title.'</h3>'.\n makeMenu($menu);\n return $output;\n}", "function makeMenu($what)\n{\n global $language;\n if($what==\"header\") {\n echo \"<a href=\\\"index.php?action=home\\\" target=\\\"main\\\"><div align=\\\"center\\\"><img border=\\\"0\\\" src=\\\"\".AdminMenuLogoLocation.\"\\\"></a></div>\\r\\n\";\n echo \"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"5\\\">\\r\\n\";\n }\n if($what==\"separator\") {\n echo \"<tr><td></td></tr>\\r\\n\";\n }\n if($what==\"footer\") {\n echo \"<tr><td><hr></td></tr>\\r\\n\";\n echo \"</table>\\r\\n\";\n }\n}", "function theme_hbmode_process_header($app, &$vars) {\n $entries = $app->module('collections')->find(\"main_menu\");\n foreach ($entries as $entry) {\n $vars['links'][$entry['_id']] = [\n 'title' => $entry['title'],\n 'slug' => $entry['link'],\n ];\n }\n}", "function build_menubar() {\n // get the menu bar data from config\n $i = $this->config->item('menu_choices');\n $t = $i['menudata'];\n $this->data['menudata'] = $t;\n\n // check if anyone is logged in\n if ($this->session->userdata('username')) {\n // if so, display logout button\n $this->data['welcome_txt'] = 'Welcome, ' . $this->session->userdata('username');\n $this->data['login_submit_txt'] = 'Logout';\n $this->data['login_btn_appear'] = 'none';\n $this->data['login_action'] = 'logout';\n } else {\n // if no one is logged in, display the login box\n $this->data['welcome_text'] = '';\n $this->data['login_submit_txt'] = 'Login';\n $this->data['login_btn_appear'] = 'initial';\n $this->data['login_action'] = 'login';\n }\n\n // parse the menu bar\n $this->data['menubar'] = $this->parser->parse('_menubar', $this->data, true); //$this->config->item('menu_choices')\n }", "function template_navigation() {\n\t\t$_ENV['menu'] = array();\n\t\t$_ENV['menu']['Main'] = _URL_;\n\t\tModule::includes('menus');\n\t\t$_ENV['menu']['Preferences'] = '?module=prefs';\n\t\t$_ENV['menu']['Logout'] = '?logout=true';\n\n\t\t$buffer = '<ul><li><h2>';\n\t\t$buffer .= array_key_exists('Menu',$_ENV['imgs']['menu']) \n\t\t\t? '<img src=\"'.$_ENV['imgs']['menu']['Menu'].'\" border=\"0\" /> ' : ' ';\n\t\t$buffer .= ' Main Menu</h2><ul>';\n\t\tforeach ($_ENV['menu'] as $module => $items) {\n\t\t\tif (is_array($items)) {\n\t\t\t\t$buffer .= '<li><a href=\"#\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.'</a><ul>';\n\t\t\t\tforeach ($items as $label => $url) {\n\t\t\t\t\t$buffer .= '<li><a href=\"'.$url.'\">';\n\t\t\t\t\t$buffer .= array_key_exists($label,$_ENV['imgs']['menu'])\n\t\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$label].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t\t$buffer .= $label.'</a></li>';\n\t\t\t\t}\n\t\t\t\t$buffer .= '</ul></li>';\n\t\t\t} else {\n\t\t\t\t$buffer .= '<li><a href=\"'.$items.'\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.' </a></li>';\n\t\t\t}\t\n\t\t}\n\t\t$buffer .= '</ul></li></ul>';\n\t\treturn $buffer;\n\t}", "public function displayHeader()\n {\n parent::displayHeader();\n\n $this->printHtml('<div class=\"aiMainContent clearfix\">');\n\n $this->printHtml('<div class=\"aiTopNav\">');\n\n if ( $this->isLoggedIn() ) {\n\n $userObj = $this->getUser();\n $roleObj = $userObj->getRole();\n\n $this->printHtml('<!-- role: ' . $roleObj->name . ' -->');\n\n $this->printHtml('<ul class=\"basictab\">');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '\">' . $this->getSiteTitle() . '</a></li>');\n\n $allowedRoles = array( 'user', 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/test/suites/\">Suites</a></li>');\n }\n\n $allowedRoles = array( 'user', 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/tests/\">Tests</a></li>');\n }\n\n $allowedRoles = array( 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n // $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/folders/\">Folders</a></li>');\n }\n\n $allowedRoles = array( 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml(\n '<li><a href=\"' . $this->getBaseUrl() . '/test/param/library/\">' .\n 'Parameter Library' .\n '</a></li>'\n );\n }\n\n $allowedRoles = array( 'qa', 'admin' );\n if ( in_array($roleObj->name, $allowedRoles) ) {\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/test/runs/\">Runs</a></li>');\n }\n\n\n $this->printHtml(\n '<li><a href=\"' . $this->getBaseUrl() . '/user/logout/\">' .\n 'Logout : ' . $this->escapeVariable($userObj->username) . \n '</a></li>'\n );\n\n $this->printHtml('</ul>');\n\n if ( $this->isLoggedIn() && $roleObj->name == 'admin' ) {\n $this->printHtml('<ul class=\"basictab\">');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/user/manager/\">Manage Users</a></li>');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl(). '/test/machines/\">Machines</a></li>');\n $this->printHtml('</ul>');\n }\n } else {\n $this->printHtml('<ul class=\"basictab\">');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/user/login/\">Login</a></li>');\n $this->printHtml('<li><a href=\"' . $this->getBaseUrl() . '/user/create/\">Create Account</a></li>');\n $this->printHtml('</ul>');\n }\n\n\n $this->printHtml('</div>');\n\n return true;\n }", "public function buildMenu($params)\n {\n\n $iconMenu = '<i class=\"icon-reorder\" ></i>';\n $iconClose = '<i class=\"icon-remove \" ></i>';\n $iconEntity = $this->view->icon('control/entity.png' , 'Entity' );\n\n $entries = new TArray();\n\n $this->content = <<<HTML\n\n <div class=\"inline\" >\n <button\n class=\"wcm wcm_control_dropmenu wgt-button\"\n id=\"{$this->id}-control\"\n wgt_drop_box=\"{$this->id}\" ><i class=\"icon-reorder\" ></i> {$this->view->i18n->l('Menu','wbf.label')}</button>\n <var id=\"{$this->id}-control-cfg-dropmenu\" >{\"triggerEvent\":\"mouseover\",\"closeOnLeave\":\"true\"}</var>\n </div>\n\n <div class=\"wgt-dropdownbox\" id=\"{$this->id}\" >\n <ul>\n <li>\n <a class=\"wgtac_close\" ><i class=\"icon-remove\" ></i> {$this->view->i18n->l('Close', 'wbf.label')}</a>\n </li>\n </ul>\n </div>\n\nHTML;\n\n $this->content .= $this->crumbs;\n\n $this->content .= <<<HTML\n<div class=\"right\" >\n <input\n type=\"text\"\n id=\"wgt-input-webfrap_navigation_search-tostring\"\n name=\"key\"\n class=\"large wcm wcm_ui_autocomplete wgt-ignore\" />\n <var class=\"wgt-settings\" >\n {\n \"url\" : \"ajax.php?c=Webfrap.Navigation.search&amp;key=\",\n \"type\" : \"ajax\"\n }\n </var>\n <button\n id=\"wgt-button-webfrap_navigation_search\"\n class=\"wgt-button append\"\n >\n <i class=\"icon-search\" ></i> Search\n </button>\n\n</div>\nHTML;\n\n }", "protected function generateModuleMenu() {}", "public function admin_header( array $header_data = array(), string $menu_key = '', array $menu_items = array() ) : array {\n\t\t\t// Clear out $header_data if we are showing our page.\n\t\t\treturn $menu_key === $this->parent_menu_page_url ? array() : $header_data;\n\t\t}", "public function admin_header( array $header_data = array(), string $menu_key = '', array $menu_items = array() ) : array {\n\t\t\t// Clear out $header_data if we are showing our page.\n\t\t\treturn $menu_key === $this->parent_menu_page_url ? array() : $header_data;\n\t\t}", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "public function renderNav() {\n if($this->renderNav['onoff']) {\n \n if(isset($this->renderNav['html']) && $this->renderNav['html']) {\n $content = $this->renderNav['html'];\n unset($this->renderNav['html']);\n } else {\n $ct['btnAddNav'] = $this->btnAddNav;\n $ct['btnAddMultiNav'] = $this->btnAddMultiNav;\n $ct['btnDeleteNav'] = $this->btnDeleteNav;\n $ct['btnCopyNav'] = $this->btnCopyNav;\n $result = '';\n $get = r()->get();\n foreach($ct as $key => $item) {\n if($item && isset($item['onoff']) && $item['onoff']) {\n unset($item['onoff']);\n if(isset($item['href'])) {\n $href = $item['href'];\n unset($item['href']);\n } else {\n $params = isset($get['SettingsGridSearch']['table_id']) ? $get : [];\n $params['menu_admin_id'] = $this->menu_admin_id;\n $href = UtilityUrl::createUrl($item['link_children'],$params);\n }\n $html = $item['icon'].$item['html'];unset($item['html']);unset($item['icon']);unset($item['link_children']);\n $result .= Html::a($html, $href, $item).' ';\n }\n }\n $content = '<div class=\"fr\">'.$result.'</div>';\n }\n unset($this->renderNav['onoff']);\n $html = Html::tag('div',$content.$this->renderNavLeft, $this->renderNav);\n return $html;\n } else {\n return '';\n }\n }", "public static function getLeftPanelMenu()\n\t{\n $arr[\"Create new mailer\"] = \"createMailer\";\n $arr[\"Form Query(Jeevansathi)\"] = \"formQueryJs\";\n $arr[\"Form Query(99acres)\"] = \"formQuery_99\";\n $arr[\"Upload a CSV\"] = \"csvUpload\";\n $arr[\"Write Mail\"] = \"writeMail\";\n $arr[\"Set Test Email Id \"] = \"setTestId\";\n $arr[\"Mail Fire Menu\"] = \"fireMenu\";\n $arr[\"MIS\"] = \"mis\";\n\t\t\t\t$arr[\"MIS-99\"] = \"mis99\";\n $arr[\"MIS-Generate Csv\"] = \"createCsv\";\n $arr[\"Get Link For Client MIS\"] = \"clientMISLink\";\n $arr[\"Logout\"] = \"logout\";\n\t\treturn $arr;\n\t}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"RAD Facility\", \"LIBRARIES\", \"_rad_facility\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_dxcodes\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function MyMod_Items_Menu_Horisontal($args,$items,$argskey,$idkey=\"ID\",$namekeys=array(),$titlekeys=array(),$title=\"\",$current=0,$anchor=\"\")\n {\n return\n $this->HRefMenu\n (\n $title,\n $this->MyMod_Items_Menu_HRefs\n (\n $args,\n $items,\n $argskey,\n $idkey,\n $namekeys,\n $titlekeys,\n $title,\n $current,\n $anchor\n )\n );\n \n }", "function _header_module($options)\n\t{\n\t\tglobal $meta_fields;\t\t\t$height='';\n\t\n\t\tif ( isset ( $options['hm_header_style'] ) && !empty ( $options['hm_header_style'] ) ) { \n\t\t\t$style = 'uh_'.$options['hm_header_style'];\n\t\t} else { \n\t\t\t$style = '';\n\t\t}\n\t\tif ( !empty ( $options['hm_header_height'] ) ) {\t\t\t$height='style=\"height:'.$options['hm_header_height'].'px;min-height:'.$options['hm_header_height'].'px\"\"';\t\t}\n\n\t?>\n\t\t<div id=\"page_header\" class=\"<?php echo $style; ?> bottom-shadow\" <?php echo $height;?>>\n\t\t\t<div class=\"bgback\"></div>\n\t\t\t\n\t\t\t<div data-images=\"<?php echo IMAGES_URL; ?>/\" id=\"sparkles\"></div>\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t<div class=\"container\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"span6\">\n\t\t\t\t\t\n\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Breadcrumbs check\n\t\t\t\t\t\t\tif ( isset ( $options['hm_header_bread'] ) && !empty ( $options['hm_header_bread'] ) ) {\n\t\t\t\t\t\t\t\tzn_breadcrumbs();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Date check\n\t\t\t\t\t\t\tif ( isset ( $options['hm_header_date'] ) && !empty ( $options['hm_header_date'] ) ) {\n\t\t\t\t\t\t\t\techo '<span id=\"current-date\">'.date_i18n(get_option('date_format') ,strtotime(date(\"l M d, Y\"))).'</span>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"span6\">\n\t\t\t\t\t\t<div class=\"header-titles\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Title check\n\t\t\t\t\t\t\tif ( isset ( $options['hm_header_title'] ) && !empty ( $options['hm_header_title'] ) ) {\n\t\t\t\t\t\t\t\tif ( isset ( $meta_fields['page_title'] ) && !empty ( $meta_fields['page_title'] ) ) {\n\n\t\t\t\t\t\t\t\t\techo '<h2>'.do_shortcode( stripslashes( $meta_fields['page_title'] ) ).'</h2>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\techo '<h2>'.get_the_title().'</h2>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t?> \n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Subtitle check\n\t\t\t\t\t\t\tif ( isset ( $options['hm_header_subtitle'] ) && !empty ( $options['hm_header_subtitle'] ) ) {\n\t\t\t\t\t\t\t\tif ( isset ( $meta_fields['page_subtitle'] ) && !empty ( $meta_fields['page_subtitle'] ) ) {\n\n\t\t\t\t\t\t\t\t\techo '<h4>'.do_shortcode( stripslashes( $meta_fields['page_subtitle'] ) ).'</h4>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div><!-- end row -->\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"zn_header_bottom_style\"></div>\n\t\t</div><!-- end page_header -->\n\t<?php\t\n\t}", "public function createMainMenuRight(Request $request)\n {\n \t$menu = $this->factory->createItem('root', array(\n \t\t\t'childrenAttributes' => array('class' => 'pull-right')\n \t));\n \n \t$this->addMainMenuRight($menu);\n \n \t$menu->setCurrent($request->getRequestUri());\n \n \treturn $menu;\n }", "public function renderHeader()\n {\n if ($this->title !== false || $this->headerPrependTitle !== false || $this->headerAppendTitle !== false) {\n echo CHtml::openTag('div', $this->htmlHeaderOptions);\n\n $this->renderMenu();\n $this->_renderPrependTitle();\n\n if ($this->title) {\n $this->title = '<h3 class=\"bootstrap-widget-header__title\">' . $this->title . '</h3>';\n if ($this->headerIcon) {\n $this->title = '<i class=\"' . $this->headerIcon . '\"></i>' . $this->title;\n }\n echo $this->title;\n }\n $this->_renderAppendTitle();\n $this->renderButtons();\n\n echo CHtml::closeTag('div');\n }\n }", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}", "public function createMenu()\n {\n $parent = $this->Menu()->findOneBy(['label' => 'Artikel']);\n\n $this->createMenuItem(\n [\n 'label' => 'Custom sort',\n 'controller' => 'CustomSort',\n 'action' => 'Index',\n 'active' => 0,\n 'class' => 'sprite-blue-document-text-image',\n 'parent' => $parent,\n 'position' => 6,\n ]\n );\n }", "public function getHeaderMenu($active='') {\n return htcms_get_header_menu($active);\n }", "public function makeMenu() {}", "protected function buildMenuArray() {}", "public function menuItems()\n\t{\n\t\treturn array(\n array('label'=>$this->labelMenu!==null?$this->labelMenu:Yii::t('app','Generator'), 'icon'=>'fa fa-code', 'url'=>'#','items'=>$this->getMyselfMenu(),'visible'=>Yii::app()->getModule('users')->check('root')),\n );\n\t}", "function register_menus() {\n register_nav_menu('header-menu', __('Header Menu'));\n}", "public function buildHeader() {\n return [\n ['data' => t('Teaching format'), 'class' => ['align-middle']],\n ['data' => t('Event'), 'class' => ['align-middle']],\n ['data' => t('Tutor'), 'class' => ['align-middle']],\n ['data' => t('Location'), 'class' => ['align-middle']],\n ['data' => t('Room'), 'class' => ['align-middle']],\n [\n 'data' => t('Date/time'),\n 'field' => 'time.field_event_time_value',\n 'sort' => 'desc',\n 'class' => ['align-middle'],\n ],\n ['data' => t('Registration status'), 'class' => ['align-middle']],\n ];\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->id() == $this->current->id() ) {\n $this->menu[]=$item;\n $this->appendChildren();\n } else if ( $item->parent_id() == $this->current->parent_id() ) {\n $this->menu[]=$item;\n }\n }\n reset ( $this->menu );\n }", "public function create_menu()\n\t{\n\t\t$obj = $this; // PHP 5.3 doesn't allow $this usage in closures\n\n\t\t// Add main menu page\n\t\tadd_menu_page(\n\t\t\t'Testimonials plugin', // page title\n\t\t\t'Testimonials', // menu title\n\t\t\t'manage_options', // minimal capability to see it\n\t\t\t'jststm_main_menu', // unique menu slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('main_menu'); // render main menu page template\n\t\t\t},\n\t\t\tplugins_url('images/theater.png', dirname(__FILE__)), // dashboard menu icon\n\t\t\t'25.777' // position in the dahsboard menu (just after the Comments)\n\t\t);\n\t\t// Add help page\n\t\tadd_submenu_page(\n\t\t\t'jststm_main_menu', // parent page slug\n\t\t\t'Testimonials plugin help', // page title\n\t\t\t'What is this?', // menu title\n\t\t\t'manage_options', // capability\n\t\t\t'jststm_help', // slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('help_page');\n\t\t\t}\n\t\t);\n\t}", "public function admin_head(){\r\n global $submenu;\r\n \r\n if(isset( $submenu[self::menu_tag] ) \r\n &&isset($submenu[self::menu_tag][0])\r\n &&isset($submenu[self::menu_tag][0][2])\r\n &&$submenu[self::menu_tag][0][2]==self::menu_tag){\r\n \r\n unset( $submenu[self::menu_tag][0] );\r\n }\r\n }", "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "function quadro_site_menu() {\n\tglobal $quadro_options;\n\tif ( $quadro_options['menu_header_display'] == 'hide' ) return false;\n\t?>\n\t<h1 class=\"menu-toggle\">\n\t\t<a href=\"#msite-navigation\">\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-1\"></span>\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-2\"></span>\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-3\"></span>\n\t\t</a>\n\t</h1>\n\t<nav id=\"site-navigation\" class=\"main-navigation\">\n\t\t<div class=\"inner-nav\">\n\t\t\t<a class=\"skip-link screen-reader-text\" href=\"#content\"><?php esc_html_e( 'Skip to content', 'indigo' ); ?></a>\n\t\t\t<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>\n\t\t</div>\n\t</nav><!-- #site-navigation -->\n\t<?php\n}", "function printHeaderItems() {\n\t\t\t?>\n\t\t\t<!--[if lte IE 7]>\n\t\t\t<script type=\"text/javascript\">\n\t\t\tsfHover=function(){var sfEls=document.getElementById(\"nav\").getElementsByTagName(\"LI\");for(var i=0;i<sfEls.length;i++){sfEls[i].onmouseover=function(){this.className+=\" sfhover\";}\n\t\t\tsfEls[i].onmouseout=function(){this.className=this.className.replace(new RegExp(\" sfhover\\\\b\"),\"\");}}}\n\t\t\tif (window.attachEvent)window.attachEvent(\"onload\",sfHover);\n\t\t\t</script>\n\t\t\t<![endif]-->\n\t\t\t<?php\n\t\t}", "protected function _getLeftNavHtml()\n {\n if ($this->_request->getFullActionName() == self::CATEGORY_VIEW_ACTION_NAME) {\n return $this->_layout->getBlock($this->_vars['catalog_left_navigation_block'])->toHtml();\n } elseif ($this->_request->getFullActionName() == self::CATALOG_SEARCH_ACTION_NAME) {\n return $this->_layout->getBlock($this->_vars['catalogsearch_left_navigation_block'])->toHtml();\n }\n\n return '';\n }", "function printLeftMenu($currentPage)\r\n {\r\n?>\r\n <div id=\"leftMenu\">\r\n <!--Corner Divs-->\r\n <div class=\"leftMenu-BotL\">\r\n <div class=\"leftMenu-BotR\">\r\n <div class=\"leftMenu-TopL\">\r\n <div class=\"leftMenu-TopR\">\r\n <!--Corner Divs-->\r\n \r\n <?php\t\t\r\n $menuItems = array();\r\n\r\n if (isset($_SESSION['username']))\r\n {\r\n $menuItems[\"intro\"] = \"<tr align='right'><td><strong>Hi \" . $_SESSION['username'] . \"!</td></tr>\";\r\n $menuItems[\"my_profile\"] = \"<tr align='right'><td><a class='normalMenuItem' href='my_profile.php'>My Profile</a></td></tr>\";\r\n $menuItems[\"my_software\"] = \"<tr align='right'><td><a class='normalMenuItem' href='my_software.php'>My Software</a></td></tr>\";\r\n $menuItems[\"my_projects\"] = \"<tr align='right'><td><a class='normalMenuItem' href='my_projects.php'>My Projects</a></td></tr>\";\r\n \r\n if ($_SESSION['userLevel'] >= 3)\r\n {\r\n $menuItems[\"admin\"] = \"<tr align='right'><td><strong>Admin functions:</td></tr>\";\r\n $menuItems[\"manage_users\"] = \"<tr align='right'><td><a class='normalMenuItem' href='manage_users.php'>Manage Users</a></td></tr>\";\r\n $menuItems[\"manage_content\"] = \"<tr align='right'><td><a class='normalMenuItem' href='manage_content.php'>Manage Content</a></td></tr>\";\r\n }\r\n \r\n $menuItems[\"logout\"] = \"<tr align='right'><td><a class='normalMenuItem' href='logout.php'>Logout</a></td></tr>\";\r\n \r\n\t\tif (empty($currentPage))\r\n {\r\n $menuItems[$currentPage] = str_replace(\"class='normalMenuItem'\", \"class = 'currentPageMenuItem'\", $menuItems[$currentPage]);\r\n\t\t}\r\n \r\n echo \"<table border='0' cellpadding='2' cellspacing='2' width='96%'>\";\r\n\t\tforeach ($menuItems as $key => $value)\r\n {\r\n echo $value;\r\n\t\t}\r\n echo \"</table>\";\r\n }\r\n else\r\n {\r\n ?> \r\n <form name=\"loginForm\" id=\"loginForm\" action=\"login.php\" method=\"post\" onsubmit=\"return check_login_form()\">\r\n <strong>Username</strong>\r\n <input type=\"text\" name=\"username\" id=\"username\" value=\"\" size=\"5\" />\r\n <p></p>\r\n <strong>Password</strong>\r\n <input type=\"password\" name=\"password\" id=\"password\" value=\"\" size=\"15\" />\r\n <input type=\"submit\" name=\"loginSubmit\" value=\"Login\" />\r\n </form>\r\n <?php\r\n }\r\n ?>\r\n <!--Corner Divs-->\r\n </div></div></div></div>\r\n <!--Corner Divs-->\r\n </div>\r\n<?php\r\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "public function createMainMenuLeft(Request $request)\r\n {\r\n $menu = $this->factory->createItem('root', array(\r\n \t'childrenAttributes' => array('class' => 'pull-left')\r\n ));\r\n \r\n $this->addMainMenuLeft($menu);\r\n \r\n $menu->setCurrent($request->getRequestUri());\r\n\r\n return $menu;\r\n }", "function sloodle_print_header()\r\n {\r\n global $CFG;\r\n $navigation = \"<a href=\\\"{$CFG->wwwroot}/mod/sloodle/view.php?_type=course&id={$this->course->id}\\\">\".get_string('courseconfig', 'sloodle').\"</a>\";\r\n\r\n\r\n sloodle_print_header_simple(get_string('courseconfig','sloodle'), \"&nbsp;\", $navigation, \"\", \"\", true, '', navmenu($this->course));\r\n }", "function bc16_links__topbar_main_menu($variables) {\n $links = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu')));\n $output = _zurb_foundation_links($links);\n $variables['attributes']['class'][] = 'right';\n\n // return '<ul' . drupal_attributes($variables['attributes']) . '><li><a href=\"/\"><i class=\"fa fa-home\"></i></a></li>' . $output . '<li class=\"has-form\"><a href=\"#\" class=\"button radius\">Заказать кейтеринг</a></li></ul>';\n return '<ul' . drupal_attributes($variables['attributes']) . '><li><a href=\"/\"><i class=\"fa fa-home\"></i></a></li>' . $output . '</ul>';\n}", "function ve_get_header_navigation() {\n?>\n<ul class=\"nav navbar-nav\">\n\t<li><a href=\"<?php echo home_url() ?>\">Front page <span class=\"sr-only\">(current)</span></a></li>\n\t<li class=\"dropdown\">\n\t\t<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Companies <span class=\"caret\"></span></a>\n\t\t<ul class=\"dropdown-menu purple\">\n\t\t\t<?php ve_get_company_navigation() ?>\n\t\t</ul>\n\t<li class=\"dropdown\">\n\t <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Partnership <span class=\"caret\"></span></a>\n\t <ul class=\"dropdown-menu turquoise\">\n\t\t<?php ve_get_group_of_companies_navigation() ?>\n\t </ul>\n\t</li>\n</ul>\n<?php\n}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function build_sidemenu_html()\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $images, $board_config;\n\t\n\t\t$template->set_filenames(array(\n\t\t\t'menu' => 'garage_menu.tpl')\n\t\t);\n\n\t\t$user_id = $userdata['user_id'];\n\t\tif (preg_match(\"/MAIN/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$main_menu = append_sid(\"garage.$phpEx?mode=main\");\n\t\t\t$menu .= '<a href=\"' . $main_menu . '\"><img src=\"' . $images['garage_main_menu'] . '\" alt=\"'.$lang['Main_Menu'].'\" title=\"'.$lang['Main_Menu'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\tif (preg_match(\"/BROWSE/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$browse_garage = append_sid(\"garage.$phpEx?mode=browse\");\n\t\t\t$menu .= '<a href=\"' . $browse_garage . '\"><img src=\"' . $images['garage_browse'] . '\" alt=\"'.$lang['Browse_Garage'].'\" title=\"'.$lang['Browse_Garage'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\tif (preg_match(\"/SEARCH/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$search_garage = append_sid(\"garage.$phpEx?mode=search\");\n\t\t\t$menu .= '<a href=\"' . $search_garage . '\"><img src=\"' . $images['garage_search'] . '\" alt=\"'.$lang['Search_Garage'].'\" title=\"'.$lang['Search_Garage'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\tif (preg_match(\"/INSURANCEREVIEW/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$insurance = append_sid(\"garage.$phpEx?mode=view_insurance_business\");\n\t\t\t$menu .= '<a href=\"' . $insurance . '\"><img src=\"' . $images['garage_insurance_review'] . '\" alt=\"'.$lang['Insurance_Summary'].'\" title=\"'.$lang['Insurance_Summary'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\tif (preg_match(\"/GARAGEREVIEW/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$garage = append_sid(\"garage.$phpEx?mode=view_garage_business\");\n\t\t\t$menu .= '<a href=\"' . $garage . '\"><img src=\"' . $images['garage_garage_review'] . '\" alt=\"'.$lang['Garage_Review'].'\" title=\"'.$lang['Garage_Review'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\tif (preg_match(\"/SHOPREVIEW/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$garage = append_sid(\"garage.$phpEx?mode=view_shop_business\");\n\t\t\t$menu .= '<a href=\"' . $garage . '\"><img src=\"' . $images['garage_shop_review'] . '\" alt=\"'.$lang['Shop_Review'].'\" title=\"'.$lang['Shop_Review'].'\" border=\"0\" /></a><br />';\n\t\t}\n\n\t\tif (preg_match(\"/QUARTERMILE/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$garage = append_sid(\"garage.$phpEx?mode=quartermile\");\n\t\t\t$menu .= '<a href=\"' . $garage . '\"><img src=\"' . $images['garage_quartermile_table'] . '\" alt=\"'.$lang['Quartermile_Table'].'\" title=\"'.$lang['Quartermile_Table'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\tif (preg_match(\"/ROLLINGROAD/\",$garage_config['menu_selection']))\n\t\t{\n\t\t\t$garage = append_sid(\"garage.$phpEx?mode=rollingroad\");\n\t\t\t$menu .= '<a href=\"' . $garage . '\"><img src=\"' . $images['garage_rollingroad_table'] . '\" alt=\"'.$lang['Rollingroad_Table'].'\" title=\"'.$lang['Rollingroad_Table'].'\" border=\"0\" /></a><br />';\n\t\t}\n\t\t$create_vehicle = append_sid(\"garage.$phpEx?mode=create_vehicle\");\n\t\t$create_vehicle_link = '<a href=\"' . $create_vehicle . '\"><img src=\"' . $images['garage_create_vehicle'] . '\" alt=\"'.$lang['Create_Vehicle'].'\" title=\"'.$lang['Create_Vehicle'].'\" border=\"0\" /></a>';\n\n\t\t$template->assign_vars(array(\n\t\t\t'L_MENU' => $lang['Menu'],\n\t\t\t'L_OWNER' => $lang['Owner'],\n\t\t \t'L_MY_VEHICLES' => $lang['My_Vehicles'],\n \t\t\t'L_LATEST_UPDATED' => $lang['Latest_Updated'],\n\t\t\t'L_WELCOME' => $lang['Welcome'],\n\t\t\t'L_WELCOME_TEXT' => $lang['Welcome_Text'],\n\t\t\t'L_TOTAL_VEHICLES' => $lang['Total_Vehicles'],\n\t\t\t'L_TOTAL_MODIFICATIONS' => $lang['Total_Modifications'],\n\t\t\t'L_TOTAL_COMMENTS' => $lang['Total_Comments'],\n\t\t\t'L_TOTAL_VIEWS' => $lang['Total_Views'],\n\t\t\t'MENU' => $menu,\n\t \t\t'L_CREATE_VEHICLE' => $create_vehicle_link)\n\t\t);\n\n\t\tif ( $userdata['session_logged_in'] )\n\t\t{\n\t\t\t$template->assign_block_vars('show_vehicles', array());\n\n\t\t\t$sql = \"SELECT g.id, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \t\t\t\tFROM \" . GARAGE_TABLE . \" AS g \n\t \t\t\tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id \n\t\t \t\tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id \n\t \t\tWHERE g.member_id = $user_id\n \t\t\tORDER BY g.id ASC\";\n\n\t\t\tif( !($result = $db->sql_query($sql)) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\twhile ( $user_vehicle = $db->sql_fetchrow($result) )\n\t\t\t{\n\t\t\t\t$cid = $user_vehicle['id'];\n\t\t \t\t$template->assign_block_vars('show_vehicles.user_vehicles', array(\n \t\t\t\t\t'U_VIEW_VEHICLE' => append_sid(\"garage.$phpEx?mode=view_own_vehicle&amp;CID=$cid\"),\n \t\t\t\t\t'VEHICLE' => $user_vehicle['vehicle'])\n \t\t\t\t);\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\t}\n\n\t\tif (!$this->check_permissions('BROWSE',''))\n\t\t{\n\t\t\t$template->pparse('menu');\n\t\t\treturn ;\n\t\t}\n\n\t\tif ( $garage_config['lastupdatedvehiclesmain_on'] == TRUE )\n\t\t{\n\t\t\t$template->assign_block_vars('lastupdatedvehiclesmain_on', array());\n\n\t\t\t$limit = $garage_config['lastupdatedvehiclesmain_limit'];\n\n\t\t\t$sql = \"SELECT g.id, g.made_year, g.member_id, g.date_updated, user.username, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \t\t\t\tFROM \" . GARAGE_TABLE . \" AS g \n\t \t\t\tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id \n\t \t\t\tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id \n\t\t\t\t\tLEFT JOIN \" . USERS_TABLE . \" AS user ON g.member_id = user.user_id \n\t\t\t\tWHERE makes.pending = 0 AND models.pending = 0 \n\t\t \tORDER BY g.date_updated DESC\n\t\t\t\tLIMIT 0, $limit\";\n\n\t\t\tif( !($result = $db->sql_query($sql)) )\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\twhile ( $vehicle_updated = $db->sql_fetchrow($result) )\n\t\t\t{\n \t\t\t\t$template->assign_block_vars('lastupdatedvehiclesmain_on.updated_vehicles', array(\n \t\t\t\t\t'U_VIEW_VEHICLE' => append_sid(\"garage.$phpEx?mode=view_vehicle&amp;CID=\".$vehicle_updated['id'].\"\"),\n \t\t\t\t\t'VEHICLE' => $vehicle_updated['vehicle'],\n \t\t\t\t\t'UPDATED_TIME' => create_date($board_config['default_dateformat'], $vehicle_updated['date_updated'], $board_config['board_timezone']),\n\t\t \t\t\t'USERNAME' => $vehicle_updated['username'],\n\t\t \t\t\t'U_VIEW_PROFILE' => append_sid(\"profile.$phpEx?mode=viewprofile&amp;\".POST_USERS_URL.\"=\".$vehicle_updated['member_id'].\"\"))\n \t\t\t\t);\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\t\t}\n\n\t\t$template->pparse('menu');\n\t\treturn ;\n\t}", "protected function build_nav()\r\n {\r\n //$this->view = false;\r\n $this->load->model('privilege_model','nav');\r\n\r\n $roles = $this->user->get_roles($this->user_id);\r\n $nav_links = $this->nav->get($roles); \r\n\r\n $this->load->config('nav_icons');\r\n $nav_icons = $this->config->item('icons');\r\n $result = '<ul id=\"nav\">'; \r\n \r\n //loop over returned top level navs\r\n foreach($nav_links as $nav_link):\r\n\r\n if($nav_link->name == \"school-logo\"):\r\n\r\n if(!$this->user_details->is_parent): //parent can belong to multiple schools\r\n\r\n $result .= '<li class=\"'.$nav_link->name.'\">'.\r\n anchor('schools/profile/1', img(base_url('assets/imgs/xlogo.jpg')))\r\n .'</li>'; \r\n\r\n endif;// only add school logo if not a regular user\r\n else:\r\n \r\n //Preferential nav load\r\n $result .= '<li class=\"'.$nav_link->name.'\">'.\r\n anchor($nav_link->controller.'/'.$nav_link->method, ' ', array('class' => $nav_icons[$nav_link->name]))\r\n .''.\r\n anchor($nav_link->controller.'/'.$nav_link->method, ucfirst($nav_link->name))\r\n .'</li>'; \r\n //End preferential nav load \r\n\r\n endif;\r\n endforeach;\r\n\r\n $result .= '</ul>';\r\n return $result;\r\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->isRoot() ) {\n $this->menu[]=$item;\n $this->appendChildren($item);\n }\n }\n reset ( $this->menu );\n }", "function buildMenu($Environment)\n\t{\n\t\t// Return empty if there are no menu items\n\t\tif(!isset($Environment[\"menuItem\"]))\n\t\t\treturn \"\";\n\t\t\n\t\t// Insert the Menu\n\t\t$pageMenu = new pageTemplate(CMS_DIR_THEME . \"/menu.thtml\");\n\t\t$pageMenuItems = \"\";\n\n\t\tforeach($Environment[\"menuItem\"] as $menuNext)\n\t\t{\n\t\t\tif(is_array($menuNext))\n\t\t\t{\n\t\t\t\tforeach($menuNext as $arrayMenuItem)\n\t\t\t\t{\n\t\t\t\t\t$pageMenuItems .= $this -> makeMenuItem($arrayMenuItem[\"Name\"],$arrayMenuItem[\"URL\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pageMenuItems .= $this -> makeMenuItem($menuNext -> menuName,$menuNext -> pageURL);\n\t\t\t}\n\t\t}\n\n\t\t$pageMenu -> add(\"MENU_ITEMS\", $pageMenuItems);\n\t\t\n\t\treturn $pageMenu -> parse();\n\t}", "function dokan_header_user_menu() {\n global $current_user;\n $user_id = $current_user->ID;\n $nav_urls = dokan_get_dashboard_nav();\n\n dokan_get_template_part( 'global/header-menu', '', array( 'current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls ) );\n}", "function make_menu($title) {;\t\n\t$menu = '<ul class=\"nav nav-pills\">';\n $menu .= get_menu_items($title);\n\t$menu .= '</ul>';\n\treturn $menu;\n}", "function getMenuItems()\n {\n $this->menuitem(\"xp\", \"\", \"main\", array(\"xp.story\", \"admin\"));\n $this->menuitem(\"stories\", dispatch_url(\"xp.story\", \"admin\"), \"xp\", array(\"xp.story\", \"admin\"));\n }", "function base_registerMenus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n}", "public function leftnav ()\n\t{\n\t}", "function _view_header()\n {\n $links = array();\n $links[\"additem\"] = session_url(dispatch_url(\"scheduler.scheduler\", \"add\"),SESSION_NESTED);\n $views = array(\"day\", \"week\", \"month\", \"birthday\" /*, \"year\", \"employee\"*/);\n foreach($views as $view)\n $links[$view.\"view\"] = session_url(dispatch_url(\"scheduler.scheduler\", \"admin\", array(\"view\"=>$view)));\n $links[\"refreshview\"] = session_url(dispatch_url(\"scheduler.scheduler\", \"admin\", array(\"view\"=>$this->m_view, \"viewdate\"=>$this->m_model->m_viewdate)));\n\n $viewheaderparams = array(\n \"links\" => $links,\n \"nav\" => $this->_getNav(),\n \"selector\" => $this->m_model->getSelector(),\n \"viewtitle\" => $this->m_viewTitle,\n );\n return $this->_view_header_html($viewheaderparams);\n }", "function ks_nav() {\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'header-menu',\n\t\t\t'menu' => '',\n\t\t\t'container' => 'div',\n\t\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t\t'container_id' => '',\n\t\t\t'menu_class' => 'menu',\n\t\t\t'menu_id' => '',\n\t\t\t'echo' => true,\n\t\t\t'fallback_cb' => 'wp_page_menu',\n\t\t\t'before' => '',\n\t\t\t'after' => '',\n\t\t\t'link_before' => '',\n\t\t\t'link_after' => '',\n\t\t\t'items_wrap' => '<ul>%3$s</ul>',\n\t\t\t'depth' => 0,\n\t\t\t'walker' => ''\n\t\t)\n\t);\n}", "private function build_header() {\n\t\t// if we've already got the cart ID, use it\n\t\t$header = self::fetch('cart_header', [':cart_id' => $this->id()]);\n\n\t\t$header['date_created'] = ck_datetime::datify(@$header['date_created']);\n\t\tif (!empty($header['date_updated'])) $header['date_updated'] = ck_datetime::datify($header['date_updated']);\n\n\t\t$this->skeleton->load('header', $header);\n\t}", "function displayHeader( $currentPage = \"\" )\n {\n echo \"\t\n\t <div id='header'>\\n\n <div id='logo'>\\n\n \t <img id='imgLogo' src='images/logo-1-h175.gif' alt='Aussie Computer Corporation' />\\n\n </div>\\n\n\t\t <div id='banner'>\\n\n <h1 id='h1Logo'>Aussie Computer Corporation</h1>\\n\n \" . $this->getTopMenu( $this->arrHeaderMenuItems ) . \"\n\t\t </div>\\n\n\t </div>\\n\n \\n\";\n\n\n // Displays the Main Navigation Bar\n //\n $thisPageHome = ( $currentPage == \"\" )? \"class='selected-menu'\" : \"\";\n $thisPageContactInfo = ( $currentPage == \"contactInfo\" )? \"class='selected-menu'\" : \"\";\n $thisPageSignIn = ( $currentPage == \"signIn\" )? \"class='selected-menu'\" : \"\";\n \n $strSignIn = ($this->bHeaderSignIn)? \"Sign-In\" : \"Sign-out\";\n $strWelcome = ($this->bHeaderSignIn)? \"\" : \"<div id='cntWelcomeMember'>Hello {$this->username}</div>\";\n $strHomeRef = ($this->bHeaderSignIn)? \"index.php\" : \"employee.php\";\n \n echo \"\n <div id='cntMainNavBar'>\\n\n <div id='cntMainNavMenu'>\\n\n <ul id='nav-menu'>\\n\n <li {$thisPageHome}'><a href='{$strHomeRef}'>Home</a></li>\\n\n <li {$thisPageContactInfo}><a href='contactInfo.php'>Contact Info</a></li>\\n\n <li {$thisPageSignIn}><a href='login.php'>{$strSignIn}</a></li>\\n\n </ul>\\n\n </div>\\n\n {$strWelcome} \\n\n </div>\\n\n \";\n\n }", "function makeMenu($menu){\n $output='';\n $list = '<ul>'. PHP_EOL;\n $listClose = '</ul>'. PHP_EOL;\n foreach ($menu as $key => $items) {\n $output.='<li class=\"menu\"> <a href ='.$key.'>'.$items.'</a></li>'. PHP_EOL;\n }\n $finalMenu = $list . $output . $listClose;\n return $finalMenu;\n}" ]
[ "0.67208296", "0.6597672", "0.6537863", "0.645373", "0.64430255", "0.64006287", "0.6387103", "0.63355494", "0.63258755", "0.631451", "0.6230021", "0.60892576", "0.60791856", "0.6050477", "0.6038574", "0.60151416", "0.6014593", "0.600861", "0.6007955", "0.59856766", "0.59436935", "0.5934674", "0.59284824", "0.59284824", "0.59284824", "0.59284824", "0.59284824", "0.59284824", "0.59102243", "0.59003925", "0.58978486", "0.5859798", "0.58498204", "0.5838538", "0.58375543", "0.58343905", "0.5826502", "0.5824029", "0.5793012", "0.5776917", "0.5768687", "0.5768687", "0.5764293", "0.5751224", "0.5750794", "0.57293546", "0.57233274", "0.57107407", "0.5670186", "0.5667514", "0.5661523", "0.5661181", "0.5658008", "0.5658008", "0.5653853", "0.56473917", "0.56344175", "0.5590078", "0.5574992", "0.5573709", "0.5565719", "0.55481976", "0.55242664", "0.55195326", "0.5515357", "0.55114585", "0.5508716", "0.55004346", "0.5498933", "0.5495703", "0.54911023", "0.54789495", "0.54788744", "0.54767245", "0.5459758", "0.54587096", "0.5455956", "0.5454453", "0.544998", "0.5433606", "0.5433606", "0.5432291", "0.5422429", "0.54145527", "0.540752", "0.54047793", "0.5404664", "0.54017663", "0.5397719", "0.5397376", "0.53960603", "0.53937525", "0.5392605", "0.53905725", "0.5388778", "0.5386751", "0.53850734", "0.5383183", "0.5379073", "0.5372976" ]
0.6210739
11
/ REQUEST_TIME_FLOAT is closer to truth.
public function __construct(Stopwatch $stopwatch = null) { if (isset($_SERVER["REQUEST_TIME_FLOAT"])) { $this->start = $_SERVER["REQUEST_TIME_FLOAT"]; } else { $this->start = microtime(true); } if (null === $stopwatch) { $stopwatch = new Stopwatch; } $this->stopwatch = $stopwatch; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getRequestTime(): float\n {\n return $_SERVER['REQUEST_TIME_FLOAT'] ?? 0.0;\n }", "private function time($float = false)\r\n {\r\n return $float ? Input::server('REQUEST_TIME_FLOAT') : Input::server('REQUEST_TIME');\r\n }", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }", "public function request_execution_time()\n\t{\n\t\tif ($this->_request_time === NULL OR $this->_response_time === NULL)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $this->_response_time - $this->_request_time;\n\t}", "public function time()\n {\n return $this->_requestTime;\n }", "protected static function _timeToCake()\n {\n return TIME_START - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "protected function getRequestStartTime()\n {\n if (defined('LARAVEL_START')) {\n return LARAVEL_START;\n }\n\n return $_SERVER[\"REQUEST_TIME_FLOAT\"] ?? microtime(true);\n }", "public static function getRequestTime(): ?string {\r\n return $_SERVER['REQUEST_TIME_FLOAT'] ?? null;\r\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "function duration($from = false)\n {\n if ($from) {\n return microtime(true) - $from;\n }\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function get_request_duration()\n {\n }", "private function calculateTime()\n {\n $slowest = 1000000;\n for($i=1; $i<=12; $i++){\n if($_GET['Tr'.$i] > 0 && $slowest > $this->troopCostsProperties['Tr'.$i][5] ){\n $slowest = $this->troopCostsProperties['Tr'.$i][5];\n }\n }\n $time = $this->distance/($slowest*SERVER_SPEED_RATE);\n return $time;\n }", "function now() {\n return microtime(true)*1000;\n}", "public static function get_request_start_time()\n { \n $timer = &self::$timer;\n $request_start = $timer->__get('request_start');\n return $request_start;\n }", "function process_time(){\n $time = number_format( microtime(true) - LIM_START_MICROTIME, 6);\n return($time);\n}", "public function requestTime($int=null)\n {\n if (!is_null($int)) {\n $this->_array[\"request_time\"] = (int) $int;\n }\n\n return $this->_array[\"request_time\"];\n }", "public function get_request_timeout(): float {\n $duration = get_config('realtimeplugin_phppoll', 'requesttimeout');\n return (isset($duration) && $duration !== false) ? (float)$duration : 30;\n }", "public function update_requests() {\n\t\tif (!isset($_POST['time']) || !isset($_POST['hash'])) exit('0');\n\n\t\t// If the response is invalid return a zero response\n\t\t$received = $_POST['time'] . '|' . $_POST['hash'];\n\t\t$expected = $this->time_marker(hash('crc32', $this->required_delay), $_POST['time']);\n\t\tif ($received !== $expected) exit('0');\n\n\t\t// If response if premature return a zero response\n\t\t$now = time();\n\t\t$earliest = absint($_POST['time']) + $this->required_delay;\n\t\tif ($now < $earliest) exit('0');\n\n\t\t// Seems ok ... respond with new hash\n\t\t$response = hash('md5', $_POST['hash'] . $this->base_key);\n\t\texit($response);\n\t}", "public function getRequestLength()\n\t{\n\t\treturn $this->elapsed;\n\t}", "private function user_local_request_time()\n\t{\n\t\t$formatted = sprintf(\n\t\t\t'%s-%s-%s %s:%s %s',\n\t\t\tdate('Y', $_SERVER['REQUEST_TIME']),\n\t\t\tdate('m', $_SERVER['REQUEST_TIME']),\n\t\t\tdate('d', $_SERVER['REQUEST_TIME']),\n\t\t\t$this->input->post('timecard_hour'),\n\t\t\t$this->input->post('timecard_min'),\n\t\t\t$this->input->post('timecard_pmam')\n\t\t);\n\n\t\treturn Carbon::createFromFormat('Y-m-d h:i A', $formatted);\n\t}", "function getHtmlTime(){\r\n\treturn('P&aacute;gina generada en <b>'.(time() - $_SERVER['REQUEST_TIME']) .'</b> segundos');\r\n}", "function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}", "function now(): float\n{\n return (float) \\hrtime(true) / 1_000_000_000;\n}", "public function getTimestamp()\n {\n return $this->server['REQUEST_TIME'];\n }", "function getQueryTime($time_start,$time_end) {\n\t\treturn round($time_end - $time_start,4).'sec';\n\t}", "public function getAnswerTime();", "function phpTrafficA_getmicrotime() {\nlist($usec, $sec) = explode(\" \", microtime());\nreturn ((float)$usec + (float)$sec);\n}", "function timestamp()\n {\n return microtime(true);\n }", "private function addTimer(array &$request) {\n $request['timer'] = microtime(true); //start time\n $request['time'] = false; //default if not overridden by time later\n }", "function GetuTime()\n{\n\tlist($uSec, $Sec)=explode(\" \", microtime()); \n\treturn((float)$uSec+(float)$Sec); \n}", "protected function getTime()\n {\n return microtime(true);\n }", "public function haveTime(){\n\t\tif($this->mCallbackHaveTime){\n\t\t\treturn call_user_func_array($this->mCallbackHaveTime, [$this]);\n\t\t}\n\t\treturn microtime(true) - $this->fStartTime < $this->fStepTime;\n\t}", "function timequery() {\n static $querytime_begin;\n list($usec, $sec) = explode(' ', microtime());\n\n if (!isset($querytime_begin)) {\n $querytime_begin = ((float) $usec + (float) $sec);\n } else {\n $querytime = (((float) $usec + (float) $sec)) - $querytime_begin;\n echo sprintf('<br />La consulta tardó %01.5f segundos.- <br />', $querytime);\n }\n}", "public function passedTicks() {\r\n\t\t$seconds = 300;\r\n\r\n\t\t$lastUpdate = (int)($this->lastUpdate() / $seconds);\r\n\t\t$now = (int)(TIME / $seconds);\r\n\r\n\t\treturn ($now - $lastUpdate);\r\n\t}", "public function getDelayTime() {}", "protected function getTime() {\n return microtime(true);\n }", "function _get_time()\n{\n $_mtime = microtime();\n $_mtime = explode(\" \", $_mtime);\n\n return (double) ($_mtime[1]) + (double) ($_mtime[0]);\n}", "function getTime() {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "public function verifyTimestamp()\n\t{\n\t\t$timestamp = $this->request->input('request.timestamp', null);\n\n\t\tif (is_null($timestamp) || $timestamp === '') {\n\t\t\tthrow new AlexaVerificationException('Request verification failed: no timestamp specified.');\n\t\t}\n\n\t\t$time_diff = Carbon::parse($timestamp)->diffInSeconds(Carbon::now(), false);\n\n\t\tif ($time_diff > $this->config['timestamp_delay_limit_seconds']) {\n\t\t\tthrow new AlexaVerificationException('Request verification failed: timestamp is beyond tolerance limit.');\n\t\t}\n\n\t\tif ($time_diff < 0) {\n\t\t\tthrow new AlexaVerificationException('Request verification failed: negative tolerance is not allowed.');\n\t\t}\n\n\t\treturn true;\n\t}", "function calculateTime($trueIndex, $dataIndex) {\n\t\t$dataTime = self::$data[$dataIndex]['Time'];\n\t\t$trueTime = $this -> timeToSeconds(self::$groundTruth[$trueIndex]['min'], self::$groundTruth[$trueIndex]['sec'], self::$groundTruth[$trueIndex]['msec']);\n\n\t\t//+-1 sec is accepted (=-1)\n\t\treturn 1 - 2 * abs($dataTime - $trueTime);\n\t}", "private function isRequestInTime(\\Datetime $passwordRequestedAt = null)\n {\n if ($passwordRequestedAt === null)\n {\n\n return false; \n\n }\n \n $now = new \\DateTime();\n $interval = $now->getTimestamp() - $passwordRequestedAt->getTimestamp();\n\n $daySeconds = 60 * 10;\n $response = $interval > $daySeconds ? false : $reponse = true;\n\n return $response;\n\n }", "public static function getExecutionTime() {\n\t\treturn (microtime(true) - $_SERVER[\"REQUEST_TIME\"]);\n\t}", "public function getExecutionTime()/*# : float */;", "public function microtime();", "function etime($time_start){\n $time_end = microtime(true);\n $execution_time = ($time_end - $time_start);\n\n return number_format((float) $execution_time, 1);\n}", "public function timeLowLow();", "function getTime($distance,$speed) {\r\n\tif (gettype($speed)==\"array\") {\r\n\t\t$min=0;\r\n\t\tforeach ($speed as $value) {\r\n\t\t\tif (($min==0)||($min>$value)) {\r\n\t\t\t\t$min=$value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($min==0) {\r\n\t\t\t\t\r\n\t\t\t$log=Zend_Registry::get(\"log\");\r\n\t\t\t$log->log(\"velocità 0!!!!\",Zend_Log::CRIT);\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse $speed=$min;\r\n\t}\r\n\treturn intval(($distance/$speed)*3600);\r\n}", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "function microtime_float()\n{\n list($usec, $sec) = explode(\" \", microtime());\n\t return ((float)$usec + (float)$sec);\n}", "private function tick() {\r\n\t\treturn ceil( time() / 43200 );\r\n\t}", "function tf_latency($message)\r\n {\r\n static $lastTime = 0;\r\n\r\n $currentTime = microtime(true);\r\n\r\n echo 'latency(';\r\n echo $lastTime == 0 ? '~' : $currentTime - $lastTime;\r\n echo ')(';\r\n echo htmlspecialchars($message, null, 'UTF-8');\r\n echo ')<br/>';\r\n\r\n $lastTime = $currentTime;\r\n }", "function gmt_time() {\r\n\t\t$now = time ();\r\n\t\t$tz = $this->gmt_timezone ();\r\n\t\t$seconds = 3600 * $tz;\r\n\t\treturn $now - $seconds;\r\n\t}", "function microtime_float(){\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);}", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public function getUseTime() \n \t{\n \t\treturn $this->use_time;\n \t}", "public function getTimePassed(): float\n {\n if ($this->started) {\n return microtime(true) - $this->start_time;\n } else {\n return $this->stop_time - $this->start_time;\n }\n }", "protected function startTime()\n {\n return microtime(true);\n }", "public static function normalizedTime() {\n\t\t$offset = 0;\n\t\ttry {\n\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_ntp', false);\n\t\t\tif ($offset === false) {\n\t\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_wf', false);\n\t\t\t\tif ($offset === false) { $offset = 0; }\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t//Ignore\n\t\t}\n\t\treturn time() + $offset;\n\t}", "public function getRelativeTime() : float\n {\n return ($this->timeStamp - static::$startTime);\n \n }", "public function getRequestDatetime()\n {\n return $this->auth->formattedRequestTime();\n }", "public function getTurnaroundTime()\n\t{\n\t\t$startTime = new DateTime($this->specimen->time_accepted);\n\t\t$endTime = new DateTime($this->time_verified);\n\t\t$interval = $startTime->diff($endTime);\n\n\t\t$turnaroundTime = ($interval->days * 24 * 3600) + ($interval->h * 3600) + ($interval->i * 60) + ($interval->s);\n\n\t\t\n\t\treturn $turnaroundTime;\n\t}", "public function timeLowHi();", "function timestamp(){\r\n\t\t$timestamp = round(microtime(1) * 1000);\r\n\r\n\t\treturn $timestamp;\r\n\t}", "public function getResponseDuration()\n\t{\n\t\treturn ($this->responseTime - $this->time) * 1000;\n\t}", "function microtime_float(){\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "public static function set_request_end_time()\n {\n $timer = &self::$timer;\n $session_start = $timer->__set('request_end');\n }", "function microtime(bool $get_as_float = false): string|float {}", "function humanTiming ($time){\n $time = (time()- 2*60*60)- $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n }", "function mstime ()\r\n{\r\n\t$t = explode (' ', microtime ());\r\n\treturn (int) (($t[0] + $t[1]) * 1000);\r\n}", "function microtime_float()\n{\n $micro = explode(' ', microtime());\n return (float)$micro[0] + (float)$micro[1];\n}", "function L_PageLoadTime() {\n\t\n\t/*\n\t\t$time = microtime();\n\t\t$time = explode(' ', $time);\n\t\t$time = $time[1] + $time[0];\n\t\t$finish = $time;\n\t\t$total_time = round(($finish - $start), 4);\n\t\t\n\t*/\n\t\n\t/*\n\t\t$end_time = microtime(TRUE);\n\t\t$time_taken = $end_time - $start_time;\n\t\t$time_taken = round($time_taken,5);\n\t\t\n\t*/\n\t\n\t\t// Start of code\n\t\t$time = microtime(true); // Gets microseconds\n\n\t\t// End of code\n\t\t$time_taken = (microtime(true) - $time);\n\t\t\n\t\treturn _e('Page generated in ' . $time_taken . ' seconds.','leonite');\n\n\t}", "function floattime()\n{\n\tlist($usec, $sec) = explode(\" \", microtime());\n\treturn ((float)$usec + (float)$sec);\n}", "function hackerHot($baseScore,$date_time,$gravity = 1.8){\n \n $upload_time=strtotime($date_time);\n $time_diff=(strtotime('now')-$upload_time);\n $hourPassed=round(($time_diff/(60 * 60)));\n if($hourPassed<0){\n $hourPassed=0;\n }\n \n return round((($baseScore-1)/pow($hourPassed+2,$gravity))*1000);\n }", "protected static function _timeFromCakeToStopwatch(): float\n {\n return self::$_startupTime - TIME_START;\n }", "public function getTimeout(): float\n {\n }", "static function timeMillisecondsAsFloat()\n\t{\n\t\treturn 1000.0 * (float) microtime(true);\n\t}", "private function getCurrentTime() {\n return microtime( true );\n }", "function microtime_float()\n{\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "function microtime_float()\n{\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "function microtime_float()\n{\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "private function getCurrentTime()\n {\n return microtime(true);\n }", "function microtime_float()\n {\n list( $usec, $sec ) = explode( \" \", microtime() );\n return ( ( float ) $usec + ( float ) $sec );\n }", "static public function IsRequestTimeoutReached() {\n return (time() - $_SERVER[\"REQUEST_TIME\"]) >= self::GetExpectedConnectionTimeout();\n }", "function still_on_time($extra_time = 15)\n{\n\tstatic $max_execution_time, $start_time;\n\n\t$time = explode(' ', microtime());\n\t$current_time = $time[0] + $time[1];\n\n\tif (empty($max_execution_time))\n\t{\n\t\t$max_execution_time = (function_exists('ini_get')) ? (int) @ini_get('max_execution_time') : (int) @get_cfg_var('max_execution_time');\n\n\t\t// If zero, then set to something higher to not let the user catch the ten seconds barrier.\n\t\tif ($max_execution_time === 0)\n\t\t{\n\t\t\t$max_execution_time = 50 + $extra_time;\n\t\t}\n\n\t\t$max_execution_time = min(max(10, ($max_execution_time - $extra_time)), 50);\n\n\t\t// For debugging purposes\n\t\t// $max_execution_time = 10;\n\n\t\tglobal $starttime;\n\t\t$start_time = (empty($starttime)) ? $current_time : $starttime;\n\t}\n\n\treturn (ceil($current_time - $start_time) < $max_execution_time) ? true : false;\n}", "public function servertime() {\n\t\tif(is_null($this->sync))\n\t\t\t$this->synchronize();\n\t\treturn (int) (microtime(true) * 1000) + $this->sync;\n\t}", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "private function _getMicroTime (){\n\t\treturn microtime(true);\n\t}", "function microtime_float () {\n\tlist ($msec, $sec) = explode(' ', microtime());\n\t$microtime = (float)$msec + (float)$sec;\n\treturn $microtime;\n}", "function good_microtime()\n{ \n list($usec, $sec) = explode(\" \",microtime()); \n return ((float)$usec + (float)$sec); \n}", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "protected function timeExceeded() {\n if ($this->timeLimit == 0) {\n return FALSE;\n }\n $time_elapsed = time() - REQUEST_TIME;\n $pct_time = $time_elapsed / $this->timeLimit;\n if ($pct_time > $this->timeThreshold) {\n $this->showMessage(\n t('Time limit approaching, starting new batch',\n array('!pct' => round($pct_time*100),\n '!usage' => format_size($time_elapsed),\n '!limit' => format_size($this->timeLimit))),\n 'warning');\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "function timeconditions_chk($post){\n\treturn true;\n}", "function getOffset(){\r\n $t=time()+microtime()-$this->api->start_time;\r\n $res=$t-$this->offset;\r\n $this->offset=$t;\r\n return $res;\r\n }", "public function hasLastrewardtime(){\n return $this->_has(7);\n }", "private function microtime_float() \n\t{\n\t\t\n \tlist($usec, $sec) = explode(\" \", microtime());\n \treturn ((float)$usec + (float)$sec);\n \t\n\t}", "function time_diference( $time_a, $time_b, $format = 'array' ) {\n\t$timediff = $time_a - $time_b;\n\n\tswitch ( strtolower( $format ) ) {\n\n\t\tcase 'mysql' :\n\t\t\treturn date( 'Y-m-d H:i:s', $timediff );\n\t\t\tbreak;\n\n\t\tcase 'timestamp' :\n\t\t\treturn abs( $timediff );\n\t\t\tbreak;\n\n\t\tcase 'array' :\n\t\t\treturn (object) array(\n\t\t\t'positive' => ( abs( $timediff ) == $timediff ? true : false ),\n\t\t\t'days' => abs( (int) ( $timediff / ( 24*60*60 ) ) ),\n\t\t\t'hours' => date( 'H', $timediff ),\n\t\t\t'minutes' => date( 'i', $timediff ),\n\t\t\t'seconds' => date( 's', $timediff ),\n\t\t\t);\n\t\t\tbreak;\n\n\t}\n\n\treturn false;\n\n}", "function getSystemTime()\n{\n $time = @gettimeofday();\n $resultTime = $time['sec'] * 1000;\n $resultTime += floor($time['usec'] / 1000);\n return $resultTime;\n}" ]
[ "0.71449155", "0.6716425", "0.65843207", "0.6517725", "0.6441095", "0.6042543", "0.5997321", "0.5997145", "0.59721005", "0.5918504", "0.5867861", "0.58167523", "0.5740153", "0.57177687", "0.5663903", "0.5621175", "0.5592499", "0.5550241", "0.55174875", "0.55125797", "0.55044466", "0.5417593", "0.54156893", "0.5365989", "0.5364044", "0.53631973", "0.53618485", "0.53510606", "0.5327473", "0.5312488", "0.5293014", "0.52868396", "0.5262201", "0.5259098", "0.52524835", "0.5248097", "0.5245041", "0.52393955", "0.5237969", "0.52372867", "0.52200407", "0.5208242", "0.52055895", "0.51901746", "0.51891863", "0.5188496", "0.51874727", "0.51873595", "0.51720005", "0.5153431", "0.51470435", "0.51469797", "0.5143795", "0.5141903", "0.5133681", "0.5127297", "0.51230973", "0.5115977", "0.51088554", "0.51025355", "0.5102456", "0.5101362", "0.50807273", "0.5078061", "0.5074617", "0.5071741", "0.50664544", "0.50629663", "0.5062794", "0.50517666", "0.505148", "0.5028371", "0.502467", "0.5021106", "0.5017597", "0.50173235", "0.5012379", "0.50095046", "0.500154", "0.500048", "0.49998724", "0.49978104", "0.49978104", "0.49978104", "0.49871424", "0.49857318", "0.49806592", "0.49782553", "0.49618936", "0.49575263", "0.49557507", "0.49555528", "0.49544758", "0.49362662", "0.4933744", "0.4931994", "0.49254432", "0.49203587", "0.49175158", "0.49172217", "0.49157104" ]
0.0
-1
/ Time spent from starting the request to entering this middleware.
public function process(ServerRequestInterface $request, DelegateInterface $delegate) { if ($this->bootstrap) { $bootstrap = (microtime(true) - $this->start) * 1000; $this->stopwatch->set($this->bootstrap, $bootstrap); } /* Call all the other middlewares. */ if ($this->process) { $this->stopwatch->start($this->process); $response = $delegate->process($request); $this->stopwatch->stop($this->process); } /* Time spent from starting the request to exiting last middleware. */ if ($this->total) { $total = (microtime(true) - $this->start) * 1000; $this->stopwatch->set($this->total, (integer) $total); } $this->stopwatch->stopAll(); return $response->withHeader( "Server-Timing", $this->generateHeader($this->stopwatch->values()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRequestStartTime()\n {\n if (defined('LARAVEL_START')) {\n return LARAVEL_START;\n }\n\n return $_SERVER[\"REQUEST_TIME_FLOAT\"] ?? microtime(true);\n }", "public static function get_request_start_time()\n { \n $timer = &self::$timer;\n $request_start = $timer->__get('request_start');\n return $request_start;\n }", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "function start(){\n\t\t$this->time_start = $this->microtime_float();\n\t}", "protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }", "public function start()\n {\n $this->_timeStartInMicroSeconds = microtime(true);\n }", "public function start()\n\t{\n\t\t$this->startTimer = microtime(TRUE);\n\t}", "private function startTimer()\n\t{\n\t\t// Keep statistics\n\t\tself::$totalCallCount++;\n\n\t\t// Rough execution time\n\t\t$this->startMicroStamp = microtime(true);\n\t}", "protected function startTime()\n {\n return microtime(true);\n }", "public function time()\n {\n return $this->_requestTime;\n }", "public function start()\n {\n $this->startTime = Carbon::now();\n }", "public function benchmarkStart()\n\t{\n\t\t$this->startTime = round(microtime(true) * 1000);\n\t}", "public static function set_request_end_time()\n {\n $timer = &self::$timer;\n $session_start = $timer->__set('request_end');\n }", "public function preExecution($request){\n //the session is started only once\n if(!isset($_SESSION['zleft_session'])){\n session_start();\n $_SESSION['zleft_session'] = 1;\n }\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function handle(Request $request, Closure $next)\n\t{\n\t\t$rsp = $next($request);\n\n\t\tLog::info('Execution Time', [\n\t\t\t'method' => $request->method(),\n\t\t\t'path' => $request->path(),\n\t\t\t'time' => round(microtime(true) - LARAVEL_START, 3),\n\t\t]);\n\n\t\treturn $rsp;\n\t}", "function timer_start(){\n\t\t$mtime = explode(' ', microtime());\n\t\t$this->time_start = $mtime[1] + $mtime[0];\n\t\treturn true;\n\t}", "public function request_execution_time()\n\t{\n\t\tif ($this->_request_time === NULL OR $this->_response_time === NULL)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $this->_response_time - $this->_request_time;\n\t}", "public static function set_process_start_time()\n {\n $timer = &self::$timer;\n $session_start = $timer->__set('process_start');\n }", "protected function initProcessing() {\n foreach ($this->requests as $k => $request) {\n if (isset($request->timeStart)) continue;\n $this->getDefaultOptions()->applyTo($request);\n $request->getOptions()->applyTo($request);\n $request->timeStart = microtime(true);\n }\n $this->active = true;\n }", "public function dispatchLoopStartup (Zend_Controller_Request_Abstract $request)\r\n {\r\n if (! $request->isGet()) {\r\n //self::$doNotCache = true;\r\n self::$doCache = false;\r\n return;\r\n }\r\n $path = $request->getPathInfo();\r\n $this->key = md5($path);\r\n // diferente\r\n if (false !== ($response = $this->getCache())) {\r\n $response->sendResponse();\r\n exit();\r\n }\r\n }", "public function get_request_duration()\n {\n }", "public function RequestLifeCycle(){\n }", "protected function startTimer()\r\n\t{\r\n\t\tlist($usec, $sec) = explode(\" \",$this->time);\r\n\t\t$this->startTime = ((float)$usec + (float)$sec);\r\n\t\treturn;\r\n\t}", "public static function getRequestTime(): float\n {\n return $_SERVER['REQUEST_TIME_FLOAT'] ?? 0.0;\n }", "public function start()\n {\n $this->fStarted = microtime(true);\n $this->iStartMemoryUsage = memory_get_usage();\n }", "public function handle($request, Closure $next)\n {\n $this->start_execution = microtime(true);\n return $next($request);\n }", "function pageLoadTime() {\n $time = microtime();\n $time = explode(' ', $time);\n $time = $time[1] + $time[0];\n $start = time; // start\n}", "public function TimerStart()\r\n\t{\r\n\t\t$parts = explode( \" \", microtime() );\r\n\t\t$this->time_diff = 0;\r\n\t\t$this->time_start = $parts[1].substr( $parts[0],1 );\r\n\t}", "function start() {\n if ($this->isLogging) {\n $this->tStart = gettimeofday();\n $this->tLast = $this->tStart;\n $this->log = \"<h1>Log: \" . $this->name . \"</h1>\\n<pre>Started: \" . gmdate(\"D, d M Y H:i:s T\", $this->tStart['sec']) . \"\\n &#916; Start ; &#916; Last ;\";\n\t\t\t$this->logLine(\"Start\");\n\t\t}\n }", "public function lazyStart()\n {\n // don't start more than once.\n if ($this->isStarted()) {\n // be sure the segment is loaded, though\n $this->load();\n return;\n }\n \n if ($this->_manager->isContinuing()) {\n // a previous session exists, start it\n $this->start();\n }\n }", "public static function timer_start() {\n $mtime = microtime();\n $mtime = explode(' ', $mtime);\n self::$time_start = $mtime[1] + $mtime[0];\n return true;\n }", "function __construct() {\n $this->start_time = microtime(true);\n }", "static public function begin(){ \n $_SESSION['session_time'] = time(); \n }", "public function beforeStart () {\n }", "public static function getExecutionTime() {\n\t\treturn (microtime(true) - $_SERVER[\"REQUEST_TIME\"]);\n\t}", "public function request_manager( )\n\t{\n\t\t$last_request = $this->php_session->get('last_request');\n\t\t//5 second interval\n\t\tif( $last_request+5 >= time() )\n\t\t{\n\t\t\t$req_count = $this->php_session->get('request_count');\n\t\t\t$req_count += 1;\n\t\t\t$this->php_session->set('request_count' , $req_count);\n\t\t\tif( $req_count >= 20 )\n\t\t\t\t$this->error('Too many HTTP requests from your session.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->php_session->set('request_count' , 0 );\n\t\t}\n\t\t$this->php_session->set('last_request' , time( ) );\n\t\t\t\n\t}", "public function beforeStart()\n {\n }", "public function startCache() {}", "static function start() {\n self::instance()->klein->dispatch(self::instance()->request);\n exit;\n }", "protected function start(){\n \tLynx_Request::parse();\n }", "public function get_starttime()\n {\n }", "public function startTime() {\n return intval($this['started']);\n }", "public function starttime() {\n return $this->info['starttransfer_time'];\n }", "public function __construct()\n {\n if (! App::environment('local')) {\n $this->middleware('throttle:5,1,v2-landing');\n }\n\n $this->middleware('cache.headers:public,max-age=600');\n\n $this->middleware('cacheResponse:600');\n }", "private function start()\n {\n // CSRF Watchdog\n $this->csrfWatchdog();\n\n // Retrieve and other services\n $this->retriever->watchdog();\n\n // Router Templater Hybrid\n $this->renderer->route();\n }", "protected static function _timeToCake()\n {\n return TIME_START - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "protected function before()\n {\n $object = new self($this->routeParams);\n (new Middleware())->middlewares($this->callBeforeMiddlewares())\n ->middleware($object, function ($object) {\n return $object;\n });\n }", "function start($event) {\n Timer::setStartTime($event, Timer::getMicroTime());\n }", "public function handle($request, Closure $next)\n {\n $this->startTime = microtime(true);\n\n return $next($request);\n }", "function start()\n\t{\n\t\tif( ! $this->is_running ){\n\t\t\t$this->is_running = TRUE;\n\t\t\t$this->running_since = self::timeMillisecondsAsFloat();\n\t\t}\n\t}", "public static function getScriptStartTime() {\n\t\t// TODO: Add here a better approach to get the time.\n\t\tif (isset($_SERVER['REQUEST_TIME'])) {\n\t\t\treturn $_SERVER['REQUEST_TIME'];\n\t\t}\n\t\telse {\n\t\t\treturn time();\n\t\t}\n\t}", "public function getRequestLength()\n\t{\n\t\treturn $this->elapsed;\n\t}", "private function addTimer(array &$request) {\n $request['timer'] = microtime(true); //start time\n $request['time'] = false; //default if not overridden by time later\n }", "public function start()\n {\n // For example you can check Auth\n }", "public function preDispatch() { }", "public function timer_start()\n {\n }", "public function startTime(): int\n {\n return $this->startTime;\n }", "public function preDispatch();", "public function isStarted() {}", "public function start() {\n $this->startedAt = microtime(true);\n return $this;\n }", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function execTime() {\n return microtime(true)-$this->conn_start;\n }", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "public function start() {\n\n // TODO: Maybe sometimes\n\n }", "public function preStartPageHook() {}", "public function preStartPageHook() {}", "public static function getStartTime(): float\n {\n return self::$startTimer;\n }", "public function preProcessRequest(RequestInterface &$request) {}", "public function handle($request, Closure $next)\n {\n $response = $next($request);\n $request->endTime = microtime();\n $starttime = explode(' ',$request->startTime);\n $endtime = explode(' ',$request->endTime);\n $rumTime = round( ( ($endtime[0]+$endtime[1])-($starttime[0]+$starttime[1]) ) ,5);\n\n $logData = [];\n $logData['startTime'] = $request->startTime;\n $logData['endTime'] = $request->endTime;\n $logData['rumTime'] = $rumTime;\n $logData['url'] = $request->fullUrl();\n Log::info(json_encode($logData));\n\n return $response;\n\n }", "private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }", "public function __construct()\n {\n $this->startTime = microtime(true);\n parent::__construct();\n }", "public static function start()\n {\n $start = round(microtime(true) * 1000);\n echo $start . \"\\n\";\n return $start;\n }", "function StartTimer() {\n\tglobal $timestart;\n\t$mtime = microtime();\n\t$mtime = explode(\" \",$mtime);\n\t$mtime = $mtime[1] + $mtime[0];\n\t$timestart = $mtime;\n\treturn true;\n}", "public function timeCaptureStart() { return $this->_m_timeCaptureStart; }", "public function __construct()\n {\n $this->_timeStart = (float)microtime(true); \n parent::__construct();\n }", "function start() {\n\t\tif ($this->Time->hasAny(\"Time.user_id = '\" . $this->userid . \"' AND Time.stop = '0000-00-00 00:00:00'\")) {\n\t\t\t$this->flash('Du arbeitest doch schon', '/times/index');\n\t\t\texit();\n\t\t}\n\n\t\t$this->request->data['Time']['user_id'] = $this->userid;\n\t\t$this->request->data['Time']['start'] = date('Y-m-d H:i:s');\n\t\t$this->request->data['Time']['break'] = 0;\n\n\t\tif ($this->Time->save($this->request->data)) {\n\t\t\t$this->Session->setFlash('Started, Wohoo!', 'message_ok');\n\t\t\t$this->redirect('/times/index');\n\t\t} else {\n\t\t\t$this->Session->setFlash('Please correct errors below.', 'message_error');\n\t\t\t$this->set('users', $this->Time->User->find('list'));\n\t\t\t$this->set('customers', $this->Time->Customer->find('list'));\n\t\t\t$this->redirect('/times/index');\n\t\t}\n\t}", "function session_begin()\n\t{\n\t\t// Get user information\n\t\t$this->time_now\t\t\t\t= time();\n\t\t$this->cookie_data\t\t\t= array('u' => 0, 'k' => '');\n\t\t$this->update_session_page\t= $update_session_page;\n\t\t$this->browser\t\t\t\t= $request->header('User-Agent');\n\t\t$this->referer\t\t\t\t= $request->header('Referer');\n\t\t$this->forwarded_for\t\t= $request->header('X-Forwarded-For');\n\n\t\treturn $this->session_create();\n\t}", "public function __construct()\n\t{\n\t\tsession_start();\n\t\t$this->timer = microtime();\n\t}", "public function profilerStart()\n {\n if (extension_loaded('xhprof')) {\n include_once($this->xhprofLibPath . 'utils/xhprof_lib.php');\n include_once($this->xhprofLibPath . 'utils/xhprof_runs.php');\n xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);\n }\n }", "function start_time($start_time=null)\n {\n if (isset($start_time)) $this->start_time = $start_time;\n return $this->start_time;\n }", "public function __construct()\n {\n $this->middleware('throttle:20,1');\n \n event(new ApiRequest());\n }", "public function requestDataSending()\n {\n $this->start();\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "protected function start(Request $request)\n {\n $this->session->initialize($this->settings, $request->getHeaderLine('HTTP_USER_AGENT'));\n $this->session->start();\n $this->refreshSessionCookie();\n }", "public static function timeFunctionStart($name)\n {\n $session = self::getSession();\n\n if (! isset($session->timings, $session->timings[$name])) {\n $session->timings[$name] = array(\n 'count' => 0,\n 'level' => 0,\n 'sum' => 0,\n 'times' => array(),\n );\n }\n $level = $session->timings[$name]['level'];\n\n if (! isset($session->timings[$name]['times'][$level])) {\n $session->timings[$name]['times'][$level] = array('start' => 0, 'count' => 0, 'sum' => 0);\n }\n $session->timings[$name]['times'][$level]['start'] = microtime(true);\n $session->timings[$name]['level']++;\n }", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "public function getStart()\n {\n return $this->start_time;\n }", "public function preDispatch(Request $request, Response $response)\n {\n }", "function start()\n{\n global $STATE_FILE, $LOG_FILE;\n\n $start_time = time();\n \n // log the timer in STATE_FILE\n $fp = fopen($STATE_FILE, 'w');\n fwrite($fp, $start_time);\n fclose($fp);\n}", "private function _preInit()\n {\n // Load the request before anything else, so everything else can safely check Craft::$app->has('request', true)\n // to avoid possible recursive fatal errors in the request initialization\n $this->getRequest();\n $this->getLog();\n\n // Set the timezone\n $this->_setTimeZone();\n\n // Set the language\n $this->updateTargetLanguage();\n }", "public static function traceBegin() \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::traceBegin();\t\t\n\t}" ]
[ "0.6897836", "0.6663214", "0.6337112", "0.6243125", "0.62205875", "0.611995", "0.60052186", "0.59864616", "0.5982788", "0.59321696", "0.59191537", "0.5894154", "0.5871963", "0.5762411", "0.5737711", "0.57005155", "0.5670237", "0.56515163", "0.56379044", "0.5620393", "0.55875874", "0.5577902", "0.55531615", "0.5545588", "0.55441564", "0.5543363", "0.5524479", "0.550224", "0.54864514", "0.54451466", "0.5420896", "0.54013723", "0.5391726", "0.5384883", "0.53720796", "0.5370985", "0.5369664", "0.5356189", "0.5350489", "0.5297483", "0.5294081", "0.5269561", "0.5258875", "0.5233486", "0.5225729", "0.5221459", "0.5217608", "0.5202509", "0.51962125", "0.51907873", "0.51903164", "0.518344", "0.51723313", "0.51694524", "0.5166176", "0.51614684", "0.51560116", "0.5143482", "0.5133681", "0.51265997", "0.51105934", "0.5103743", "0.50858605", "0.5082899", "0.50809103", "0.50800925", "0.5079238", "0.5079238", "0.5077696", "0.50758797", "0.5071415", "0.5071265", "0.50655305", "0.50597936", "0.505544", "0.50323766", "0.5028761", "0.50286084", "0.5022008", "0.5021814", "0.50105834", "0.5007803", "0.50057113", "0.50010884", "0.5000787", "0.5000787", "0.5000787", "0.5000787", "0.5000787", "0.5000787", "0.5000787", "0.5000787", "0.5000787", "0.49983317", "0.4995069", "0.4991097", "0.49900025", "0.49861577", "0.49805114", "0.49791586", "0.4979064" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Display a listing of the resource.
public function index() { $entidad = 'Persona'; $title = $this->tituloAdmin; $titulo_registrar = $this->tituloRegistrar; $ruta = $this->rutas; return view($this->folderview . '.admin')->with(compact('entidad', 'title', 'titulo_registrar', 'ruta')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create(Request $request) { $listar = Libreria::getParam($request->input('listar'), 'NO'); $entidad = 'Persona'; $persona = null; $formData = array('persona.store'); $cboRol = array(); $cboRp = array(); $rol = Rol::orderBy('nombre', 'asc')->get(); foreach ($rol as $k => $v) { $cboRol = $cboRol + array($v->id => $v->nombre); } $formData = array('route' => $formData, 'class' => 'form-horizontal', 'id' => 'formMantenimiento' . $entidad, 'autocomplete' => 'off'); $boton = 'Registrar'; return view($this->folderview . '.mant')->with(compact('persona', 'formData', 'entidad', 'boton', 'listar', 'cboRol', 'cboRp')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $listar = Libreria::getParam($request->input('listar'), 'NO'); $reglas = array( 'nombres' => 'required|max:50', 'roles' => 'required' ); $mensajes = array( 'nombre.required' => 'Debe ingresar un nombre', 'roles.required' => 'Debe seleccionar al menos un Rol' ); $validacion = Validator::make($request->all(), $reglas, $mensajes); if ($validacion->fails()) { return $validacion->messages()->toJson(); } $error = DB::transaction(function () use ($request) { $person = new Person(); $person->apellidopaterno = strtoupper($request->input('apellidopaterno')); $person->apellidomaterno = strtoupper($request->input('apellidomaterno')); $person->nombres = strtoupper($request->input('nombres')); $person->dni = strtoupper($request->input('dni')); $person->ruc = strtoupper($request->input('ruc')); $person->direccion = strtoupper($request->input('direccion')); $person->email = strtoupper($request->input('email')); $person->telefono = strtoupper($request->input('telefono')); $person->save(); $roles = explode(",", $request->input('roles')); for ($c = 0; $c < count($roles); $c++) { $rolpersona = new Rolpersona(); $rolpersona->person_id = $person->id; $rolpersona->rol_id = $roles[$c]; $rolpersona->save(); } }); return is_null($error) ? "OK" : $error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id, Request $request) { $existe = Libreria::verificarExistencia($id, 'person'); if ($existe !== true) { return $existe; } $listar = Libreria::getParam($request->input('listar'), 'NO'); $persona = Person::find($id); $cboRol = array(); $rol = Rol::orderBy('nombre', 'asc')->get(); foreach ($rol as $k => $v) { $cboRol = $cboRol + array($v->id => $v->nombre); } $rolpersona = Rolpersona::where('person_id', '=', $id)->get(); $cboRp = array(); foreach ($rolpersona as $key => $value) { $cboRp = $cboRp + array($value->rol_id => $value->rol_id); } $entidad = 'Persona'; $formData = array('persona.update', $id); $formData = array('route' => $formData, 'method' => 'PUT', 'class' => 'form-horizontal', 'id' => 'formMantenimiento' . $entidad, 'autocomplete' => 'off'); $boton = 'Modificar'; return view($this->folderview . '.mant')->with(compact('persona', 'formData', 'entidad', 'boton', 'listar', 'cboRol', 'cboRp')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $existe = Libreria::verificarExistencia($id, 'person'); if ($existe !== true) { return $existe; } $reglas = array( 'nombres' => 'required|max:50', 'roles' => 'required' ); $mensajes = array( 'nombre.required' => 'Debe ingresar un nombre', 'roles.required' => 'Debe seleccionar al menos un Rol' ); $validacion = Validator::make($request->all(), $reglas, $mensajes); if ($validacion->fails()) { return $validacion->messages()->toJson(); } $error = DB::transaction(function () use ($request, $id) { $person = Person::find($id); $person->apellidopaterno = strtoupper($request->input('apellidopaterno')); $person->apellidomaterno = strtoupper($request->input('apellidomaterno')); $person->nombres = strtoupper($request->input('nombres')); $person->dni = strtoupper($request->input('dni')); $person->ruc = strtoupper($request->input('ruc')); $person->direccion = strtoupper($request->input('direccion')); $person->email = strtoupper($request->input('email')); $person->telefono = strtoupper($request->input('telefono')); $person->save(); $dat = Rolpersona::where('person_id', '=', $person->id)->get(); foreach ($dat as $key => $value) { $value->delete(); } $roles = explode(",", $request->input('roles')); for ($c = 0; $c < count($roles); $c++) { $rolpersona = new Rolpersona(); $rolpersona->person_id = $person->id; $rolpersona->rol_id = $roles[$c]; $rolpersona->save(); } }); return is_null($error) ? "OK" : $error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $existe = Libreria::verificarExistencia($id, 'person'); if ($existe !== true) { return $existe; } $error = DB::transaction(function () use ($id) { $person = Person::find($id); $person->delete(); }); return is_null($error) ? "OK" : $error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
returns option with caching
public function get($name, $default=null) { if(isset($this->settings[$name])) { return $this->transformValueFromDatabase($this->settings[$name]['value'],$this->settings[$name]['type']); } /** @var Setting $setting */ if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) { $this->addToCache($setting); return $this->transformValueFromDatabase($setting->getValue(),$setting->getType()); } return $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheOptions();", "public function cacheOptions ()\n {\n\n foreach ( $this->optionsToPersist as $option ) {\n\n $this->optionsCache[ $option ] = $this->getOption ( $option );\n\n }\n\n }", "public function cache($options = true);", "private function get_caches () {\n $caches_slug = 'cache';\n return $this->get_option($caches_slug, array());\n }", "private function get_option() {\n\t\t$default = [\n\t\t\tself::STATUS => self::NOT_FETCHED,\n\t\t\tself::LAST_FETCH => 0,\n\t\t];\n\n\t\treturn get_option( self::OPTION_NAME, $default );\n\t}", "function cactus_get_raw_option( $opt_name ) {\r\n\t$alloptions = wp_cache_get( 'alloptions', 'options' );\r\n\t$alloptions = maybe_unserialize( $alloptions );\r\n\treturn isset( $alloptions[ $opt_name ] ) ? maybe_unserialize( $alloptions[ $opt_name ] ) : false;\r\n}", "public function getOpt($option) {}", "public function cached()\n {\n // check cache is available else set cache and return\n return Cache::get('Klaravel\\Settings\\Setting', function () {\n $data = $this->get();\n Cache::put('Klaravel\\Settings\\Setting', $data, 60 * 24);\n\n return $data;\n });\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "function bf_get_option($name) {\r\n\tglobal $bf_options;\r\n\t\r\n\tif (!is_object($bf_options) )\r\n\t\tbf_flush_options();\r\n\t\r\n\treturn $bf_options->$name;\r\n}", "public function get(string $option);", "public function get(string $option);", "private function _shouldBeCached()\n {\n $item = $this->repo->get(SettingKeys::CACHE_SETTINGS);\n //The setting failed to fetch, don't cache value to be on the safe side.\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:39] Failed to fetch setting.',\n ['key' => SettingKeys::CACHE_SETTINGS]\n );\n return false;\n }\n return $item->value;\n }", "public function get( $option );", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n try {\n $stm = $this->db($keyword)->prepare(\"SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1\");\n $stm->execute(array(\n \":keyword\" => $keyword\n ));\n $row = $stm->fetch(PDO::FETCH_ASSOC);\n\n } catch(PDOException $e) {\n\n $stm = $this->db($keyword,true)->prepare(\"SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1\");\n $stm->execute(array(\n \":keyword\" => $keyword\n ));\n $row = $stm->fetch(PDO::FETCH_ASSOC);\n }\n if($this->isExpired($row)) {\n $this->deleteRow($row);\n return null;\n }\n\n if(isset($row['id'])) {\n $data = $this->decode($row['object']);\n return $data;\n }\n return null;\n }", "function apc_cache_shunt_all_options($false) {\n\tglobal $ydb; \n\t\n\t$key = APC_CACHE_ALL_OPTIONS; \n\tif(apc_exists($key)) {\n\t\t$ydb->option = apc_fetch($key);\n\t\t$ydb->installed = apc_fetch(APC_CACHE_YOURLS_INSTALLED);\n\t\treturn true;\n\t} \n\t\n\treturn false;\n}", "function get_option($option_key) {\n if (!isset($result)) {\n $result = get_option($option_key);\n }\n\n return $result;\n }", "protected function get()\n {\n return get_option($this->hash);\n }", "function getOption( $option )\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getOption( $option );\n }", "protected function load_cache(){\r\n\t\tstatic $cached = null;\r\n\t\t\r\n\t\tif(!$cached){\r\n\t\t\t\r\n\t\t\tif($this->_cfg->get('sfversion') == 'auto'){\r\n\t\t\t\t// get version from sourceforge/cache\r\n\t\t\t\tif (!$this->is_cached()) $this->update_cache();\r\n\t\t\t\t$cached = (object)include($this->get_cache());\r\n\t\t\t}else{\r\n\t\t\t\t// use predefined version from config\r\n\t\t\t\t$cached = (object)$this->_cfg->get('sfversion');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $cached;\r\n\t}", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n\n $x = wincache_ucache_get($keyword,$suc);\n\n if($suc == false) {\n return null;\n } else {\n return $x;\n }\n }", "public function getSomeOption() {}", "public function setCacheOptions($options);", "function qa_opt($name, $value = null)\n{\n\tglobal $qa_options_cache;\n\n\tif (!isset($value) && isset($qa_options_cache[$name]))\n\t\treturn $qa_options_cache[$name]; // quick shortcut to reduce calls to qa_get_options()\n\n\trequire_once QA_INCLUDE_DIR . 'app/options.php';\n\n\tif (isset($value))\n\t\tqa_set_option($name, $value);\n\n\t$options = qa_get_options(array($name));\n\n\treturn $options[$name];\n}", "function getOption($name);", "function __get($name){\r\n try{\r\n return parent::__get($name);\r\n }catch(exception $e){\r\n if(isset($this->_options[$name]))\r\n return $this->_options[$name];\r\n throw $e;\r\n }\r\n }", "protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}", "public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }", "function _options_option($option) {\n global $db ;\n $data = null ;\n $req = $db->prepare(\"SELECT `data` FROM `_options` WHERE `option` = :option \") ;\n $req->execute(array(\n \"option\" => $option\n )) ;\n $data = $req->fetch() ;\n return (isset($data['data'])) ? $data['data'] : false ;\n}", "public function cache()\n {\n add_settings_field(\n 'cache',\n apply_filters($this->plugin_name . 'label-cache', esc_html__('Cache', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable cacheing of your security.txt file.',\n 'id' => 'cache',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['cache']) ? $this->options['cache'] : false,\n ]\n );\n }", "protected function cache()\n\t{\n\t\tif ( ! $this->executed OR $this->result === NULL)\n\t\t\treturn;\n\n\t\tif ($this->config['cache'] === FALSE OR ! ($this->cache instanceof Cache))\n\t\t\tthrow new Kohana_User_Exception('Curl.cache()', 'Cache not enabled for this instance. Please check your settings.');\n\n\t\t// Store the correct data\n\t\t$cache_data = array\n\t\t(\n\t\t\t'result' => $this->result,\n\t\t\t'info' => $this->info,\n\t\t);\n\n\t\treturn $this->cache->set($this->create_cache_key(), $cache_data, $this->config['cache_tags'], $this->config['cache']);\n\t}", "public function get($cache_name);", "public function getFromCache() {}", "function get_page_builder_options($post_id,$cache=true){\r\r // check if cache\r $cache_key ='_st_page_builder_'.$post_id;\r if($cache){\r if($values = wp_cache_get( $cache_key ) ) {\r return $values;\r }\r }\r\r $values = get_post_meta($post_id,'_st_page_builder',true);\r if(!is_array($values) && !is_object($values)){\r $values = maybe_unserialize(base64_decode($values));\r }\r\r $values= st_stripslashes($values);\r $values = apply_filters('st_page_builder_options',$values);\r if($cache){ // cache to WP\r wp_cache_add( $cache_key, $values );\r }\r return $values;\r}", "private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }", "function &getOption($name) {\n\t\treturn $this->{'_'.$name};\n\t}", "function tia_get_option($key) {\t\n\tglobal $tia_options;\t\n\t$tia_options = get_option('tia_options');\n\t\n\t$tia_defaults = array(\t\t\t\t\t\n\t\t'tia_theme_bkg' => 'white',\n\t\t'tia_default_height' => 700,\n\t\t'tia_scrolling_img_margin_top' => 117,\n\t\t'tia_story_margin_top' => 70\n\t\t\n\t);\n\t\n\t//Array of options not stored in tia_options array\n\t$not_in_array = array(\t\t\n\t\t'tia_logo' => false\t\t\n\t);\n\t\n\tif($not_in_array[$key]){\n\t\tif(!get_option($key)){\n\t\t\t$tia_options[$key] = $tia_defaults[$key];\n\t\t}\n\t\telse{\n\t\t\t$tia_options[$key] = get_option($key);\n\t\t}\n\t}else{\t\t\t\n\t\tif (!$tia_options[$key]){\t\t\n\t\t\t$tia_options[$key] = $tia_defaults[$key];\t\t\t\n\t\t}\n\t}\t\n\treturn $tia_options[$key];\n}", "public function cacheGet() {\n }", "public function getOption($name);", "public function getOption($name);", "public function getOption($name);", "function __get($name){\n try{\n return parent::__get($name);\n }catch(exception $e){\n if(isset($this->_options[$name]))\n return $this->_options[$name];\n throw $e;\n }\n }", "public function __get( $name )\n\t{\n\t\t//\tThen behaviors\n\t\tforeach ( $this->_behaviorCache as $_behaviorName )\n\t\t{\n\t\t\tif ( ( $_behavior = $this->asa( $_behaviorName ) ) instanceof IPSOptionContainer && $_behavior->contains( $name ) )\n\t\t\t\treturn $_behavior->getValue( $name );\n\t\t}\n\n\t\t//\tTry daddy...\n\t\treturn parent::__get( $name );\n\t}", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n $data = xcache_get($keyword);\n if($data === false || $data == \"\") {\n return null;\n }\n return $data;\n }", "function tfuse_page_options($option_name = null, $default = null, $post_id = null) {\r\n global $post, $tfuse_options;\r\n $max_cache_size = 100;\r\n \r\n if (!isset($post_id) && isset($post))\r\n $post_id = $post->ID;\r\n if (!isset($post_id))\r\n return;\r\n \r\n if (!isset($tfuse_options['post'][$post_id])) {\r\n if (!empty($tfuse_options['post']) && count($tfuse_options['post']) > $max_cache_size) // if cache limit exceeded, remove first element from cache\r\n array_shift($tfuse_options['post']);\r\n \r\n $tfuse_options['post'][$post_id] = decode_tfuse_options(get_post_meta($post_id, TF_THEME_PREFIX .'_tfuse_post_options', true), true);\r\n }\r\n \r\n if ($option_name === null) {\r\n return $tfuse_options['post'][$post_id];\r\n } else {\r\n // optiunile sunt slavate cu PREFIX in fata, dar extragem scrim fara PREFIX\r\n // pentru a obtine PREFIX_logo vom folosi tfuse_page_options('logo')\r\n $option_name = TF_THEME_PREFIX . '_' . $option_name;\r\n \r\n if (isset($tfuse_options['post'][$post_id][$option_name]))\r\n $value = $tfuse_options['post'][$post_id][$option_name];\r\n }\r\n \r\n if (isset($value) && $value !== '')\r\n return $value;\r\n else\r\n return $default;\r\n }", "public function getCache();", "function _cache_get ($cache_name = \"\") {\n\t\tif (empty($cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\treturn $this->_get_cache_file($cache_file_path);\n\t}", "public static function getCacheControl() {}", "public static function getCache() {}", "function __get_option($setting)\n {\n }", "function set_cache($cache_file = '')\n {\n $data = array();\n switch ($cache_file) {\n case 'configurations':\n $data = modules::run('configurations/get_configuration', array('array' => TRUE)); \n break;\n case 'configurations_vi':\n $data = modules::run('configurations/get_configuration', array('array' => TRUE, 'lang' => 'vi')); \n break;\n case 'configurations_en':\n $data = modules::run('configurations/get_configuration', array('array' => TRUE, 'lang' => 'en')); \n break;\n case 'pages':\n $data = modules::run('pages/get_page_data', array('array' => TRUE)); \n break;\n case 'menus':\n $data = modules::run('menus/get_menu_data', array('array' => TRUE)); \n break;\n default:\n break;\n }\n return $data;\n }", "public function getOption(string $name);", "public function getOption(string $name);", "public function setCaching($cache);", "public function useCache()\n {\n return false;\n }", "private static function getCacheTimeOut($options) {\n if (is_numeric(self::$cache_timeout) && self::$cache_timeout > 0) {\n $ret_value = self::$cache_timeout;\n }\n else {\n $ret_value = FALSE;\n }\n if (isset($options['cachetimeout'])) {\n if (is_numeric($options['cachetimeout']) && $options['cachetimeout'] > 0) {\n $ret_value = $options['cachetimeout'];\n }\n else {\n $ret_value = FALSE;\n }\n }\n return $ret_value;\n }", "public static function cache(){\n\n if (!isset(self::$_cache)) {\n if(!GO::isInstalled()){\n self::$_cache=new \\GO\\Base\\Cache\\None();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(!isset(GO::session()->values['cacheDriver'])){\n\t\t\t\t\t\t\t\t$cachePref = array(\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Apcu\",\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Disk\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tforeach($cachePref as $cacheDriver){\n\t\t\t\t\t\t\t\t\t$cache = new $cacheDriver;\n\t\t\t\t\t\t\t\t\tif($cache->supported()){\n\n\t\t\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\t\t\tGO::session()->values['cacheDriver'] = $cacheDriver;\n\t\t\t\t\t\t\t\t\t\tself::$_cache=$cache;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cacheDriver = GO::session()->values['cacheDriver'];\n\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\tself::$_cache = new $cacheDriver;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n }\n return self::$_cache;\n }", "public function isCacheEnabled(){\n return(true);\n }", "public function isCacheEnabled(){\n return(true);\n }", "function scs_get_option()\n\t{\n\t\t$option = get_option( basename(dirname(__FILE__)) );\n\t\tif ( !$option ) {\n\t\t\t$option = array( 'state' => 'normal', 'logged_in_permission' => true );\n\t\t\tadd_option(basename(dirname(__FILE__)), $option);\n\t\t}\n\n\t\treturn $option;\n\t}", "protected function createCache($options)\n {\n return null;\n }", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n\n $data = apc_fetch($keyword,$bo);\n if($bo === false) {\n return null;\n }\n return $data;\n\n }", "function MCW_get_default_options() {\n $cache_filters = array(array('all', 'true'), \n array('home', 'is_home()'),\n array('single', 'is_single()'),\n array('page', 'is_page()'),\n array('category', 'is_category()'), \n array('tag', 'is_tag()'),\n array('archive', 'is_archive()'),\n array('search', 'is_search()'));\n\n $cache_options = array('filters' => $cache_filters, \n 'use_add_html' => 'no', \n 'allow_js' => 'yes',\n 'copy_widget' => 'no',\n 'std_kind' => 'html', \n 'code_height' => 200,\n 'filter_width' => 75,\n 'wpfilter' => '',\n 'outfilter' => 'the_content',\n 'use_custag' => 'yes',\n 'use_wpfilter' => 'no',\n 'css_wrapper' => 'no'); \n\t\treturn $cache_options; \n \t}", "protected static abstract function getOptions();", "function &getOption($k = null, $default = null)\n {\n return option('get', $k, $default);\n }", "public function getOption($key);", "public function get() {\n\n\t\tif (is_multisite()) {\n\t\t\t$config = get_site_option('wpo_cache_config', $this->get_defaults());\n\t\t} else {\n\t\t\t$config = get_option('wpo_cache_config', $this->get_defaults());\n\t\t}\n\n\t\treturn wp_parse_args($config, $this->get_defaults());\n\t}", "protected function getOptions() {}", "protected function getOptions() {}", "function get_settings($option)\n {\n }", "protected function getOptions() {}", "public function isCached() {}", "public static function getBestMatch( $type ) {\n\t\tstatic $order = array( 'db', 'apc', 'shm', 'file' );\n\t\t\n\t\t$type = strtolower($type);\n\t\t\n\t\tif (!in_array($type, $order)) { // try to be as graceful as possible\n\t\t\t$type = 'file';\n\t\t}\n\t\t\n\t\t$options = $order;\n\t\t$cache = NULL;\n\t\t\n\t\tarray_unshift( $options, $type );\n\t\t$options = array_unique($options);\n\t\t\n\t\twhile ($cache === NULL && ($currentOption = array_shift($options))) {\n\t\t\tswitch ($currentOption) {\n\t\t\t\tcase 'db':\n\t\t\t\t\trequire_once STROOT . '/cache/class.DBCache.php';\n\t\t\t\t\tif (DBCache::available()) $cache = new DBCache( self::$storage );\n\t\t\t\tbreak;\n\t\t\t\tcase 'apc':\n\t\t\t\t\trequire_once STROOT . '/cache/class.ApcCache.php';\n\t\t\t\t\tif (APCCache::available()) $cache = new ApcCache();\n\t\t\t\tbreak;\n\t\t\t\tcase 'shm':\n\t\t\t\t\trequire_once STROOT . '/cache/class.ShmopCache.php';\n\t\t\t\t\tif (ShmopCache::available()) $cache = new ShmopCache();\n\t\t\t\tbreak;\n\t\t\t\tcase 'file':\n\t\t\t\tdefault:\n\t\t\t\t\trequire_once STROOT . '/cache/class.FileCache.php';\n\t\t\t\t\tif (FileCache::available()) $cache = new FileCache();\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$cache) {\n\t\t\tthrow new RuntimeException('No cache available');\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $cache;\n\t}", "function getOptions() ;", "public static function cacheEnabled($mnt,$command,$params,$path)\n{\nif (!is_null(self::$caching)) return self::$caching;\n\nif (is_null($mnt)) return false;\n\nreturn self::instance($mnt)->cacheEnabled($command,$params,$path);\n}", "public function get() {\n\t\treturn $this->options->get( self::OPTION );\n\t}", "function &option($act, $k = null, $v = null)\n {\n static $options = [];\n switch ($act) {\n case 'get': // phpcs:ignore\n $return = &get($options, $k, $v);\n break;\n case 'set': // phpcs:ignore\n $return = set($options, $k, $v);\n break;\n }\n\n return $return;\n }", "function wp_cache_supports($feature)\n {\n }", "public function configurationIsCached();", "protected function get_options()\n\t{}", "function _biurnal_conf_get_conf_cache($name) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_get('biurnal_conf', $name);\n if (!$cache) {\n $cache = biurnal_conf_load($name);\n if ($cache) {\n $cache->locked = ctools_object_cache_test('biurnal_conf', $name);\n }\n }\n\n return $cache;\n}", "function get_option($option_name, $default_value = false)\n{\n if (!is_string($option_name)) {\n // Option name must be string\n return $default_value;\n }\n\n $opt = \\Controller::model(\"Option\", $option_name);\n if (!$opt->isAvailable()) {\n return $default_value;\n }\n\n // Return the value\n return $opt->get(\"option_value\");\n}", "protected function getOptions()\n {\n return array(\n 'default_ttl' => 15 * 60,\n 'private_headers' => array('Authorization', 'Cookie'),\n 'allow_reload' => true,\n 'allow_revalidate' => true,\n 'stale_while_revalidate' => 2,\n 'stale_if_error' => 3600,\n );\n }", "function cache();", "function get_options() {\t\t\r\n\t\t$saved_options = unserialize(get_option(THEME_ID . '_options'));\r\n\t\tif (!empty($saved_options) && is_object($saved_options)) {\r\n\t\t\tforeach($saved_options as $name => $value) {\r\n\t\t\t\t$this->$name = $value;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "function get_option($name) {\n $setting = Setting::where('name', $name)->first();\n if(!$setting) {\n return \"\";\n }\n return $setting->value;\n}", "abstract public function get($key): Option;", "public function isCached(): bool;", "protected function _initCache() {\n\t\t$options = $this->getOptions();\n\t\tswitch($options['cache']) {\n\t\t\tcase 'apc':\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\ApcCache();\n\t\t\tbreak;\n\n\t\t\tcase 'memcache':\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\MemcacheCache();\n\t\t\tbreak;\n\n\t\t\tcase 'xcache':\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\XcacheCache();\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$cache = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\t\t}\n\n// \t\t$this->_config->setMetadataCacheImpl($cache);\n// \t\t$this->_config->setQueryCacheImpl($cache);\n\t}", "public function getCache()\n\t{\n\t\tif( ! $this->cache_on)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(isset($this->cache_obj))\n\t\t{\n\t\t\treturn $this->cache_obj;\n\t\t}\n\t\t\n\t\t$class = 'Db_Cache_'.$this->cachedrv;\n\t\t\n\t\t$this->cache_obj = new $class($this->cacheopt);\n\t\t\n\t\treturn $this->cache_obj;\n\t}", "public function isUseCache()\n {\n return $this->use_cache;\n }", "abstract function options();", "abstract public function getOptions();", "public function option()\n {\n return $this->optionRequested;\n }", "function _config_cache(){\n Mapper::config(array('use_cache'=>false));\n \n}", "protected function readUserOptions() {\n\t\t// add cache resource\n\t\t$cacheName = 'user-option-'.PACKAGE_ID;\n\t\tWCF::getCache()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', WCF_DIR.'lib/system/cache/CacheBuilderOption.class.php');\n\t\t\n\t\t// get options\n\t\t$this->options = WCF::getCache()->get($cacheName, 'options');\n\t}", "public function getOption()\n {\n return $this->option;\n }", "public function getOption()\n {\n return $this->option;\n }", "final public function cache($time = false) {\n\t\t\t$this->cache_ttl = $time;\n\t\t\treturn $this;\n\t\t}", "function curl_option(&$curl, $option, $value) {\n return curl_options($curl, [$option => $value]);\n}", "function dialogue_get_cached_param($name, $value, $default) {\n global $PAGE;\n\n if (!isset($PAGE->cm->id)) {\n return $default;\n }\n\n $cache = cache::make('mod_dialogue', 'params');\n $cacheparam = $name . '-' . $PAGE->cm->id;\n\n if (is_null($value)) {\n $cachevalue = $cache->get($cacheparam);\n if ($cachevalue) {\n return $cachevalue;\n }\n }\n\n if ($value) {\n $cache->set($cacheparam, $value);\n return $value;\n }\n\n return $default;\n}" ]
[ "0.7172962", "0.66894454", "0.6680585", "0.62562275", "0.6252144", "0.6191551", "0.617751", "0.6122074", "0.6104626", "0.60862905", "0.6044989", "0.6044989", "0.60433203", "0.60128415", "0.5970329", "0.5957316", "0.59453094", "0.5943432", "0.59354836", "0.5924358", "0.5920584", "0.58949614", "0.58864903", "0.5849902", "0.5845724", "0.58388746", "0.5833294", "0.58281606", "0.5807288", "0.58020365", "0.5793395", "0.5779859", "0.57778555", "0.577724", "0.5775819", "0.57509434", "0.57472765", "0.5745969", "0.57425576", "0.57425576", "0.57425576", "0.57403386", "0.57226324", "0.5722101", "0.57106084", "0.5702892", "0.5701606", "0.5698238", "0.5692044", "0.5689139", "0.5674349", "0.566508", "0.566508", "0.56603396", "0.56509954", "0.5646382", "0.56424487", "0.5640333", "0.5640333", "0.5637146", "0.5633629", "0.5617787", "0.5616038", "0.55987173", "0.5595075", "0.5591588", "0.5590967", "0.5590277", "0.5590277", "0.55895644", "0.55888134", "0.55866003", "0.5585078", "0.55837035", "0.556154", "0.55544835", "0.5553298", "0.5552511", "0.5547869", "0.55407953", "0.55407125", "0.5532777", "0.55315703", "0.5529833", "0.5521248", "0.55154645", "0.55075604", "0.5492716", "0.5486692", "0.54848695", "0.54841155", "0.54807776", "0.5480691", "0.54803514", "0.5474346", "0.5470164", "0.546551", "0.546551", "0.546427", "0.5462365", "0.54621786" ]
0.0
-1
checks if option is existing
public function has($name) { if(isset($this->settings[$name])) { return true; } /** @var Setting $setting */ if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) { $this->addToCache($setting); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasOption($name);", "public function hasOption(string $name);", "public function has_option() {\n return false;\n }", "function option_exists($key)\n {\n return app('option')->exists($key);\n }", "function option_exists(string $key)\n {\n return Options::exists($key);\n }", "public function hasOption(string $name): bool;", "public function hasOption(string $name): bool;", "public function has( $option );", "public function hasOptions();", "public function has(string $option): bool;", "public function hasOption(){\n return $this->_has(35);\n }", "function optionExists($optionList) {\n global $options;\n\n $return = false;\n if (!is_array($optionList)) {\n $optionList = array($optionList);\n }\n foreach ($optionList as $opt) {\n if (isset($options[$opt])) {\n $return = true;\n }\n }\n return $return;\n}", "public function has_option($name)\n {\n return array_key_exists($name, $this->_options);\n }", "static function customizer_option_exists( $option ) {\n\n\t\t// cache this json so we don't scramble it every time\n\t\tif ( ! self::has_customizer_options() && isset( $_POST['customized'] ) ) {\n\t\t\tself::set_customizer_options( $_POST['customized'] );\n\t\t}\n\t\t$options = self::get_customizer_options();\n\t\tif ( isset( $options[ $option ] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasOption($key): bool\n {\n return array_key_exists($key, $this->options);\n }", "public function has_option($key) {\n return is_array($this->options) && array_key_exists($key, $this->options);\n }", "private function _checkHasOption($token)\n {\n \tif (!isset($this->_session['products'][$token]['options']) OR count($this->_session['products'][$token]['options']) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n }", "public function isOptions(): bool {}", "public function hasOption($key)\n {\n return array_key_exists($key, $this->options);\n }", "public function hasOption(string $key) : bool\n {\n return $this->input->hasOption($key);\n }", "public function optionExists($name)\n {\n if ( !$name || !is_string($name) ) {\n throw new ScriptException(\"Parameter name is missing or invalid in call to HttpRequest::param()\");\n }\n\n return $this->options->exists($name);\n }", "public function hasOptItem(){\n return $this->_has(2);\n }", "public function optionExists($name)\n {\n return array_key_exists($name, $this->options);\n }", "public function hasOption(string $key): bool\n {\n return isset($this->options[$key]);\n }", "public function hasOption($key)\n {\n return isset($this->options[$key]);\n }", "public function hasOption($key)\n {\n return isset($this->options[$key]);\n }", "public function hasOption($name)\n {\n return array_key_exists($name, $this->options);\n }", "public function hasOption($name)\n {\n return array_key_exists($name, $this->options);\n }", "public function has_options() {\n\t\treturn count( $this->get_options() ) > 0;\n\t}", "protected function hasValue(string $opt):bool {\n return array_key_exists($opt, $this->opts);\n }", "public function hasOption($name)\n {\n return $this->input->hasOption($name);\n }", "public function hasOpt(string $name): bool\n {\n return isset($this->opts[$name]);\n }", "public function hasOption(string $name): bool\n {\n return isset($this->options[$name]);\n }", "public function hasOptionCollection(){\n\n\t\t\t$options = get_option( $this->optionsKey, array() );\n\n\t\t\treturn !empty( $options );\n\t\t}", "protected static function check($option)\n {\n return isset($option);\n }", "public function hasOptions()\n {\n return $this->get(self::OPTIONS) !== null;\n }", "public function check_option($option) {\n $option = $this->fixStepArgument($option);\n $this->getSession()->getPage()->checkField($option);\n }", "public function hasOption($name, $prefix = '')\n\t{\n\t\treturn array_key_exists($prefix . $name, $this->_options);\n\t}", "function optionExists($value) {\n foreach ($this->_options as $option) {\n if (isset($option['attr']['value']) && ($option['attr']['value'] == $value)) {\n return true;\n }\n }\n return false;\n }", "public function hasOptionGroup()\n {\n return false;\n }", "public function settingExists($key) {\n return isset($this->options[$key]);\n }", "function PKG_hasOptions($package, $packageID, $distr, $client, $release = \"\")\n{\n$addReleaseToPath = (isset($release{0}) ? \"$release/\" : \"\");\n\n$package=chop($package);\n//generate full path to the option page\n$filename=\"/m23/data+scripts/m23admin/packages/$distr/$addReleaseToPath\".$package.\"OptionPage.php\";\n\n//if file exists there is an option page\nif (file_exists($filename))\nreturn(\"<A HREF=\\\"/m23admin/packages/$distr/$addReleaseToPath\".$package.\"OptionPage.php?id=$packageID&client=$client&lang=$GLOBALS[m23_language]\\\" target=\\\"_blank\\\">Option</A>\");\nelse\nreturn(\"-\");\n}", "function wcnc2015_options_check() {\n\tif ( ! get_option( 'my-options-data' ) ) {\n\t\t$options_defaults['extra_tagline'] \t= '';\n\t\t$options_defaults['footer_text']\t= '';\n\n\t\tupdate_option( 'my-options-data', $options_defaults );\n\t}\n}", "public function __isset($name)\n\t{\n\t\treturn isset($this->_options[$name]);\n\t}", "public function hasOption($key): bool\n {\n if (is_array($key)) {\n foreach ($key as $k) {\n if ($this->hasOption($k)) {\n return true;\n }\n }\n return false;\n }\n return array_key_exists($key, $this->_options);\n }", "public function offsetExists($option)\n {\n return $this->hasOption($option);\n }", "function _validate_options_exist($options)\n\t{\n\t\tif ($this->validate_field_existence == TRUE)\n\t\t{\n\t\t\tforeach ($options as $key => $value)\n\t\t\t{\n\t\t\t\t$parts = explode(' ', $key);\n\t\t\t\t$field = $parts[1];\n\n\t\t\t\tif ( ! $this->db->field_exists($field, $this->primary_table))\n\t\t\t\t{\n\t\t\t\t\tshow_error('You are trying to insert data into a field that does not exist. The field \"'. $field .'\" does not exist in the \"'. $this->primary_table .'\" table.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function hasOptions(): bool\n {\n return isset($this->options);\n }", "public function hasOption($name)\n {\n return isset($this->options[$name]);\n }", "private function isOptionPresent(...$args): bool\n {\n foreach ($this->scriptOptions as $scriptOption => $val) {\n if (in_array($scriptOption, $args, true)) {\n return true;\n }\n }\n\n return false;\n }", "public function setOption(string $option, string $value): bool {}", "function hasDropDown() ;", "private function settings_option($option){\n $models = new Models('settings');\n $where = array(\n 'type' => strval($option['type']),\n 'meta_key' => strval($option['meta_key'])\n );\n $exists = $models->check_row_exists($where);\n if($exists){\n $this->update_settings($models, $option);\n }else{\n $this->insert_settings($models, $option);\n }\n }", "static function areHandlerOptionsValid ()\n {\n // There is no option yet\n return true;\n }", "public function hasOpts(): bool\n {\n return !empty($this->opts);\n }", "public function optIn() {\n return !empty($this->args['send_optin']);\n }", "public function hasOption($option)\n {\n return isset($this->options[$option]);\n }", "public function hasOption($name)\n {\n return $this->options[$name] ? true : false;\n }", "private function getConfigOption($option) {\n \n $option = strtolower($option);\n \n if (in_array($option, $this->clearParam($this->config[$this->context])))\n { \n return $option; \n }\n \n return false;\n }", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasDropDown() {}", "public function hasOptions() {\n\t\treturn count( $this->options ) > 0 ? true : false;\n\t}", "public function is_db_options_exist( $option_name ) {\n\n\t\t\t( false == get_option( $option_name ) ) ? $is_exist = false : $is_exist = true;\n\n\t\t\treturn $is_exist;\n\t\t}", "protected function hasDefault(string $opt):bool {\n return array_key_exists($opt, $this->defaults);\n }", "protected function validate_options() {\n\t\tif ( empty( $this->field['fields']['options'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( count( $this->field['fields']['options']['value'] ) === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $this->field['fields']['options']['value'] as $key => $option_value ) {\n\t\t\tif ( empty( $key ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( empty( $option_value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "final public static function isDefinedName($name)\n {\n self::initOptions();\n\n return isset(self::$options[$name]);\n }", "public function __isset($name) {\r\n\t\treturn $this->isOptionSet($name);\r\n\t}", "public function test_bad_option_names($empty) {\n $this->assertFalse( yourls_get_option( $empty ) );\n $this->assertFalse( yourls_add_option( $empty, '' ) );\n $this->assertFalse( yourls_update_option( $empty, '' ) );\n $this->assertFalse( yourls_delete_option( $empty ) );\n\t}", "private function isLinkOptionExist($option, $existingOption)\n {\n return $option['link_url'] == $existingOption['link_url']\n && $option['link_file'] == $existingOption['link_file']\n && $option['link_type'] == $existingOption['link_type']\n && $option['sample_url'] == $existingOption['sample_url']\n && $option['sample_file'] == $existingOption['sample_file']\n && $option['sample_type'] == $existingOption['sample_type']\n && $option['product_id'] == $existingOption['product_id'];\n }", "private function isAnOption($arg)\n {\n return $this->isAShortOption($arg) || $this->isALongOption($arg);\n }", "public function testOptionRequirementsMet()\n {\n $option = new Option('f');\n $option->setNeeds('foo');\n $optionSet = array(\n 'foo' => new Option('foo')\n );\n\n $this->assertTrue($option->hasNeeds($optionSet));\n }", "public function option(string $option);", "public static function isOptions(): bool {\r\n return static :: isMethod('options');\r\n }", "public function __isset( $name )\r\n {\r\n switch ( $name )\r\n {\r\n case 'options':\r\n return true;\r\n\r\n default:\r\n return false;\r\n }\r\n }", "public function check()\n {\n foreach ($this->options as $id => $option) {\n $option->check();\n }\n }", "function _options_option($option) {\n global $db ;\n $data = null ;\n $req = $db->prepare(\"SELECT `data` FROM `_options` WHERE `option` = :option \") ;\n $req->execute(array(\n \"option\" => $option\n )) ;\n $data = $req->fetch() ;\n return (isset($data['data'])) ? $data['data'] : false ;\n}", "function add_option($name, $value = '')\n{\n $CI =& get_instance();\n $exists = total_rows('options', array(\n 'name' => $name\n ));\n if ($exists == 0) {\n $CI->db->insert('options', array(\n 'name' => $name,\n 'value' => $value\n ));\n $insert_id = $CI->db->insert_id();\n if ($insert_id) {\n return true;\n }\n\n return false;\n }\n\n return false;\n}", "protected function isOption($xData)\n {\n return ($xData instanceof \\Limbonia\\Widget\\Option);\n }", "static function isValidOption($selectKey, $options)\n {\n if(in_array($_REQUEST[$selectKey], $options)){\n return true;\n }else{\n return false;\n }\n }", "function has_setting($name)\n {\n }", "public function hasOption(string $key, bool $checkShortName = true): bool\n {\n $hasOption = $this->input->hasParameterOption('--' . $key);\n\n if ($checkShortName && $hasOption === false) {\n $hasOption = $this->input->hasParameterOption('-' . $key[0]);\n }\n\n if ($hasOption === false) {\n $hasOption = $this->input->hasParameterOption($key);\n }\n\n return $hasOption;\n }", "public function isOptionsUpdated()\n {\n return !empty($this->itemErrors[SkuValidator::ERROR_OPTIONS_UPDATED]);\n }", "function test_add_option() {\n\t\tyourls_add_option( 'slash_test_1', $this->slash_1 );\n\t\tyourls_add_option( 'slash_test_2', $this->slash_2 );\n\t\tyourls_add_option( 'slash_test_3', $this->slash_3 );\n\t\tyourls_add_option( 'slash_test_4', $this->slash_4 );\n\n\t\t$this->assertEquals( $this->slash_1, yourls_get_option( 'slash_test_1' ) );\n\t\t$this->assertEquals( $this->slash_2, yourls_get_option( 'slash_test_2' ) );\n\t\t$this->assertEquals( $this->slash_3, yourls_get_option( 'slash_test_3' ) );\n\t\t$this->assertEquals( $this->slash_4, yourls_get_option( 'slash_test_4' ) );\n\t}", "public static function get_option($key){\n $options = self::get_options();\n if(!empty($options)){\n if(array_key_exists($key, $options)){\n return $options[$key];\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function has_options($rowid = null)\n\t{\n\t\t// Check if this item have options.\n\t\t//\n\t\treturn (array_get($this->cart_contents, $this->cart_name . '.' . $rowid . '.options') ? true : false);\n\t}", "public function has($key)\n {\n return array_key_exists($key, $this->parsedOptions);\n }", "function get_it_option( $option ) {\n\t$options = get_option( 'chalmersit_options' );\n\tif ( isset( $options[$option] ) )\n\t\treturn $options[$option];\n\telse\n\t\treturn false;\n}", "function getOption($name);", "protected function hasAbsenceLabel($option)\n {\n return isset($this->absenceLabelList[$option]);\n }", "public function checkIfEssentialConfigurationExists() {}", "public function testOptionsNotFound()\n {\n $this->_task->execute();\n }", "public function hasSetting( $name );", "protected function isShortOption($arg)\n {\n return (substr($arg, 0, 1) == '-') && (substr($arg, 1, 1) != '-');\n }", "public function hasOption( $optName ) {\n\t\treturn isset( $this->options[$optName] );\n\t}" ]
[ "0.8039358", "0.8034063", "0.7971946", "0.78899384", "0.77511513", "0.77283084", "0.77283084", "0.77250046", "0.7691247", "0.7620926", "0.75614417", "0.7193035", "0.7182039", "0.71783024", "0.70748705", "0.7047827", "0.7039177", "0.70383584", "0.69890636", "0.696285", "0.69314224", "0.69144374", "0.6899858", "0.68949085", "0.68303657", "0.68303657", "0.6822996", "0.6822996", "0.6762823", "0.6718672", "0.6715596", "0.66762453", "0.6662916", "0.6652631", "0.66388345", "0.66117704", "0.66037816", "0.65987426", "0.65983146", "0.65952843", "0.6595091", "0.6591506", "0.6584373", "0.65821207", "0.65801597", "0.65756005", "0.6570306", "0.6553669", "0.65487933", "0.6516858", "0.64995855", "0.6494852", "0.647672", "0.6460598", "0.6449008", "0.64487463", "0.64249533", "0.64161295", "0.6409778", "0.6386548", "0.6386548", "0.6386548", "0.6384824", "0.6384824", "0.6384824", "0.6384824", "0.6383835", "0.6383835", "0.6377817", "0.63051754", "0.6298493", "0.6282146", "0.6245801", "0.6229738", "0.6216912", "0.6208297", "0.6207576", "0.6180929", "0.6174492", "0.6169838", "0.6167663", "0.6166256", "0.6164351", "0.6125275", "0.61221313", "0.60998434", "0.60887325", "0.60516286", "0.60483414", "0.60369104", "0.6034075", "0.6004024", "0.5993016", "0.59876525", "0.5985372", "0.5973852", "0.59533584", "0.5947978", "0.5945974", "0.5945862", "0.5925691" ]
0.0
-1
returns option without any caching (directly from database)
public function getUnCached($name, $default=null) { /** @var Setting $setting */ if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) { $this->addToCache($setting); return $this->transformValueFromDatabase($setting->getValue(),$setting->getType()); } return $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function driver_get($keyword, $option = array()) {\n // return value if in caching\n try {\n $stm = $this->db($keyword)->prepare(\"SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1\");\n $stm->execute(array(\n \":keyword\" => $keyword\n ));\n $row = $stm->fetch(PDO::FETCH_ASSOC);\n\n } catch(PDOException $e) {\n\n $stm = $this->db($keyword,true)->prepare(\"SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1\");\n $stm->execute(array(\n \":keyword\" => $keyword\n ));\n $row = $stm->fetch(PDO::FETCH_ASSOC);\n }\n if($this->isExpired($row)) {\n $this->deleteRow($row);\n return null;\n }\n\n if(isset($row['id'])) {\n $data = $this->decode($row['object']);\n return $data;\n }\n return null;\n }", "function _options_option($option) {\n global $db ;\n $data = null ;\n $req = $db->prepare(\"SELECT `data` FROM `_options` WHERE `option` = :option \") ;\n $req->execute(array(\n \"option\" => $option\n )) ;\n $data = $req->fetch() ;\n return (isset($data['data'])) ? $data['data'] : false ;\n}", "function cactus_get_raw_option( $opt_name ) {\r\n\t$alloptions = wp_cache_get( 'alloptions', 'options' );\r\n\t$alloptions = maybe_unserialize( $alloptions );\r\n\treturn isset( $alloptions[ $opt_name ] ) ? maybe_unserialize( $alloptions[ $opt_name ] ) : false;\r\n}", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n\n $x = wincache_ucache_get($keyword,$suc);\n\n if($suc == false) {\n return null;\n } else {\n return $x;\n }\n }", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n $data = xcache_get($keyword);\n if($data === false || $data == \"\") {\n return null;\n }\n return $data;\n }", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n\n $data = apc_fetch($keyword,$bo);\n if($bo === false) {\n return null;\n }\n return $data;\n\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "private function _shouldBeCached()\n {\n $item = $this->repo->get(SettingKeys::CACHE_SETTINGS);\n //The setting failed to fetch, don't cache value to be on the safe side.\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:39] Failed to fetch setting.',\n ['key' => SettingKeys::CACHE_SETTINGS]\n );\n return false;\n }\n return $item->value;\n }", "private function get_option() {\n\t\t$default = [\n\t\t\tself::STATUS => self::NOT_FETCHED,\n\t\t\tself::LAST_FETCH => 0,\n\t\t];\n\n\t\treturn get_option( self::OPTION_NAME, $default );\n\t}", "public function getSomeOption() {}", "public function getCacheOptions();", "function get_option($option_name, $default_value = false)\n{\n if (!is_string($option_name)) {\n // Option name must be string\n return $default_value;\n }\n\n $opt = \\Controller::model(\"Option\", $option_name);\n if (!$opt->isAvailable()) {\n return $default_value;\n }\n\n // Return the value\n return $opt->get(\"option_value\");\n}", "public function get( $option );", "function bf_get_option($name) {\r\n\tglobal $bf_options;\r\n\t\r\n\tif (!is_object($bf_options) )\r\n\t\tbf_flush_options();\r\n\t\r\n\treturn $bf_options->$name;\r\n}", "public function isCacheEnabled(){\n return(false);\n }", "public function get(string $option);", "public function get(string $option);", "public function getFromCache() {}", "function get_option($name) {\n $setting = Setting::where('name', $name)->first();\n if(!$setting) {\n return \"\";\n }\n return $setting->value;\n}", "public function isCacheEnabled(){\n return(true);\n }", "public function isCacheEnabled(){\n return(true);\n }", "function apc_cache_shunt_all_options($false) {\n\tglobal $ydb; \n\t\n\t$key = APC_CACHE_ALL_OPTIONS; \n\tif(apc_exists($key)) {\n\t\t$ydb->option = apc_fetch($key);\n\t\t$ydb->installed = apc_fetch(APC_CACHE_YOURLS_INSTALLED);\n\t\treturn true;\n\t} \n\t\n\treturn false;\n}", "function get_option($option_key) {\n if (!isset($result)) {\n $result = get_option($option_key);\n }\n\n return $result;\n }", "public function useCache()\n {\n return false;\n }", "public function getNegativeCaching()\n {\n return isset($this->negative_caching) ? $this->negative_caching : false;\n }", "abstract public function get($key): Option;", "public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }", "public function _AllowCache()\n {\n return true;\n }", "public function getOpt($option) {}", "function get_cached_json($widget) {\n global $cachedb;\n\n if ( isset($cachedb) ) {\n $result=mysqli_query($cachedb, \"SELECT json FROM cache_table WHERE widget = '$widget'\");\n if ( $result ) {\n return mysqli_fetch_row($result)[0];\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "function driver_get($keyword, $option = array()) {\n // return value if in caching\n $this->connectServer();\n $x = $this->instant->get($keyword);\n if($x == false) {\n return null;\n } else {\n return $x;\n }\n }", "function getOption( $option )\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getOption( $option );\n }", "function getCache() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT cached_result FROM $this->cacheTable WHERE post_id = '\" . $this->db->escape( $this->postID ) . \"'\";\n\t\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( !$results[0] )\n\t\t\treturn false;\n\t\t\t\n\t\treturn $results[0]->cached_result;\n\t}", "function getRandomCache() {\n\t\tglobal $wpdb;\n\t\t\n\t\t$sql = \"SELECT MAX(cache_id) as max_id FROM ra_cache\";\n\t\t$results = $wpdb->get_results( $sql );\n\t\t$randomID = mt_rand( 1, $results[0]->max_id );\t\t\n\t\t\n\t\t$sql = \"SELECT cached_result FROM ra_cache WHERE cache_id >= \" . $randomID . \" AND post_id >= 1 ORDER BY cache_id ASC LIMIT 1\";\n\t\t$results = $wpdb->get_results( $sql );\n\n\t\tif ( !$results )\n\t\t\treturn \"\";\t\t\n\t\t\t\n\t\treturn $results[0]->cached_result;\t\n\t\t\t\n\t}", "public function cacheGet() {\n }", "public function cached()\n {\n // check cache is available else set cache and return\n return Cache::get('Klaravel\\Settings\\Setting', function () {\n $data = $this->get();\n Cache::put('Klaravel\\Settings\\Setting', $data, 60 * 24);\n\n return $data;\n });\n }", "public function cache($options = true);", "function _can_cache() {\n\t\treturn true;\n\t}", "public function isCached(): bool;", "public function isCached() {}", "function __get($name){\r\n try{\r\n return parent::__get($name);\r\n }catch(exception $e){\r\n if(isset($this->_options[$name]))\r\n return $this->_options[$name];\r\n throw $e;\r\n }\r\n }", "public function optionInMemoryEnabled() {\n\t\treturn $this->zap->request($this->zap->base . 'stats/view/optionInMemoryEnabled/')->{'InMemoryEnabled'};\n\t}", "protected function _loadCache()\n {\n return false;\n }", "public function allow_cache() {\n\t\treturn $this->query_str == $this->query_escaped;\n\t}", "protected function get()\n {\n return get_option($this->hash);\n }", "private function decide(): bool\n {\n if ($this->cloudflare && isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {\n $this->cache = false;\n $this->addMessage('request from cloudflare');\n }\n // don't cache if user is logged in\n if (strpos('test ' . implode(' ', array_keys($_COOKIE)), 'wordpress_logged_in')) {\n $this->cache = false;\n $this->loggedin = true;\n $this->addMessage('Loggedin user');\n }\n // don't cache post requests\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $this->cache = false;\n $this->addMessage('Post request');\n }\n // don't cache requests to wordpress php files\n if (preg_match('%(/wp-admin|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)%',\n $this->path)) {\n $this->cache = false;\n $this->addMessage('This is a WordPress file ');\n }\n\n // don't cache if url has a query string\n // TODO verify that this is reasonable\n if (parse_url($this->url, PHP_URL_QUERY)) {\n $this->cache = false;\n $this->addMessage('Not caching query strings');\n }\n\n return $this->cache;\n }", "function qa_opt($name, $value = null)\n{\n\tglobal $qa_options_cache;\n\n\tif (!isset($value) && isset($qa_options_cache[$name]))\n\t\treturn $qa_options_cache[$name]; // quick shortcut to reduce calls to qa_get_options()\n\n\trequire_once QA_INCLUDE_DIR . 'app/options.php';\n\n\tif (isset($value))\n\t\tqa_set_option($name, $value);\n\n\t$options = qa_get_options(array($name));\n\n\treturn $options[$name];\n}", "public function __get( $name )\n\t{\n\t\t//\tThen behaviors\n\t\tforeach ( $this->_behaviorCache as $_behaviorName )\n\t\t{\n\t\t\tif ( ( $_behavior = $this->asa( $_behaviorName ) ) instanceof IPSOptionContainer && $_behavior->contains( $name ) )\n\t\t\t\treturn $_behavior->getValue( $name );\n\t\t}\n\n\t\t//\tTry daddy...\n\t\treturn parent::__get( $name );\n\t}", "function __get($name){\n try{\n return parent::__get($name);\n }catch(exception $e){\n if(isset($this->_options[$name]))\n return $this->_options[$name];\n throw $e;\n }\n }", "function _cache_get ($cache_name = \"\") {\n\t\tif (empty($cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\treturn $this->_get_cache_file($cache_file_path);\n\t}", "private function get_caches () {\n $caches_slug = 'cache';\n return $this->get_option($caches_slug, array());\n }", "public static function getOption($key) {\n return DB::table('site_options')\n ->where('key', $key)\n ->first();\n }", "public function get($option){\n return $this->db->get_where(\"admin\", $option)->row();\n }", "function get_data_request_options()\r\n{\r\n\t//kijk wat het abstractie niveau is van de huidige opties\r\n\t$current_abstraction_level_query = 'select option_type from Requestable_data where option_name == \":current_selected_option\"';\r\n\t$current_abstraction_level = execute_sql_extract_data($current_abstraction_level_query);\r\n\t\r\n\t//haal de opties maar op uit de DB\r\n\t$requestable_data_descriptions = 'select option_name from Requestable_data where option_type = ' . $current_abstraction_level;\r\n\texecute_sql_extract_data($requestable_data_descriptions);\r\n}", "public function get_setting() {\n // $this->db->where('option_name', $opname);\n \n $query = $this->db->get('t_pref');\n return $query->row();\n }", "protected function useCache() {\n\t\tif (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (isset($_GET['nc']) && $_GET['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public static function cacheEnabled($mnt,$command,$params,$path)\n{\nif (!is_null(self::$caching)) return self::$caching;\n\nif (is_null($mnt)) return false;\n\nreturn self::instance($mnt)->cacheEnabled($command,$params,$path);\n}", "public function isUseCache()\n {\n return $this->use_cache;\n }", "function getOption($name);", "public function wasCached();", "function dialogue_get_cached_param($name, $value, $default) {\n global $PAGE;\n\n if (!isset($PAGE->cm->id)) {\n return $default;\n }\n\n $cache = cache::make('mod_dialogue', 'params');\n $cacheparam = $name . '-' . $PAGE->cm->id;\n\n if (is_null($value)) {\n $cachevalue = $cache->get($cacheparam);\n if ($cachevalue) {\n return $cachevalue;\n }\n }\n\n if ($value) {\n $cache->set($cacheparam, $value);\n return $value;\n }\n\n return $default;\n}", "public function flagSwitcherMultistore()\n {\n\n //$key = 'store.flag'.__METHOD__;\n\t\t$key = 'BellforStore.flagSwitcher';\n\t\t// error in header if not cache->get('store')\n\t\t//$store_data = $this->cache->get('store');\n\t\t$store_data = NULL;\n\t\tif(!$store_data) {\n\t\t//$key = 'store.flagSwitcher'.uniqid();\n\t\t$flagswitcher_data = null;\n\t\t$admin_cache_store = null;\n\t\t$this->cache->delete($key);\n\t\t}else {\n $flagswitcher_data = $this->cache->get($key);\n\t\t$admin_cache_store = true;\n\t\t}\n\n if (!$flagswitcher_data) {\n $q = $this->db->query(\"SELECT `value` FROM \" . DB_PREFIX . \"setting WHERE store_id = '0' AND `key` = 'config_name' LIMIT 1\");\n\n $store_name_default = 'Store';\n if (!empty($q->row) && is_array($q->row)) {\n $store_name_default = $q->row['value'];\n }\n\n $sql = 'SELECT\n\t\t\t`s`.`store_id`,\n\t\t\tLOWER(`c`.`iso_code_2`) as img_name,\n\t\t\tCOALESCE(`mag`.`name` , \"'.$store_name_default.'\" ) as store_name,\n\t\t\tCOALESCE(`mag`.`url` , \"'.HTTP_SERVER.'\" ) as store_url,\n\t\t\tCOALESCE(`mag`.`ssl` , \"'.HTTPS_SERVER.'\" ) as store_ssl,\n\t\t\t`c`.`country_id`,\n\t\t\t`c`.`name` as country_name,\n\t\t\t`c`.`iso_code_2`\n\t\t\tFROM `' . DB_PREFIX . 'setting` s\n\t\t\tLEFT JOIN `' . DB_PREFIX . 'country` c ON (s.value = c.country_id)\n\t\t\tLEFT JOIN `' . DB_PREFIX . 'store` mag ON (s.store_id = mag.store_id)\n\t\t\tWHERE `s`.`key` = \"config_country_id\"\n\t\t\tORDER BY `s`.`store_id`\n\t\t\t';\n// var_dump($sql); die();\n $query = $this->db->query($sql);\n\n $flagswitcher_data = $query->rows;\n\n if($admin_cache_store) {\n\t\t\t$this->cache->set($key, $flagswitcher_data);\n }\n\n }\n\n return $flagswitcher_data;\n }", "public function getCache()\n\t{\n\t\tif( ! $this->cache_on)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(isset($this->cache_obj))\n\t\t{\n\t\t\treturn $this->cache_obj;\n\t\t}\n\t\t\n\t\t$class = 'Db_Cache_'.$this->cachedrv;\n\t\t\n\t\t$this->cache_obj = new $class($this->cacheopt);\n\t\t\n\t\treturn $this->cache_obj;\n\t}", "function _display_cache(&$CFG, &$URI){\n return false;\n\n /* SE PODRÍA DESHABILITAR POR ENTORNOS O POR LO QUE SEA */\n\n return parent::_display_cache($CFG,$URI);\n }", "private function eOrEd(){\n $ci = &get_instance();\n return $ci->config->item('MemcacheOrMemcached');\n }", "public function _AllowCache()\n {\n // caching not possible because we randomize the images\n $bCachingAllowed = true;\n if ($this->bPickRandomImage) {\n $bCachingAllowed = false;\n }\n\n return $bCachingAllowed;\n }", "function get_it_option( $option ) {\n\t$options = get_option( 'chalmersit_options' );\n\tif ( isset( $options[$option] ) )\n\t\treturn $options[$option];\n\telse\n\t\treturn false;\n}", "function tia_get_option($key) {\t\n\tglobal $tia_options;\t\n\t$tia_options = get_option('tia_options');\n\t\n\t$tia_defaults = array(\t\t\t\t\t\n\t\t'tia_theme_bkg' => 'white',\n\t\t'tia_default_height' => 700,\n\t\t'tia_scrolling_img_margin_top' => 117,\n\t\t'tia_story_margin_top' => 70\n\t\t\n\t);\n\t\n\t//Array of options not stored in tia_options array\n\t$not_in_array = array(\t\t\n\t\t'tia_logo' => false\t\t\n\t);\n\t\n\tif($not_in_array[$key]){\n\t\tif(!get_option($key)){\n\t\t\t$tia_options[$key] = $tia_defaults[$key];\n\t\t}\n\t\telse{\n\t\t\t$tia_options[$key] = get_option($key);\n\t\t}\n\t}else{\t\t\t\n\t\tif (!$tia_options[$key]){\t\t\n\t\t\t$tia_options[$key] = $tia_defaults[$key];\t\t\t\n\t\t}\n\t}\t\n\treturn $tia_options[$key];\n}", "function get_site_option($option, $default_value = \\false, $deprecated = \\true)\n {\n }", "public function cacheOptions ()\n {\n\n foreach ( $this->optionsToPersist as $option ) {\n\n $this->optionsCache[ $option ] = $this->getOption ( $option );\n\n }\n\n }", "protected function load_cache(){\r\n\t\tstatic $cached = null;\r\n\t\t\r\n\t\tif(!$cached){\r\n\t\t\t\r\n\t\t\tif($this->_cfg->get('sfversion') == 'auto'){\r\n\t\t\t\t// get version from sourceforge/cache\r\n\t\t\t\tif (!$this->is_cached()) $this->update_cache();\r\n\t\t\t\t$cached = (object)include($this->get_cache());\r\n\t\t\t}else{\r\n\t\t\t\t// use predefined version from config\r\n\t\t\t\t$cached = (object)$this->_cfg->get('sfversion');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $cached;\r\n\t}", "public static function getBestMatch( $type ) {\n\t\tstatic $order = array( 'db', 'apc', 'shm', 'file' );\n\t\t\n\t\t$type = strtolower($type);\n\t\t\n\t\tif (!in_array($type, $order)) { // try to be as graceful as possible\n\t\t\t$type = 'file';\n\t\t}\n\t\t\n\t\t$options = $order;\n\t\t$cache = NULL;\n\t\t\n\t\tarray_unshift( $options, $type );\n\t\t$options = array_unique($options);\n\t\t\n\t\twhile ($cache === NULL && ($currentOption = array_shift($options))) {\n\t\t\tswitch ($currentOption) {\n\t\t\t\tcase 'db':\n\t\t\t\t\trequire_once STROOT . '/cache/class.DBCache.php';\n\t\t\t\t\tif (DBCache::available()) $cache = new DBCache( self::$storage );\n\t\t\t\tbreak;\n\t\t\t\tcase 'apc':\n\t\t\t\t\trequire_once STROOT . '/cache/class.ApcCache.php';\n\t\t\t\t\tif (APCCache::available()) $cache = new ApcCache();\n\t\t\t\tbreak;\n\t\t\t\tcase 'shm':\n\t\t\t\t\trequire_once STROOT . '/cache/class.ShmopCache.php';\n\t\t\t\t\tif (ShmopCache::available()) $cache = new ShmopCache();\n\t\t\t\tbreak;\n\t\t\t\tcase 'file':\n\t\t\t\tdefault:\n\t\t\t\t\trequire_once STROOT . '/cache/class.FileCache.php';\n\t\t\t\t\tif (FileCache::available()) $cache = new FileCache();\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$cache) {\n\t\t\tthrow new RuntimeException('No cache available');\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $cache;\n\t}", "private static function get_option( $key ){\n\t\treturn self::$is_mu ? get_blog_option( 1, $key ) : get_option( $key );\n\t}", "public function view_option()\n{\n\t//option included, excluded\n\treturn \"excluded\";\n}", "public function view_option()\n{\n\t//option included, excluded\n\treturn \"excluded\";\n}", "protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}", "private function _getCreateCreditmemoOption()\n {\n return (boolean) Mage::getStoreConfig('payment/paymentnetwork_pnsofortueberweisung/create_creditmemo', Mage::app()->getStore()->getStoreId());\n }", "public function option()\n {\n return $this->optionRequested;\n }", "function getSettingValue($type){\n return sqlSelectOne(\"SELECT * FROM settings WHERE setting_type='$type'\", 'setting_value');\n\n}", "function monsterinsights_get_option( $key = '', $default = false ) {\n\tglobal $monsterinsights_settings;\n\t$value = ! empty( $monsterinsights_settings[ $key ] ) ? $monsterinsights_settings[ $key ] : $default;\n\t$value = apply_filters( 'monsterinsights_get_option', $value, $key, $default );\n\treturn apply_filters( 'monsterinsights_get_option_' . $key, $value, $key, $default );\n}", "public function getOption($name);", "public function getOption($name);", "public function getOption($name);", "function getUrlPromo() {\n\t$connection = connectDB();\n\t$tabla = 'options';\n\t$option_name = 'urlPopup';\n\n\t$query = \"SELECT * FROM \" .$tabla. \" WHERE options_name = '{$option_name}' LIMIT 1\";\n\t$result = mysqli_query($connection, $query);\n\t\n\tcloseDataBase($connection);\n\n\tif ($result->num_rows == 0) {\n\t\treturn '#';\n\t}\n\t\n\t$data = mysqli_fetch_array($result);\n\t\n\tif ($data[2] == '') {\n\t\treturn '#';\n\t} else {\n\t\treturn $data[2];\n\t}\n\n\tcloseDataBase($connection);\n}", "public function get($cache_name);", "public static function is_set_cache(): bool\n {\n return self::getConfigDB(self::cache);\n }", "function ks_save_options_page($post_id) {\n // check if this is an options page\n if ($post_id == 'options') {\n // check if this site is hosted on a Kinsta production environment with caching\n if (wp_get_environment_type() == 'production' && class_exists('Kinsta\\Cache')) {\n wp_remote_get('https://localhost/kinsta-clear-cache-all', [\n 'sslverify' => false, \n 'timeout' => 5\n ]); // purge the cache\n }\n }\n}", "function wp_cache_supports($feature)\n {\n }", "function datalist_get($name) {\n\tglobal $CONFIG, $DATALIST_CACHE;\n\n\t// We need this, because sometimes datalists are received before the database is created\n\tif (!is_db_installed()) {\n\t\treturn false;\n\t}\n\n\t$name = trim($name);\n\n\t// cannot store anything longer than 32 characters in db, so catch here\n\tif (elgg_strlen($name) > 32) {\n\t\telgg_log(\"The name length for configuration variables cannot be greater than 32\", \"ERROR\");\n\t\treturn false;\n\t}\n\n\t$name = sanitise_string($name);\n\tif (isset($DATALIST_CACHE[$name])) {\n\t\treturn $DATALIST_CACHE[$name];\n\t}\n\n\t// If memcache enabled then cache value in memcache\n\t$value = null;\n\tstatic $datalist_memcache;\n\tif ((!$datalist_memcache) && (is_memcache_available())) {\n\t\t$datalist_memcache = new ElggMemcache('datalist_memcache');\n\t}\n\tif ($datalist_memcache) {\n\t\t$value = $datalist_memcache->load($name);\n\t}\n\tif ($value) {\n\t\treturn $value;\n\t}\n\n\t// [Marcus Povey 20090217 : Now retrieving all datalist values on first load as this saves about 9 queries per page]\n\t$result = get_data(\"SELECT * from {$CONFIG->dbprefix}datalists\");\n\tif ($result) {\n\t\tforeach ($result as $row) {\n\t\t\t$DATALIST_CACHE[$row->name] = $row->value;\n\n\t\t\t// Cache it if memcache is available\n\t\t\tif ($datalist_memcache) {\n\t\t\t\t$datalist_memcache->save($row->name, $row->value);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($DATALIST_CACHE[$name])) {\n\t\t\treturn $DATALIST_CACHE[$name];\n\t\t}\n\t}\n\n\n\t/*if ($row = get_data_row(\"SELECT value from {$CONFIG->dbprefix}datalists where name = '{$name}' limit 1\")) {\n\t\t$DATALIST_CACHE[$name] = $row->value;\n\n\t\t// Cache it if memcache is available\n\t\tif ($datalist_memcache) $datalist_memcache->save($name, $row->value);\n\n\t\treturn $row->value;\n\t}*/\n\n\treturn null;\n}", "function get_page_builder_options($post_id,$cache=true){\r\r // check if cache\r $cache_key ='_st_page_builder_'.$post_id;\r if($cache){\r if($values = wp_cache_get( $cache_key ) ) {\r return $values;\r }\r }\r\r $values = get_post_meta($post_id,'_st_page_builder',true);\r if(!is_array($values) && !is_object($values)){\r $values = maybe_unserialize(base64_decode($values));\r }\r\r $values= st_stripslashes($values);\r $values = apply_filters('st_page_builder_options',$values);\r if($cache){ // cache to WP\r wp_cache_add( $cache_key, $values );\r }\r return $values;\r}", "function __get_option($setting)\n {\n }", "public static function hasDefaultCache();", "public function get_option($option) {\n if (isset($this->options[$option])) return $this->options[$option];\n return null;\n }", "public function getProductOption();", "public function getCacheMode()\n {\n return isset($this->cache_mode) ? $this->cache_mode : '';\n }", "public static function getCacheControl() {}", "public function getOption()\n {\n return $this->option;\n }", "public function getOption()\n {\n return $this->option;\n }", "public function get() {\n\t\treturn (bool) $this->user_options->get( static::OPTION );\n\t}", "function cache_get( $key ) {\n\t\t\n\t\tif ( !extension_loaded('apc') || (ini_get('apc.enabled') != 1) ) {\n\t\t\tif ( isset( $this->cache[ $key ] ) ) {\n\t\t\t\treturn $this->cache[ $key ];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn apc_fetch( $key );\n\t\t}\n\n\t\treturn false;\n\n\t}" ]
[ "0.6428099", "0.63358283", "0.630145", "0.62360513", "0.61829257", "0.60803753", "0.59868", "0.5970068", "0.595003", "0.59270906", "0.59037775", "0.5878878", "0.5865659", "0.58592004", "0.5855682", "0.58397853", "0.58397853", "0.5809125", "0.5769689", "0.5765918", "0.5765918", "0.5725296", "0.57247597", "0.5715557", "0.570486", "0.57021433", "0.56993675", "0.5690574", "0.56770927", "0.56748325", "0.56699806", "0.5665305", "0.56487125", "0.56365824", "0.5624214", "0.5606662", "0.5600687", "0.5582686", "0.55819917", "0.5579198", "0.5573435", "0.55726206", "0.55695915", "0.55639935", "0.5526028", "0.5513616", "0.5502683", "0.54873234", "0.54862607", "0.54795074", "0.54656893", "0.5451949", "0.54508555", "0.5434698", "0.54273754", "0.54085475", "0.5404742", "0.54038036", "0.5400455", "0.53819364", "0.53817147", "0.5376412", "0.53752947", "0.5372545", "0.53619367", "0.5355579", "0.5355508", "0.53410494", "0.5339663", "0.5336979", "0.5336929", "0.53328454", "0.53283453", "0.532533", "0.532533", "0.5323435", "0.5319832", "0.5317255", "0.5312462", "0.5308577", "0.53007674", "0.53007674", "0.53007674", "0.52931577", "0.52886957", "0.528295", "0.5280668", "0.52802694", "0.52781343", "0.5274258", "0.52706134", "0.5264392", "0.52609944", "0.5256765", "0.525492", "0.52467185", "0.5246258", "0.5246258", "0.524368", "0.52407193" ]
0.540381
57
returns array with additional data to the option like type, section and last updated
public function getFull($name) { if(isset($this->settings[$name])) { return $this->settings[$name]; } /** @var Setting $setting */ if($setting=$this->em->getRepository('CreavoOptionBundle:Setting')->findByName($name)) { $this->settings[$name]=$setting->toArray(); return $setting->toArray(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function additionalData()\n {\n return [\n 'options' => $this->options\n ];\n }", "protected function _getOptions() { return array(); }", "protected function _options() {\n\t\t\treturn array();\n\t\t}", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "function getOptions() ;", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t\n\t\t];\n\t}", "abstract public function getOptions();", "public function getOptions() : array;", "public function option()\n\t{\n\t\treturn [];\n\t}", "public function toOptionArray(){\n $options = array();\n $table = 'cms_block';\n $fields = Mage::helper('connector')->getFields($table);\n \n for ($i = 0; $i < sizeof($fields); $i++){\n $options[] = array(\n 'label' => $fields[$i],\n 'value' => $fields[$i]\n );\n }\n return $options;\n }", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "function getAllOptionsInfos()\n {\n return $this->options_infos;\n }", "public function option_fields() {\n\n // Only need to initiate the array once per page-load\n if ( ! empty( $this->option_metabox ) ) {\n return $this->option_metabox;\n }\n\n $completion_badge_array = EMS_OP_Tool::wpbadger_award_choose_badge ();\n\n $this->fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Content version number', 'op_tool' ),\n\t\t\t\t'desc' => __( 'increase this version number after any change to the content of this resource', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'content_version',\n\t\t\t\t'type' => 'text_small',\n\t\t\t\t// 'repeatable' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Completion badge', 'op_tool' ),\n\t\t\t\t'desc' => __( 'select the badge to be awarded for the completion of this OP Tool', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'completion_badge_id',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => $completion_badge_array,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Badge evidence text', 'op_tool' ),\n\t\t\t\t'desc' => __( 'this text will be displayed when someone follows the evidence link of a completion badge', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'badge_evidence_text',\n\t\t\t\t'type' => 'textarea_small',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Badge admin email text', 'op_tool' ),\n\t\t\t\t'desc' => __( 'the text that will appear in the email to the Administrator the user elected to inform', 'op_tool' ),\n\t\t\t\t'id' => $prefix . 'badge_notify_admin_text',\n\t\t\t\t'type' => 'textarea_small',\n\t\t\t),\n\t\t\t/*array(\n\t\t\t 'id' => $prefix . 'ems_admin_contacts_group',\n\t\t\t 'type' => 'group',\n\t\t\t 'description' => __( 'The EMS admin contacts for each institution (to be sent notifications when their students complete)', 'op_tool' ),\n\t\t\t 'options' => array(\n\t\t\t 'group_title' => __( 'Institution {#}', 'op_tool' ), // since version 1.1.4, {#} gets replaced by row number\n\t\t\t 'add_button' => __( 'Add Another Institution', 'op_tool' ),\n\t\t\t 'remove_button' => __( 'Remove Institution', 'op_tool' ),\n\t\t\t 'sortable' => true, // beta\n\t\t\t ),\n\t\t\t\t'show_names' => true,\n\t\t\t // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed.\n\t\t\t 'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __( 'Institution', 'op_tool' ),\n\t\t\t\t\t\t//'desc' => __( 'enter the intitution\\'s name', 'op_tool' ),\n\t\t\t\t\t\t'id' => $prefix . 'institution_name',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t// 'repeatable' => true,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __( 'EMS admin\\'s email address', 'op_tool' ),\n\t\t\t\t\t\t//'desc' => __( 'enter the email address of the person who deals with EMS OPT certificates', 'op_tool' ),\n\t\t\t\t\t\t'id' => $prefix . 'institution_admin_email',\n\t\t\t\t\t\t'type' => 'text_email',\n\t\t\t\t\t\t// 'repeatable' => true,\n\t\t\t\t\t),\n\t\t\t ),\n\t\t\t),*/\n );\n\n $this->option_metabox = array(\n 'id' => 'option_metabox',\n 'show_on' => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),\n 'show_names' => true,\n 'fields' => $this->fields,\n );\n\n return $this->option_metabox;\n }", "protected function getOptions()\r\n {\r\n return [\r\n\r\n ];\r\n }", "public function get_options(){\n $this->options = [\n 'items' => get_post_meta( $this->ID, 'opt_items' ),\n 'margin' => get_post_meta( $this->ID, 'opt_margin' ),\n 'loop' => get_post_meta( $this->ID, 'opt_loop' ),\n 'nav' => get_post_meta( $this->ID, 'opt_nav' ),\n 'dots' => get_post_meta( $this->ID, 'opt_dots' ),\n 'autoplay' => get_post_meta( $this->ID, 'opt_autoplay' ),\n 'autoplaySpeed' => get_post_meta( $this->ID, 'opt_autoplaySpeed' ),\n ];\n }", "function getOptions() {\n\t\t$rc = array();\n\t\t$conf = $this->config['table.'];\n\t\t$table = $conf['name'];\n\t\t\n\t\tif (is_array($conf)) {\n\t\t\t$query = $this->local_cObj->getQuery($table, $conf, TRUE);\n\t\t\treturn $this->db->selectRecords($query['SELECT'], $query['FROM'], $query['WHERE'], $query['ORDERBY']);\n\t\t}\n\t\t\n\t\t$rc = array();\n\t\t$options = $this->config['options.'];\n\t\tif (is_array($options)) {\n\t\t\tforeach ($options AS $uid => $title) {\n\t\t\t\t$rc[] = array('uid' => $uid, 'title' => $title);\n\t\t\t}\n\t\t\t$this->config['table.']['valueField'] = 'uid'; // Just in case\n\t\t}\n\t\t\n\t\treturn $rc;\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public static function get_current_options(){\n\t\t\t\n\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\n\t\t\t$settings = $wpdb->get_results(\"SELECT * FROM \".$wpdb->prefix.self::$table_name_settings); \n\t\t\t\n\t\t\t$arr_opt = array();\n\t\t\tif(!empty($settings)){\n\t\t\t\t\tforeach($settings as $key => $val){\n\t\t\t\t\t\t$arr_opt[] = $val->rs_postid;\n\t\t\t\t\t\t$arr_opt[] = $val->rs_lang;\n\t\t\t\t\t\t$arr_opt[] = $val->rs_posttype;\n\t\t\t\t\t\t$arr_opt[] = $val->rs_type;\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t}\n\t\t\t\n\t\t\treturn $arr_opt;\n\t\n\t\t}", "protected function getOptions()\n {\n return array(\n\n );\n }", "public function getOptionList(){\n return array_merge($this->_getBookingOptions(), parent::getOptionList());\n }", "public function getOptions(){ return $this->option_map; }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions() {\n\t\treturn array();\n\t}", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "public function tOptions()\n {\n return json_encode($this->options);\n }", "public function getOptions()\r\n {\r\n }", "protected function get_options()\n\t{}", "function getOptions()\n\t{\n\t\t\n\t\treturn $this->getAssoc(Array('id','title')/*, $cond*/);\n\t}", "public function get_options()\n {\n }", "protected function additionalDataHookOptions(): array\n {\n return $this->dataHookOptions;\n }", "public function info() {\n\t\treturn array (\n\t\t\t\t'text_type' => 'selection',\n\t\t\t\t'module' => 'ZSELEX',\n\t\t\t\t'text_type_long' => $this->__ ( 'Deal Of The Day (DOTD)' ),\n\t\t\t\t'allow_multiple' => true,\n\t\t\t\t'form_content' => false,\n\t\t\t\t'form_refresh' => false,\n\t\t\t\t'show_preview' => true,\n\t\t\t\t'admin_tableless' => true \n\t\t);\n\t}", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions() : array\n {\n return [];\n }", "public function get_additional_info()\n {\n return array();\n }", "public function getAvailableOptions(): array\n\t{\n\t\treturn [\n\t\t\t'id',\n\t\t\t'timestamp',\n\t\t\t'trigger',\n\t\t\t'progress',\n\t\t\t'assignment',\n\t\t\t'obj_type',\n\t\t\t'obj_title',\n\t\t\t'refid',\n\t\t\t'link',\n\t\t\t'parent_title',\n\t\t\t'parent_refid',\n\t\t\t'user_mail',\n\t\t\t'user_id',\n\t\t\t'user_login',\n\t\t];\n\t}", "function _dataone_admin_version_options() {\n\n $options = array();\n\n $versions = _dataone_api_versions();\n if (!empty($versions)) {\n foreach ($versions as $version_id => $version_data) {\n $options[$version_id] = $version_data['name'];\n }\n }\n\n return $options;\n}", "private function gather_plugin_options() {\n $options = array();\n foreach ( $this->OPTIONS as $value ) {\n $options[ $value ] = get_option( $value );\n }\n return array( '_wp_super_cache_options' => $options );\n }", "function awm_select_options()\n {\n return array(\n 'options' => array(\n 'label' => __('Options', 'extend-wp'),\n 'case' => 'repeater',\n 'include' => array(\n 'option' => array(\n 'label' => __('Value', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'label' => array(\n 'label' => __('Label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n ),\n ),\n );\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }" ]
[ "0.6768504", "0.63479304", "0.6339814", "0.6205233", "0.6205233", "0.6205233", "0.6205233", "0.6205233", "0.6205233", "0.6205233", "0.6154977", "0.6139292", "0.61230814", "0.6104812", "0.6103465", "0.60967773", "0.6084546", "0.6084546", "0.6081955", "0.606357", "0.606357", "0.6063202", "0.6057014", "0.6049089", "0.6048684", "0.6035156", "0.6032216", "0.6030659", "0.6030659", "0.6030659", "0.6030659", "0.601382", "0.60075676", "0.5999005", "0.59834224", "0.59791946", "0.5974851", "0.5974851", "0.5974851", "0.5974851", "0.5974851", "0.5974851", "0.5974851", "0.5973061", "0.5969735", "0.5969735", "0.5969735", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.596934", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5964467", "0.5956303", "0.5937048", "0.59326434", "0.5929492", "0.59268063", "0.5917806", "0.59158814", "0.59149176", "0.59149176", "0.59149176", "0.59149176", "0.59149176", "0.59149176", "0.59149176", "0.59149176", "0.59149176", "0.5913517", "0.59088254", "0.59086", "0.59071016", "0.5894063", "0.5892068", "0.58862406", "0.58862406", "0.58862406" ]
0.0
-1
returns array with all options
public function getAll() { $data=[]; foreach($this->settings AS $name=>$value) { $data[$name]=$this->get($name); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n\n );\n }", "protected function getOptions() {\n\t\treturn array();\n\t}", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function _options() {\n\t\t\treturn array();\n\t\t}", "public function getOptions() : array;", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions() : array\n {\n return [];\n }", "public function all()\n\t{\n\t\treturn $this->options;\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t\n\t\t];\n\t}", "public function option()\n\t{\n\t\treturn [];\n\t}", "public function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "public function getAllOptions()\r\n {\r\n $result = [];\r\n\r\n foreach (self::getOptionArray() as $index => $value) {\r\n $result[] = ['value' => $index, 'label' => $value];\r\n }\r\n\r\n return $result;\r\n }", "protected function getOptions()\r\n {\r\n return [\r\n\r\n ];\r\n }", "public function getAll()\n {\n return $this->options;\n }", "public function getAllOptions()\n {\n $result = [];\n\n foreach (self::getOptionArray() as $index => $value) {\n $result[] = ['value' => $index, 'label' => $value];\n }\n\n return $result;\n }", "protected function getOptions(): array\n {\n return [];\n }", "protected function getOptions(): array\n {\n return [];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t];\n\t}", "function getOptions() ;", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "protected function getOptions() {\n return [];\n }", "protected function getOptions() {\n return [];\n }" ]
[ "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8515708", "0.8510147", "0.8507465", "0.8507465", "0.8507465", "0.84780484", "0.8472517", "0.8457437", "0.8457437", "0.8457437", "0.8457437", "0.8457437", "0.8457437", "0.8457437", "0.8454799", "0.8454799", "0.8454799", "0.8454799", "0.8454262", "0.8454262", "0.8454262", "0.8454262", "0.8454262", "0.8454262", "0.8454262", "0.8442499", "0.8442499", "0.8442499", "0.8442499", "0.8442499", "0.8442499", "0.8442499", "0.8442499", "0.8442499", "0.84287775", "0.84071183", "0.83946943", "0.83946943", "0.83946943", "0.83946943", "0.83946943", "0.83946943", "0.83946943", "0.8353143", "0.83506554", "0.8340808", "0.82715946", "0.8240905", "0.8239198", "0.82390016", "0.82390016", "0.82390016", "0.82390016", "0.82390016", "0.82390016", "0.82390016", "0.82390016", "0.82390016", "0.82378113", "0.8223012", "0.8191165", "0.8174701", "0.8174081", "0.8174081", "0.816313", "0.8145296", "0.81239444", "0.81239444", "0.81239444", "0.81239444", "0.81239444", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8121344", "0.8104064", "0.8104064" ]
0.0
-1
returns array with all options and additional data
public function getAllFull() { $data=[]; foreach($this->settings AS $name=>$value) { $data[$name]=$this->getFull($name); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function additionalData()\n {\n return [\n 'options' => $this->options\n ];\n }", "protected function _getOptions() { return array(); }", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "protected function _options() {\n\t\t\treturn array();\n\t\t}", "function getOptions() ;", "protected function getOptions()\n {\n return array(\n\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\n {\n return array(\n );\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "public function getOptions() : array;", "protected function getOptions() {\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t\n\t\t];\n\t}", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "protected function getOptions()\n {\n return array();\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "abstract public function getOptions();", "protected function getOptions()\r\n {\r\n return [\r\n\r\n ];\r\n }", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "function getAllOptionsInfos()\n {\n return $this->options_infos;\n }", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function getOptions()\n {\n return [];\n }", "protected function get_options() {\n return array(\n 'class' => get_class($this),\n 'name' => $this->name,\n 'exclude' => $this->exclude,\n 'extrafields' => $this->extrafields,\n 'multiselect' => $this->multiselect\n );\n }", "protected function getOptions() : array\n {\n return [];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }", "protected function getOptions()\n {\n return [\n ];\n }" ]
[ "0.8245986", "0.76745015", "0.76711816", "0.76711816", "0.76711816", "0.76711816", "0.76711816", "0.76711816", "0.76711816", "0.7629477", "0.7600515", "0.7581234", "0.7560919", "0.7560919", "0.7560919", "0.7546201", "0.753984", "0.753984", "0.753984", "0.753984", "0.7534472", "0.7523939", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7517839", "0.7496492", "0.74946654", "0.74946654", "0.74946654", "0.74946654", "0.74946654", "0.74946654", "0.74946654", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.7492397", "0.74888045", "0.74638695", "0.74435693", "0.7443504", "0.7443504", "0.74216235", "0.74216235", "0.74216235", "0.74216235", "0.74216235", "0.74216235", "0.74216235", "0.74216235", "0.74216235", "0.73947173", "0.738475", "0.738475", "0.738475", "0.738475", "0.738475", "0.738475", "0.738475", "0.73573357", "0.73421615", "0.73421615", "0.7340277", "0.7335615", "0.7335615", "0.7335615", "0.7335615", "0.7335615", "0.7335615", "0.7335615", "0.7335615", "0.7335615", "0.73306763", "0.72836673", "0.7272904", "0.7272904", "0.7272904", "0.7272904", "0.7272904" ]
0.0
-1
returns array with all values from a given section
public function getSection($section) { $data=[]; foreach($this->settings AS $name=>$settingData) { if($section===$settingData['section']) { $data[$name]=$this->get($name); } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getData($section = null)\n {\n $config = Config::getInstance();\n\n if(!$section)\n return $config->data;\n else\n {\n $values = array();\n\n foreach($config->data as $key => $value)\n if(strtolower($section) == strtolower($key))\n $values[] = $value;\n\n return $values;\n }\n }", "public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }", "protected function getModuleArray($section) {\n $config = $this->getModuleConfig();\n $return = array();\n\n if ($data = $config->getSection($section)) {\n $fields = array_keys($data);\n \n for ($i=0; $i<count($data[$fields[0]]); $i++) {\n $item = array();\n foreach ($fields as $field) {\n $item[$field] = $data[$field][$i];\n }\n $return[] = $item;\n }\n } \n \n return $return;\n }", "public function getSectionFull($section) {\n $data=[];\n\n foreach($this->settings AS $name=>$settingData) {\n if($section===$settingData['section']) {\n $data[$name]=$this->getFull($name);\n }\n }\n\n return $data;\n }", "private function get_section_data() {\n\t\t$sections = apply_filters( 'toolset_get_troubleshooting_sections', array() );\n\t\t\n\t\tif( !is_array( $sections ) ) {\n\t\t\t$sections = array();\n\t\t}\n\t\t\n\t\treturn $sections;\n\t}", "public function get_section()\n\t\t{\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->find_all();\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}", "public function getSections(): array {\n\t\t\n\t\tif (isset($this->sections)) {\n\t\t\treturn $this->sections;\n\t\t}\n\t\t\n\t\t$this->sections = [];\n\t\t\n\t\t$sections = elgg_extract('sections', $this->config, []);\n\t\tforeach ($sections as $section) {\n\t\t\t$this->sections[] = new Section($section);\n\t\t}\n\t\t\n\t\treturn $this->sections;\n\t}", "public function getSections()\r\n {\r\n $sql=\"SELECT * FROM sections\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }", "public function GetKeys($section)\n {\n $result = [];\n $tmpArray = Util::GetAttribute($this->vars, $section, []);\n foreach ($tmpArray as $key => $value) {\n $newValue = $this->Get($section, $key, \"\");\n $result[ $key ] = $newValue;\n }\n return $result;\n }", "public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }", "public function get_sections() {\n\n $sections = [];\n\n foreach( $this->options as $key => $value ){\n\n if( isset($value['sections']) ) {\n foreach( $value['sections'] as $section ) {\n\n if( isset($section['fields']) ) {\n $sections[] = $section;\n }\n\n }\n }else {\n if( isset( $value['fields'] ) ) {\n $sections[] = $value;\n }\n }\n\n }\n\n return $sections;\n\n }", "public function getArticlesBySection(string $section): array {\n\t\t$selected = [];\n\t\t$q = $this->pdo->prepare(\"SELECT \".$this->columns.\" from `articles` WHERE `ArticleSection` LIKE :section\");\n\t\t$q->bindValue(\":section\", \"%\\\"\".$section.\"\\\"%\", PDO::PARAM_STR);\n\t\t$q->execute();\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t$sections = json_decode($a[\"ArticleSection\"], true);\n\t\t\tforeach($sections as $s){\n\t\t\t\t$article = $this->makeArticleFromDB($a);\n\t\t\t\tif(mb_strtolower($section) == mb_strtolower($s) && !in_array($article, $selected, true)){\n\t\t\t\t\t$selected[] = $article;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $selected;\n\t}", "public function get_all_sections() {\n\t\t$sql = \"SELECT section_id FROM peducator_sections \n\t\tWHERE peducator_id='$this->peducator_id'\";\n\t\t$result = mysqli_query($this->connect_to_db, $sql);\n\n\t\t$arr = [];\n\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\tarray_push($arr, get_section($row['section_id']));\n\t\t}\n\n\t\treturn $arr;\t\n\t}", "public function to_array() {\n\t\t$config = array();\n\t\t\n\t\tforeach( $this->sections as $id => $section ) {\n\t\t\t$config[$id] = $section->to_array();\n\t\t}\n\t\t\n\t\treturn $config;\n\t}", "function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}", "public function get_main_sections($section) {\n\t\t$query = $this->CI->db->select()->from('settings')\n\t\t\t->where([\n\t\t\t\t'section' => $section . '-main'\n\t\t\t])\n\t\t\t->order_by('order asc')\n\t\t\t->get();\n\n\t\t$result = [];\n\n\t\tforeach ($query->result() as $row) {\n\t\t\t$result[] = $row;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function GetRawKeys($section)\n {\n $result = [];\n $tmpArray = Util::GetAttribute($this->vars, $section, []);\n foreach ($tmpArray as $key => $value) {\n $newValue = $this->GetRaw($section, $key, \"\");\n $result[ $key ] = $newValue;\n }\n return $result;\n }", "public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}", "public function getSections(): iterable;", "function getSection($sectionID,$attr='VALUE') {\n \n // uppercase varAttr\n $attr = strtoupper($attr);\n \n if (($sectionID == '')&&(sizeof($this->varList)>1)) {\n // combine all sectionID's (pretend no sectionID's)\n $allID = array();\n\n // foreach sectionID...\n foreach ($this->varList as $secID=>$secVal) {\n\n // get the vars in this sectionID\n $varList = array_keys($secVal);\n\n // for each var in this section..\n foreach ($varList as $varKey) {\n\n if (isset($allID[$varKey])) {\n // add values\n $allID[$varKey] = array_merge((array)$allID[$varKey],(array)$this->getVarAttr($secID, $varKey, $attr));\n }\n else {\n // set value\n $allID[$varKey] = $this->getVarAttr($secID, $varKey, $attr);\n }\n }\n }\n return $allID;\n }\n else {\n\n // either specified sectionID or there was only one anyway\n\n // default sectionID\n if ($sectionID == '')\n $sectionID = 'default';\n\n // if it's there, gather all VALUE attributes from all VAR tags in this section\n if (isset($this->varList[$sectionID])) {\n foreach ($this->varList[$sectionID] as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $sectionArray[$varKey][] = $varObj->getAttr($attr);\n }\n }\n else {\n $sectionArray[$varKey] = $varTag->getAttr($attr);\n }\n }\n return $sectionArray;\n }\n else { \n // otherwise, not found.\n SM_debugLog(\"getSection ($this->sectionName): requested sectionID [$sectionID] wasn't found: ignoreing\",$this,1);\n return NULL;\n }\n }\n }", "public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }", "private function getSections() {\n\t\t$sections = array();\n\t\tforeach (Craft::$app->getSections()->getEditableSections() as $section) {\n\t\t\t$sections[$section->id] =['value'=>$section->handle, 'label' =>Craft::t('site',$section->name)];\n\t\t}\n\t\treturn $sections;\n\t}", "public function getSections(): array\n {\n return $this->sections;\n }", "public function GetSections()\n {\n return array_keys($this->vars);\n }", "function c_ini_data($filename,$process_sections=false)\r\n {\r\n\r\n if (file_exists($filename))\r\n {\r\n $output = parse_ini_file($filename,$process_sections);\r\n return (array) $output;\r\n }\r\n else\r\n {\r\n trigger_error($filename.' configuration file not found.');\r\n }\r\n\r\n }", "public function getDataStructure()\n\t{\n\t\t$sections = [];\n\t\tforeach($this->sections as $section) {\n\t\t\t$sections[] = [\n\t\t\t\t'name' => $section['name'],\n\t\t\t\t'blocks' => []\n\t\t\t];\n\t\t}\n\t\treturn $sections;\n\t}", "public function read($section);", "public function getSection($userId = null, $section = null) {\n\t\t$conditions = array(\n\t\t\t\"{$this->alias}.user_id\" => $userId);\n\n\t\tif (!is_null($section)) {\n\t\t\t$conditions[\"{$this->alias}.field LIKE\"] = $section . '.%'; \n\t\t}\n\n\t\t$results = $this->find('all', array(\n\t\t\t'recursive' => -1,\n\t\t\t'conditions' => $conditions,\n\t\t\t'fields' => array(\"{$this->alias}.field\", \"{$this->alias}.value\")));\n\n\t\tif (!empty($results)) {\n\t\t\tforeach($results as $result) {\n\t\t\t\tlist($prefix, $field) = explode('.', $result[$this->alias]['field']);\n\t\t\t\t$userDetails[$prefix][$field] = $result[$this->alias]['value'];\n\t\t\t}\n\t\t\t$results = $userDetails;\n\t\t} else {\n\t\t\t$this->createDefaults($userId);\n\t\t\t$results = array();\n\t\t}\n\t\treturn $results;\n\t}", "function get_trip_section_values($trip_section_id,$tbl){ \n\t\t$this->db->where('id',$trip_section_id);\n\t\t$qry=$this->db->get($tbl);\n\t\t\n\t\tif($qry->num_rows() > 0){\n\t\t\t$editable_values=$qry->row_array();\n\t\t\tif($tbl=='trip_accommodation' || $tbl=='package_accommodation'){ \n\t\t\t$this->db->select('hotel_category_id,destination_id');\n\t\t\t$this->db->where('id',$editable_values['hotel_id']);\n\t\t\t$this->db->from('hotels');\n\t\t\t$qry=$this->db->get()->row(); \n\t\t\t$editable_values['hotel_category_id']=$qry->hotel_category_id;\n\t\t\t$editable_values['destination_id']=$qry->destination_id;\n\t\t\t$editable_values['room_attributes']=unserialize($editable_values['room_attributes']);\n\t\t\t$editable_values['meals_package']=unserialize($editable_values['meals_package']);\n\t\t\t}\n\t\t\treturn $editable_values;\n\t\t}else{\n\t\t\treturn array();\n\t\t}\n\t}", "public function getSection() {\n try {\n $client = new SoapClient($this->SECTION_WSDL);\n $res = $client->findAllActiveSection();\n return $res;\n //print_r($res);\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }", "public function get($section){\n\t\t$body = $this->toArray();\n\t\treturn $body[$section];\n\t}", "public function getValues(): array;", "public function getValues(): array;", "static function get_section_info_all($modinfo) {\n global $DB;\n\n if (method_exists($modinfo, 'get_section_info_all')) {\n // Moodle >= 2.3\n return $modinfo->get_section_info_all();\n }\n\n // Moodle <= 2.2\n $info = array();\n $params = array('course' => $modinfo->get_course_id());\n if ($sections = $DB->get_records('course_sections', $params, 'section')) {\n foreach ($sections as $section) {\n $sectionnum = $section->section;\n $info[$sectionnum] = $section;\n }\n }\n return $info;\n }", "public function section_details(){\n\t\treturn array(\n\t\t\t'section_name'\t=> $this->section_name,\n\t\t\t'section_url'\t=> $this->section_url,\n\t\t\t'list_columns'\t=> $this->list_columns,\n\t\t\t'column_prefix'\t=> $this->model->db_column_prefix,\n\t\t\t'tabs'\t\t\t=> $this->tabs,\n\t\t\t'hide_tabs'\t\t=> $this->hide_tabs,\n\t\t\t'actions'\t\t=> misc::getActionsDropdowns(),\n\t\t\t'filters'\t\t=> misc::getFiltersDropdowns(),\n\t\t\t'per_page'\t\t=> misc::getPerPageDropdowns(),\n\t\t\t'id'\t\t\t=> $this->id,\n\t\t\t'item_name'\t\t=> $this->item_name,\n\t\t\t'active_tab'\t=> isset($_GET['active_tab']) ? $_GET['active_tab'] : ($this->session->get('active_tab') ? $this->session->get_once('active_tab') : $this->active_tab)\n\t\t);\n\t}", "public function getValues();", "public function getAllSections();", "private function separateData(array $section) {\n // retrieve references\n $references = $this->getReferencesFromIsolates($section['Isolates']);\n\n // loop through the references and retrieve the data by reference\n $section['SeparateIsolates'] = [];\n foreach ($references as $reference) {\n $section['SeparateIsolates'][$reference] = [\n 'Isolates' => $this->getIsolatesByReference($section['Isolates'], $reference),\n 'SubSections' => $this->getSubSectionsByReference($section['SubSections'], $reference),\n ];\n }\n\n return $section;\n }", "public function values() : array;", "public function dumpSectionElements()\n\t{\t\t\n /*\n * Changing this query in order to link the section elements with student report.\n */ \n $sql = \"select \n e.section_id as sectionId,\n e.id as elementId,\n s.title as sectionName,\n e.title as elementName,\n e.source_type as sourceType,\n e.factor_id as factorId,\n e.survey_question_id as surveyQuestionId\n from\n report_section_elements e\n join\n report_sections s ON (e.section_id = s.id)\n join\n reports r ON (r.id = s.report_id)\n where\n r.name = 'student-report'\n order by section_id , elementName\"; \n try {\n $em = $this->getEntityManager();\n $stmt = $em->getConnection()->executeQuery($sql); \n } catch (\\Exception $e) {\n throw new SynapseDatabaseException($e->getMessage() . \": \" . $e->getTraceAsString());\n } \n $results = $stmt->fetchAll();\n return $results;\n\t}", "private function parseEdgerc($edgerc, $section) {\r\n\t\t$parsed_array = array();\r\n\t\t$contents = file_get_contents($edgerc);\r\n\t\tpreg_match_all(\"/\\[([^\\]].*?)\\]\\s*([^\\[]*)/\", $contents, $matches);\r\n\t\tif (false !== array_search($section, $matches[1])) {\r\n\t\t\t$sectionkey = array_search($section, $matches[1]);\r\n\t\t\tpreg_match_all(\"/^\\s*(host|client_token|client_secret|access_token|max_body)\\s*[:=]\\s*([^\\s]*)\\s*$/m\", $matches[2][$sectionkey], $tokens);\r\n\t\t\tforeach ($tokens[1] as $tokenkey => $tokenvalue) {\r\n\t\t\t\t$parsed_array[$section][$tokenvalue] = $tokens[2][$tokenkey];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->error_array[] = \"Section: $section not found in $edgerc\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn $parsed_array;\r\n\t}", "public function read_sections_ids() {\n\n\t\t// Get course's sections id data from cache\n\t\t$ids = LP_Object_Cache::get( 'course-' . $this->course_id, 'learn-press/course-sections-ids' );\n\n\t\tif ( ! $ids ) {\n\t\t\tglobal $wpdb;\n\t\t\t// get sections id\n\t\t\t$ids = $wpdb->get_col( $wpdb->prepare( \"SELECT section_id FROM {$wpdb->prefix}learnpress_sections WHERE section_course_id = %d\", $this->course_id ) );\n\t\t\t// Set cache\n\t\t\tLP_Object_Cache::set( 'course-' . $this->course_id, $ids, 'learn-press/course-sections-ids' );\n\t\t}\n\n\t\treturn $ids;\n\t}", "public function listAllSections(): array {\n\t\t$sections = [];\n\t\t$q = $this->pdo->query(\"SELECT `ArticleSection` from `articles` GROUP BY `ArticleSection`\");\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t$section = json_decode($a[\"ArticleSection\"], true);\n\t\t\tforeach($section as $s){\n\t\t\t\t/* @var $s string */\n\t\t\t\tif(!in_array(mb_strtolower($s), $sections, true)){\n\t\t\t\t\t$sections[] = mb_strtolower($s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($sections);\n\t\treturn $sections;\n\t}", "public function GetRawAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetRawKeys($key);\n }\n return $result;\n }", "public function getSections(){\n\t\treturn $this->sections;\n\t}", "function infoarray()\n\t\t{\n\t\t$a = array();\n\t\tforeach(explode(\"\\n\", $this->me['info']) as $line)\n\t\t\t{\n\t\t\tpreg_match('/(^[^=]*) = (.*$)/', trim($line), $matches);\n\t\t\tif(count($matches) > 2)\n\t\t\t\t{\n\t\t\t\t$a[$matches[1]] = $matches[2];\n\t\t\t\t}\n\t\t\t}\n\t\treturn $a;\n\t\t}", "public static function getSectionArray($json){\n\t\t\t$decoded = json_decode($json, true);\n\t\t\t$decoded = $decoded['mobileview']['sections'];\n\t\t\t\n\t\t\treturn MWJsonDecoder::getArray($decoded, 'id');\n\t\t}", "public static function getConfigSection($sectionName)\n {\n $out = [];\n foreach (self::$config as $key => $config) {\n if (strpos($key, $sectionName . '.') === 0) {\n $out[$key] = $config;\n }\n }\n return $out;\n }", "public function getValues() {}", "public function getValues() {}", "protected function _getSectionsFields()\n {\n $arr = array(\n 'general' => array( // This is a section. See `getSectionId()` for how it gets transformed into an actual section name.\n 'label' => $this->__('General Settings'),\n 'header' => $this->__('General settings about imported posts.'),\n // If 'header' is present, it will be used. If it's a callable, its return value will be used.\n 'fields' => array( // An array of fields, by field code\n 'post_type' => array(\n 'label' => $this->__('Post Type'),\n 'type' => 'select',\n // Type can be one of the existing renderer types (select, checkbox, number, text), or make your own! See `_getFieldRenderers()`\n 'value' => $this->createCommand(array($this, 'getApiLoginOptions')),\n // If no value, it is automatically taken from the local data with the field's ID as key!\n // If value is present, it will be used. If it's a callable, its return value will be used.\n )\n ),\n ),\n );\n return $arr;\n }", "function tep_parse_section_path($sPath) {\r\n// make sure the section IDs are integers\r\n $sPath_array = array_map('tep_string_to_int', explode('_', $sPath));\r\n\r\n// make sure no duplicate section IDs exist which could lock the server in a loop\r\n $tmp_array = array();\r\n $n = sizeof($sPath_array);\r\n for ($i=0; $i<$n; $i++) {\r\n if (!in_array($sPath_array[$i], $tmp_array)) {\r\n $tmp_array[] = $sPath_array[$i];\r\n }\r\n }\r\n\r\n return $tmp_array;\r\n }", "function get_visit_data(Visit $visit, $section)\n {\n switch ($section) {\n case 'treatment':\n return get_treatments($visit);\n case 'investigation':\n return get_investigations($visit);\n case 'meta':\n return get_visit_meta($visit);\n case 'eye':\n return get_eye_exams($visit);\n case 'vital':\n return vitals_for_visit($visit);\n case 'op_notes':\n return get_op_notes($visit);\n }\n flash('Could not find subset data for ' . $section, 'warning');\n return null;\n }", "abstract public static function getValues(): array;", "public function getValues()\n {\n $values = [];\n foreach ($this->findScenario() as $name) {\n $values[$name] = $this->$name;\n }\n return $values;\n }", "function getDataArray( $contentObjectattribute )\n {\n $cv = eZContentObjectVersion::fetchVersion( $contentObjectattribute->attribute( 'version' ), $contentObjectattribute->attribute( 'contentobject_id' ) );\n $data_map = $cv->attribute( 'data_map' );\n \n $ini = eZINI::instance( 'content.ini' );\n $key_map = $ini->variable( 'GISSettings', 'attributes' );\n $keys = array_keys( $key_map );\n \n foreach ( $keys as $key )\n {\n if ( is_object( $data_map[$key] ) )\n $return[$key_map[$key]] = $data_map[$key]->content();\n }\n return $return;\n }", "public function get_section_items( $section_id ) {\n\t\t$course = learn_press_get_course( $this->course_id );\n\n\t\t$sections = $course->get_curriculum_raw();\n\n\t\t$return = array();\n\n\t\tif ( ! empty( $sections ) ) {\n\t\t\tforeach ( $sections as $section ) {\n\t\t\t\tif ( $section['id'] == $section_id ) {\n\t\t\t\t\tif ( isset( $section['items'] ) && is_array( $section['items'] ) ) {\n\t\t\t\t\t\t$return = $section['items'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tLP_Object_Cache::set( 'course-' . $this->course_id . '-' . $section_id, $return, 'learn-press/course-section-items' );\n\n\t\treturn $return;\n\t}", "public static function returnValidPublicSectionTypeArray(){\n $refl = new ReflectionClass('enum_SectionType');\n $myArray = $refl->getConstants();\n\n unset($myArray['All']);\n\n return $myArray;\n }", "private function retrieveSections() {\n\t\t$this->sections = array();\n\n\t\t$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\tself::TABLE_SECTIONS,\n\t\t\t'content_uid = ' . $this->getContentUid() .\n\t\t\t\ttx_oelib_db::enableFields(self::TABLE_SECTIONS),\n\t\t\t'',\n\t\t\t'sorting'\n\t\t);\n\t\tif (!$dbResult) {\n\t\t\tthrow new Exception(DATABASE_QUERY_ERROR);\n\t\t}\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {\n\t\t\t$GLOBALS['TSFE']->sys_page->versionOL(self::TABLE_SECTIONS, $row);\n\t\t\t$GLOBALS['TSFE']->sys_page->fixVersioningPid(\n\t\t\t\tself::TABLE_SECTIONS, $row\n\t\t\t);\n\t\t\tif ($GLOBALS['TSFE']->sys_language_content > 0) {\n\t\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(\n\t\t\t\t\tself::TABLE_SECTIONS,\n\t\t\t\t\t$row,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_content,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_contentOL\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->sections[] = $row;\n\t\t}\n\t}", "public function comment_sections()\n {\n /*\n if (count($this->comment_sections) > 0) {\n return $this->comment_sections;\n }\n else {\n $this->comment_sections = ($this->attr_raw != '') ? explode(\"\\n\",$this->attr_raw) : array();\n return $this->comment_sections;\n }\n */\n return ($this->attr_raw != '') ? explode(\"\\n\\n\",$this->attr_raw) : array();\n }", "public static function toArray(SiteSectionInterface $section): array {\n return [\n 'basePath' => $section->getBasePath(),\n 'contentLocale' => $section->getContentLocale(),\n 'sectionGroup' => $section->getSectionGroup(),\n 'sectionID' => $section->getSectionID(),\n 'name' => $section->getSectionName(),\n ];\n }", "public function getEventsForSection( $section ) {\n\t\t$events = [];\n\n\t\t$isDefault = ( $section === self::DEFAULT_SECTION );\n\n\t\tforeach ( $this->notifications as $event => $attribs ) {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\tisset( $attribs['section'] ) &&\n\t\t\t\t\t$attribs['section'] === $section\n\t\t\t\t) ||\n\t\t\t\t(\n\t\t\t\t\t$isDefault &&\n\t\t\t\t\t(\n\t\t\t\t\t\t!isset( $attribs['section'] ) ||\n\n\t\t\t\t\t\t// Invalid section\n\t\t\t\t\t\t!in_array( $attribs['section'], self::$sections )\n\t\t\t\t\t)\n\t\t\t\t)\n\n\t\t\t) {\n\t\t\t\t$events[] = $event;\n\t\t\t}\n\t\t}\n\n\t\treturn $events;\n\t}", "public function get_sections( $offset = 0, $limit = NULL )\n\t{\n\t\t$sections = get_option( NHS_SECTIONS, array() );\n\t\treturn array_slice( $sections, $offset, $limit );\n\t}", "function snax_admin_get_settings_fields_for_section( $section_id = '' ) {\n\n\t// Bail if section is empty.\n\tif ( empty( $section_id ) ) {\n\t\treturn false;\n\t}\n\n\t$fields = snax_admin_get_settings_fields();\n\t$retval = isset( $fields[ $section_id ] ) ? $fields[ $section_id ] : false;\n\n\treturn (array) apply_filters( 'snax_admin_get_settings_fields_for_section', $retval, $section_id );\n}", "private function get_registered_settings_sections() {\n\t\t\tglobal ${$this->func . '_sections'};\n\n\t\t\tif ( !empty( $sections ) ) {\n\t\t\t\treturn $sections;\n\t\t\t}\n\n\t\t\t$sections = apply_filters( $this->func . '_registered_settings_sections', array() );\n\n\t\t\treturn $sections;\n\t\t}", "abstract public function values(): array;", "public function get_settings_sections() {\n\t\t$sections = array(\n\t\t\tarray(\n\t\t\t\t'id' => 'test_1',\n\t\t\t\t'title' => __( 'Easy Setting Test', 'sharaz-settings' ),\n\t\t\t\t'desc' => 'section description',\n\t\t\t\t'page' => 'ss_page',\n\t\t\t\t'priority' => '10',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'test_2',\n\t\t\t\t'title' => __( 'Easy Setting Test2', 'sharaz_settings' ),\n\t\t\t\t'page' => 'ss_page1',\n\t\t\t\t'priority' => '15',\n\t\t\t),\n\n\t\t);\n\n\t\t// use to filter the section any point\n\t\t$setting_section = apply_filters( 'ss_section', $sections );\n\n\n\t\t// sort the array parity wise\n\n\t\tusort( $setting_section, array( $this, 'sort_array' ) );\n\n\n\t\treturn $sections;\n\t}", "public static function get_builder_sections() {\n\t\tglobal $post;\n\n\t\t$sections = array();\n\n\t\tif ($post) {\n\t\t\t$sections = get_post_meta($post->ID, '_mkb_page_sections', true);\n\n\t\t\tif (isset($sections) && !empty($sections)) {\n\t\t\t\t$sections = array_map(function($str) {\n\t\t\t\t\treturn stripslashes_deep(json_decode($str, true));\n\t\t\t\t}, $sections);\n\t\t\t}\n\t\t}\n\n\t\treturn $sections;\n\t}", "public function getValues()\n {\n // Load the config data\n $output = [];\n $configData = $this->getConfigFieldsList();\n\n // Update the array with database values\n foreach ($configData as $group => $fields) {\n $output[$group] = [];\n foreach ($fields as $key => $value) {\n $v = $this->value($group . '/' . $key);\n $output[$group][$key] = $this->toBooleanFilter($v);\n }\n }\n\n return $output;\n }", "public function toArray(){\n\t\treturn parse_ini_file($this->path, true);\n\t}", "public function values();", "public function values();", "public function values();", "public function values();", "public function values();", "function getSection($section='') {\r\n if(!empty($section)) {\r\n return $this->parsed_ini_file[$section];\r\n } else {\r\n return '';\r\n }\r\n }", "public function getSections()\n {\n return $this->sections;\n }", "function get_all_page_sections($obj = '')\n{\n\t$section_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_all_page_sections'));\n\t\n\treturn $section_result->result_array();\n}", "private function getVariablesForPart(string $documentPartXML): array\n {\n $matches = array();\n preg_match_all('/\\{\\{(.*?)\\}\\}/i', $documentPartXML, $matches);\n return $matches[1];\n }", "function getContent($section) {\n $this->loadContent();\n if(isset($this->content[$section])) return $this->content[$section];\n else return @$this->saved_content[$section];\n }", "protected function initSectionsInfo (& $pattern) {\n\t\t$result = [];\n\t\t$index = 0;\n\t\t$length = mb_strlen($pattern);\n\t\twhile ($index < $length) {\n\t\t\t$openPos = mb_strpos($pattern, '[', $index);\n\t\t\t$closePos = FALSE;\n\t\t\tif ($openPos !== FALSE)\n\t\t\t\t$closePos = mb_strpos($pattern, ']', $openPos);\n\t\t\tif ($closePos === FALSE) {\n\t\t\t\t$result[] = (object) [\n\t\t\t\t\t'fixed'\t=> TRUE,\t'start'\t\t=> $index,\n\t\t\t\t\t'end'\t=> $length,\t'length'\t=> $length - $index\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tif ($index < $openPos)\n\t\t\t\t\t$result[] = (object) [\n\t\t\t\t\t'fixed'\t=> TRUE,\t\t'start'\t\t=> $index,\n\t\t\t\t\t'end'\t=> $openPos,\t'length'\t=> $openPos - $index\n\t\t\t\t];\n\t\t\t\t$openPosPlusOne = $openPos + 1;\n\t\t\t\t$lengthLocal = $closePos - $openPosPlusOne;\n\t\t\t\t$pattern = mb_substr($pattern, 0, $openPos)\n\t\t\t\t\t. mb_substr($pattern, $openPosPlusOne, $lengthLocal)\n\t\t\t\t\t. mb_substr($pattern, $closePos + 1);\n\t\t\t\t$length -= 2;\n\t\t\t\t$closePos -= 1;\n\t\t\t\t$result[] = (object) [\n\t\t\t\t\t'fixed'\t=> FALSE,\t\t'start'\t\t=> $openPos,\n\t\t\t\t\t'end'\t=> $closePos,\t'length'\t=> $lengthLocal\n\t\t\t\t];\n\t\t\t}\n\t\t\t$index = $closePos;\n\t\t}\n\t\treturn $result;\n\t}", "public function getSectionsForChapter($chapter) {\n // Save progress\n $this->saveProgress($chapter, 0);\n\n $sections = array();\n\n // Get sections\n $id = 0;\n foreach(glob($this->elementsPath . $chapter . '/*', GLOB_ONLYDIR) as $dir) {\n $content = file_get_contents($dir . '/name.lmx');\n $sections[] = array(\n 'id' => $id,\n 'name' => ($id + 1) . ' - ' . str_replace(\"\\n\", '', $content),\n );\n\n $id++;\n }\n\n // Return sections\n return $sections;\n }", "public function getCachedSubsections(?NewsSection $section): array\n {\n $ids = [];\n if ($section !== null) {\n $ids = $this->cache->rememberForever(\n 'news_subsections',\n function () use ($section) {\n return [$section->id => $this->getSubsections($section, [$section->id])];\n }\n );\n\n if (empty($ids) || ! array_key_exists($section->id, $ids)) {\n try {\n $this->cache->delete('news_subsections');\n } catch (InvalidArgumentException) {\n }\n $ids = $this->cache->rememberForever(\n 'news_subsections',\n function () use ($section, $ids) {\n $ids[$section->id] = $this->getSubsections($section, [$section->id]);\n return $ids;\n }\n );\n }\n }\n\n return $ids[$section->id ?? 0] ?? [];\n }", "public function completedSections($module) {\n\t\t// list of completed sections by section ID\n\t\t// $secProg = SectionProgress::where('user_id', $this->id)->get();\n\t\t$secProg = SectionProgress::where('user_id', $this->id)->with('section')->get();\n\n\t\t$sections = array();\n\t\tforeach ($secProg as $completedSection) {\n\t\t\tif ($completedSection->section->module_id == $module) {\n\t\t\t\t// case: section has been correctly answered\n\t\t\t\t// if ($completedSection->correct == 1) {\n\t\t\t\t// \t$sections[$completedSection->section_id] = 1;\n\t\t\t\t// } else if ($completedSection->correct == 0) {\n\t\t\t\t// \t$sections[$completedSection->section_id] = 0;\n\t\t\t\t// }\n\n\t\t\t\tif($completedSection->status > 0) {\n\t\t\t\t\t$sections[$completedSection->section_id] = $completedSection->correct;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$sections[$completedSection->section_id] = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $sections;\n\t}", "public function getAllSectionsRefData()\n {\n if (empty($this->allSectionsRefData)) {\n $this->allSectionsRefData =\n $this->refDataService->fetchListOptions(\n 'submission_section'\n );\n }\n\n return $this->allSectionsRefData;\n }", "function mace_admin_get_settings_fields_for_section( $section_id = '' ) {\n\n\t// Bail if section is empty.\n\tif ( empty( $section_id ) ) {\n\t\treturn false;\n\t}\n\n\t$fields = mace_admin_get_settings_fields();\n\t$retval = isset( $fields[ $section_id ] ) ? $fields[ $section_id ] : false;\n\n\treturn (array) apply_filters( 'mace_admin_get_settings_fields_for_section', $retval, $section_id );\n}", "protected function loadFeedData() {\n $data = array();\n \n if ($feedConfigFile = $this->getConfig($this->configModule, 'feeds')) {\n $data = $feedConfigFile->getSectionVars();\n }\n return $data;\n }", "protected function getSectionIndexEntries(Element $element)\n\t{\n\t\t$result = array(\n\t\t\t1 => array( //Section binding\n\t\t\t\tarray(\"VALUE\" => 0, \"VALUE_NUM\" => 0.0)\n\t\t\t)\n\t\t);\n\n\t\tforeach ($this->getFilterProperty(Storage::DICTIONARY) as $propertyId)\n\t\t{\n\t\t\t$facetId = $this->storage->propertyIdToFacetId($propertyId);\n\t\t\t$result[$facetId] = array();\n\t\t\t$propertyValues = $element->getPropertyValues($propertyId);\n\t\t\tforeach ($propertyValues as $value)\n\t\t\t{\n\t\t\t\t$value = intval($value);\n\t\t\t\t$result[$facetId][$value] = array(\n\t\t\t\t\t\"VALUE\" => $value,\n\t\t\t\t\t\"VALUE_NUM\" => 0.0,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->getFilterProperty(Storage::STRING) as $propertyId)\n\t\t{\n\t\t\t$facetId = $this->storage->propertyIdToFacetId($propertyId);\n\t\t\t$result[$facetId] = array();\n\t\t\t$propertyValues = $element->getPropertyValues($propertyId);\n\t\t\tforeach ($propertyValues as $value)\n\t\t\t{\n\t\t\t\t$valueId = $this->dictionary->getStringId($value);\n\t\t\t\t$result[$facetId][$valueId] = array(\n\t\t\t\t\t\"VALUE\" => $valueId,\n\t\t\t\t\t\"VALUE_NUM\" => 0.0,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->getFilterProperty(Storage::NUMERIC) as $propertyId)\n\t\t{\n\t\t\t$facetId = $this->storage->propertyIdToFacetId($propertyId);\n\t\t\t$result[$facetId] = array();\n\t\t\t$propertyValues = $element->getPropertyValues($propertyId);\n\t\t\tforeach ($propertyValues as $value)\n\t\t\t{\n\t\t\t\t$value = doubleval($value);\n\t\t\t\t$result[$facetId][md5($value)] = array(\n\t\t\t\t\t\"VALUE\" => 0,\n\t\t\t\t\t\"VALUE_NUM\" => $value,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->getFilterProperty(Storage::DATETIME) as $propertyId)\n\t\t{\n\t\t\t$facetId = $this->storage->propertyIdToFacetId($propertyId);\n\t\t\t$result[$facetId] = array();\n\t\t\t$propertyValues = $element->getPropertyValues($propertyId);\n\t\t\tforeach ($propertyValues as $value)\n\t\t\t{\n\t\t\t\t//Save date only based on server time.\n\t\t\t\t$timestamp = MakeTimeStamp($value, \"YYYY-MM-DD HH:MI:SS\");\n\t\t\t\t$value = date('Y-m-d', $timestamp);\n\t\t\t\t$timestamp = MakeTimeStamp($value, \"YYYY-MM-DD\");\n\t\t\t\t$valueId = $this->dictionary->getStringId($value);\n\t\t\t\t$result[$facetId][$valueId] = array(\n\t\t\t\t\t\"VALUE\" => $valueId,\n\t\t\t\t\t\"VALUE_NUM\" => $timestamp,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->getFilterPrices() as $priceId)\n\t\t{\n\t\t\t$facetId = $this->storage->priceIdToFacetId($priceId);\n\t\t\t$result[$facetId] = array();\n\t\t\t$elementPrices = $element->getPriceValues($priceId);\n\t\t\tif ($elementPrices)\n\t\t\t{\n\t\t\t\tforeach ($elementPrices as $currency => $priceValues)\n\t\t\t\t{\n\t\t\t\t\t$currencyId = $this->dictionary->getStringId($currency);\n\t\t\t\t\tforeach ($priceValues as $price)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result[$facetId][$currencyId.\":\".$price] = array(\n\t\t\t\t\t\t\t\"VALUE\" => $currencyId,\n\t\t\t\t\t\t\t\"VALUE_NUM\" => $price,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn array_filter($result, \"count\");\n\t}", "function &getAllArray( )\n {\n $db =& eZDB::globalDatabase();\n $region_array = 0;\n $return_array = array();\n \n $db->array_query( $region_array, \"SELECT * FROM eZAddress_Region\n WHERE Removed=0\n ORDER BY Name\" );\n\t\t\t\t\t\t \n foreach ( $region_array as $region )\n {\n $return_array[] = array( \"ID\" => $region[ $db->fieldName( \"ID\" ) ],\n \"CountryID\" => $region[ $db->fieldName( \"CountryID\" ) ],\n \"Abbreviation\" => $region[ $db->fieldName( \"Abbreviation\" ) ],\n\t\t \"Name\" => $region[ $db->fieldName( \"Name\" ) ],\n\t\t\t\t \"HasTax\" => $region[ $db->fieldName( \"HasTax\" ) ],\n\t\t\t\t \"Removed\" => $region[ $db->fieldName( \"Removed\" ) ] );\n\n\n }\n return $return_array;\n }", "abstract public function getArray();", "public function getInformation(): array;", "public function getValues()\n {\n $values = array();\n\n foreach($this->elements as $key => $value)\n {\n if(mb_substr($key, -12) === 'confirmation') continue;\n\n $values[$key] = $value;\n }\n\n return $values;\n }", "public function ToArray()\n {\n $result = array();\n $option = $this->TopMost();\n while ($option)\n {\n $result[$option->GetValue()] = $option->GetText();\n $option = $this->NextOf($option);\n }\n return $result;\n \n }", "function course_sections($course) {\n global $DB;\n\n $sections = $DB->get_records('course_sections', array('course' => $course), 'section', 'id,section,name,sequence');\n foreach ($sections as $key => $section) {\n if ($section->sequence != '') {\n $sections[$key]->sequence = explode(',', $section->sequence);\n }\n else {\n $sections[$key]->sequence = null;\n }\n }\n\n return $sections;\n}", "private function sections()\n {\n $menu = [];\n\n foreach (config('menu') as $section) {\n if (!isset($section['name'])) {\n $menu = array_merge($menu, $section['menu']);\n } else if (Auth::user()->hasRole($section['name'])) {\n array_push($menu, ['section' => $section['name']]);\n $menu = array_merge($menu, $section['menu']);\n }\n }\n\n return $menu;\n }", "public function sections_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $course_id = $_GET['course_id'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->sections_get($course_id, $logged_in_user_details['user_id']);\n }else{\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }", "protected function getSettingArray()\n {\n return $this->container->get($this->getSettingKey());\n }", "public function getSections(){\n return $this->getSite()->getSections();\n }", "function getArray();", "public function getValues($offset)\n {\n }" ]
[ "0.69068193", "0.68180704", "0.6641202", "0.658758", "0.6574381", "0.6548997", "0.64513963", "0.6376657", "0.6373854", "0.63614976", "0.63369614", "0.6296561", "0.62773", "0.62386906", "0.6222597", "0.6219265", "0.62117183", "0.62105864", "0.618181", "0.61688817", "0.61688584", "0.61405104", "0.613825", "0.5985774", "0.5982826", "0.59642124", "0.5940617", "0.59401286", "0.5922427", "0.5874761", "0.5853268", "0.5849901", "0.5849901", "0.5848452", "0.5845206", "0.5833161", "0.58090657", "0.57981485", "0.57586825", "0.5727525", "0.5710131", "0.5692544", "0.56753623", "0.56709534", "0.56665933", "0.56637436", "0.56366223", "0.56282437", "0.56262344", "0.56262344", "0.56220835", "0.55773556", "0.5575024", "0.554454", "0.552978", "0.5523516", "0.5505424", "0.55029285", "0.5491017", "0.54903626", "0.5483314", "0.54611856", "0.54548395", "0.545153", "0.5441511", "0.5435617", "0.5434036", "0.5428153", "0.54269755", "0.5420132", "0.5415394", "0.5415394", "0.5415394", "0.5415394", "0.5415394", "0.54065883", "0.5399214", "0.53968143", "0.53935665", "0.538059", "0.5379959", "0.5373014", "0.5352645", "0.5350881", "0.5350215", "0.5347858", "0.53423136", "0.5339085", "0.5330143", "0.5317731", "0.5303088", "0.52988833", "0.52899146", "0.5285133", "0.5276166", "0.5251132", "0.5241025", "0.52409583", "0.52371734", "0.5231855" ]
0.7026429
0
returns array with all values with additional data from a given section
public function getSectionFull($section) { $data=[]; foreach($this->settings AS $name=>$settingData) { if($section===$settingData['section']) { $data[$name]=$this->getFull($name); } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSection($section) {\n $data=[];\n\n foreach($this->settings AS $name=>$settingData) {\n if($section===$settingData['section']) {\n $data[$name]=$this->get($name);\n }\n }\n\n return $data;\n }", "private function get_section_data() {\n\t\t$sections = apply_filters( 'toolset_get_troubleshooting_sections', array() );\n\t\t\n\t\tif( !is_array( $sections ) ) {\n\t\t\t$sections = array();\n\t\t}\n\t\t\n\t\treturn $sections;\n\t}", "private function separateData(array $section) {\n // retrieve references\n $references = $this->getReferencesFromIsolates($section['Isolates']);\n\n // loop through the references and retrieve the data by reference\n $section['SeparateIsolates'] = [];\n foreach ($references as $reference) {\n $section['SeparateIsolates'][$reference] = [\n 'Isolates' => $this->getIsolatesByReference($section['Isolates'], $reference),\n 'SubSections' => $this->getSubSectionsByReference($section['SubSections'], $reference),\n ];\n }\n\n return $section;\n }", "public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }", "public function get_section()\n\t\t{\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->find_all();\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}", "public function section_details(){\n\t\treturn array(\n\t\t\t'section_name'\t=> $this->section_name,\n\t\t\t'section_url'\t=> $this->section_url,\n\t\t\t'list_columns'\t=> $this->list_columns,\n\t\t\t'column_prefix'\t=> $this->model->db_column_prefix,\n\t\t\t'tabs'\t\t\t=> $this->tabs,\n\t\t\t'hide_tabs'\t\t=> $this->hide_tabs,\n\t\t\t'actions'\t\t=> misc::getActionsDropdowns(),\n\t\t\t'filters'\t\t=> misc::getFiltersDropdowns(),\n\t\t\t'per_page'\t\t=> misc::getPerPageDropdowns(),\n\t\t\t'id'\t\t\t=> $this->id,\n\t\t\t'item_name'\t\t=> $this->item_name,\n\t\t\t'active_tab'\t=> isset($_GET['active_tab']) ? $_GET['active_tab'] : ($this->session->get('active_tab') ? $this->session->get_once('active_tab') : $this->active_tab)\n\t\t);\n\t}", "public static function getData($section = null)\n {\n $config = Config::getInstance();\n\n if(!$section)\n return $config->data;\n else\n {\n $values = array();\n\n foreach($config->data as $key => $value)\n if(strtolower($section) == strtolower($key))\n $values[] = $value;\n\n return $values;\n }\n }", "protected function getModuleArray($section) {\n $config = $this->getModuleConfig();\n $return = array();\n\n if ($data = $config->getSection($section)) {\n $fields = array_keys($data);\n \n for ($i=0; $i<count($data[$fields[0]]); $i++) {\n $item = array();\n foreach ($fields as $field) {\n $item[$field] = $data[$field][$i];\n }\n $return[] = $item;\n }\n } \n \n return $return;\n }", "public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }", "function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}", "function dynamic_section( $sections ) {\n //$sections = array();\n $sections[] = array(\n 'title' => __( 'Section via hook', 'slova' ),\n 'desc' => __( '<p class=\"description\">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', 'slova' ),\n 'icon' => 'el-icon-paper-clip',\n // Leave this as a blank section, no options just some intro text set above.\n 'fields' => array()\n );\n\n return $sections;\n }", "function dynamic_section( $sections ) {\n //$sections = array();\n $sections[] = array(\n 'title' => __( 'Section via hook', 'redux-framework-demo' ),\n 'desc' => __( '<p class=\"description\">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', 'redux-framework-demo' ),\n 'icon' => 'el el-paper-clip',\n // Leave this as a blank section, no options just some intro text set above.\n 'fields' => array()\n );\n\n return $sections;\n }", "static function get_section_info_all($modinfo) {\n global $DB;\n\n if (method_exists($modinfo, 'get_section_info_all')) {\n // Moodle >= 2.3\n return $modinfo->get_section_info_all();\n }\n\n // Moodle <= 2.2\n $info = array();\n $params = array('course' => $modinfo->get_course_id());\n if ($sections = $DB->get_records('course_sections', $params, 'section')) {\n foreach ($sections as $section) {\n $sectionnum = $section->section;\n $info[$sectionnum] = $section;\n }\n }\n return $info;\n }", "function &getExtraFieldData() {\n\t\tif (!isset($this->extra_field_data)) {\n\t\t\t$this->extra_field_data = array();\n\t\t\t$res = db_query_params ('SELECT * FROM artifact_extra_field_data WHERE artifact_id=$1 ORDER BY extra_field_id',\n\t\t\t\t\t\tarray ($this->getID())) ;\n\t\t\t$ef = $this->ArtifactType->getExtraFields();\n\t\t\twhile ($arr = db_fetch_array($res)) {\n\t\t\t\t$type=$ef[$arr['extra_field_id']]['field_type'];\n\t\t\t\tif (($type == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($type==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {\n\t\t\t\t\t//accumulate a sub-array of values in cases where you may have multiple rows\n\t\t\t\t\tif (!array_key_exists($arr['extra_field_id'], $this->extra_field_data) || !is_array($this->extra_field_data[$arr['extra_field_id']])) {\n\t\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']][]=$arr['field_data'];\n\t\t\t\t} else {\n\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']] = $arr['field_data'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->extra_field_data;\n\t}", "public function get_sections() {\n\n $sections = [];\n\n foreach( $this->options as $key => $value ){\n\n if( isset($value['sections']) ) {\n foreach( $value['sections'] as $section ) {\n\n if( isset($section['fields']) ) {\n $sections[] = $section;\n }\n\n }\n }else {\n if( isset( $value['fields'] ) ) {\n $sections[] = $value;\n }\n }\n\n }\n\n return $sections;\n\n }", "function get_visit_data(Visit $visit, $section)\n {\n switch ($section) {\n case 'treatment':\n return get_treatments($visit);\n case 'investigation':\n return get_investigations($visit);\n case 'meta':\n return get_visit_meta($visit);\n case 'eye':\n return get_eye_exams($visit);\n case 'vital':\n return vitals_for_visit($visit);\n case 'op_notes':\n return get_op_notes($visit);\n }\n flash('Could not find subset data for ' . $section, 'warning');\n return null;\n }", "function get_trip_section_values($trip_section_id,$tbl){ \n\t\t$this->db->where('id',$trip_section_id);\n\t\t$qry=$this->db->get($tbl);\n\t\t\n\t\tif($qry->num_rows() > 0){\n\t\t\t$editable_values=$qry->row_array();\n\t\t\tif($tbl=='trip_accommodation' || $tbl=='package_accommodation'){ \n\t\t\t$this->db->select('hotel_category_id,destination_id');\n\t\t\t$this->db->where('id',$editable_values['hotel_id']);\n\t\t\t$this->db->from('hotels');\n\t\t\t$qry=$this->db->get()->row(); \n\t\t\t$editable_values['hotel_category_id']=$qry->hotel_category_id;\n\t\t\t$editable_values['destination_id']=$qry->destination_id;\n\t\t\t$editable_values['room_attributes']=unserialize($editable_values['room_attributes']);\n\t\t\t$editable_values['meals_package']=unserialize($editable_values['meals_package']);\n\t\t\t}\n\t\t\treturn $editable_values;\n\t\t}else{\n\t\t\treturn array();\n\t\t}\n\t}", "public function getSections(): array {\n\t\t\n\t\tif (isset($this->sections)) {\n\t\t\treturn $this->sections;\n\t\t}\n\t\t\n\t\t$this->sections = [];\n\t\t\n\t\t$sections = elgg_extract('sections', $this->config, []);\n\t\tforeach ($sections as $section) {\n\t\t\t$this->sections[] = new Section($section);\n\t\t}\n\t\t\n\t\treturn $this->sections;\n\t}", "private function getExtraArray() {\n\t\treturn $this->extraArray;\n\t}", "public function get_main_sections($section) {\n\t\t$query = $this->CI->db->select()->from('settings')\n\t\t\t->where([\n\t\t\t\t'section' => $section . '-main'\n\t\t\t])\n\t\t\t->order_by('order asc')\n\t\t\t->get();\n\n\t\t$result = [];\n\n\t\tforeach ($query->result() as $row) {\n\t\t\t$result[] = $row;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function get_additional_info()\n {\n return array();\n }", "public function get($section){\n\t\t$body = $this->toArray();\n\t\treturn $body[$section];\n\t}", "public function getDataStructure()\n\t{\n\t\t$sections = [];\n\t\tforeach($this->sections as $section) {\n\t\t\t$sections[] = [\n\t\t\t\t'name' => $section['name'],\n\t\t\t\t'blocks' => []\n\t\t\t];\n\t\t}\n\t\treturn $sections;\n\t}", "function getSection($sectionID,$attr='VALUE') {\n \n // uppercase varAttr\n $attr = strtoupper($attr);\n \n if (($sectionID == '')&&(sizeof($this->varList)>1)) {\n // combine all sectionID's (pretend no sectionID's)\n $allID = array();\n\n // foreach sectionID...\n foreach ($this->varList as $secID=>$secVal) {\n\n // get the vars in this sectionID\n $varList = array_keys($secVal);\n\n // for each var in this section..\n foreach ($varList as $varKey) {\n\n if (isset($allID[$varKey])) {\n // add values\n $allID[$varKey] = array_merge((array)$allID[$varKey],(array)$this->getVarAttr($secID, $varKey, $attr));\n }\n else {\n // set value\n $allID[$varKey] = $this->getVarAttr($secID, $varKey, $attr);\n }\n }\n }\n return $allID;\n }\n else {\n\n // either specified sectionID or there was only one anyway\n\n // default sectionID\n if ($sectionID == '')\n $sectionID = 'default';\n\n // if it's there, gather all VALUE attributes from all VAR tags in this section\n if (isset($this->varList[$sectionID])) {\n foreach ($this->varList[$sectionID] as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $sectionArray[$varKey][] = $varObj->getAttr($attr);\n }\n }\n else {\n $sectionArray[$varKey] = $varTag->getAttr($attr);\n }\n }\n return $sectionArray;\n }\n else { \n // otherwise, not found.\n SM_debugLog(\"getSection ($this->sectionName): requested sectionID [$sectionID] wasn't found: ignoreing\",$this,1);\n return NULL;\n }\n }\n }", "public function getAdditionalHeaderData() {}", "public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}", "public function fakeSectionData($sectionFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'name' => $fake->word,\n 'description' => $fake->word,\n 'url' => $fake->word,\n 'status' => $fake->word,\n 'created_at' => $fake->date('Y-m-d H:i:s'),\n 'updated_at' => $fake->date('Y-m-d H:i:s'),\n 'deleted_at' => $fake->date('Y-m-d H:i:s')\n ], $sectionFields);\n }", "protected function additionalData()\n {\n return [\n 'options' => $this->options\n ];\n }", "private function get_data( $part = '' ) {\n\n\t\t$basic = array(\n\t\t\t'id' => $this->id,\n\t\t\t'type' => $this->report_type,\n\t\t\t'recipient' => $this->recipient_id,\n\t\t);\n\t\t$fields = array_merge( $basic, (array) $this->comment, (array) $this->meta );\n\n\t\tif ( empty( $part ) )\n\t\t\treturn $fields;\n\t\telseif ( isset( $fields[ $part ] ) )\n\t\t\treturn $fields[ $part ];\n\t}", "public function read($section);", "public function getSection($userId = null, $section = null) {\n\t\t$conditions = array(\n\t\t\t\"{$this->alias}.user_id\" => $userId);\n\n\t\tif (!is_null($section)) {\n\t\t\t$conditions[\"{$this->alias}.field LIKE\"] = $section . '.%'; \n\t\t}\n\n\t\t$results = $this->find('all', array(\n\t\t\t'recursive' => -1,\n\t\t\t'conditions' => $conditions,\n\t\t\t'fields' => array(\"{$this->alias}.field\", \"{$this->alias}.value\")));\n\n\t\tif (!empty($results)) {\n\t\t\tforeach($results as $result) {\n\t\t\t\tlist($prefix, $field) = explode('.', $result[$this->alias]['field']);\n\t\t\t\t$userDetails[$prefix][$field] = $result[$this->alias]['value'];\n\t\t\t}\n\t\t\t$results = $userDetails;\n\t\t} else {\n\t\t\t$this->createDefaults($userId);\n\t\t\t$results = array();\n\t\t}\n\t\treturn $results;\n\t}", "public function getSectionDetails($section) {\r\n\t\tif ($section == 'Blood_glucose') {\r\n\t\t\t$title = \"Blood Glucose\";\r\n\t\t\t$text = \"Glucose circulates in our blood stream and signals the pancreas to secrete insulin. Insulin is the body's \\\"key\\\" to release glucose. Glucose that enters into our cells is used by your body to create energy. Sometimes, certain conditions, such as excess body fat inhibit insulin ability to absorb glucose, thus leaving excess amounts of glucose in the bloodstream. This test measures the concentration of glucose in your blood.\";\r\n\t\t\t$range = \"Non-Fasting Less than 130 mg/dl<br />Fasting Less than 100 mg/dl\";\r\n\t\t\t$type = $this->data['biometric_data']['glucose_test'];\r\n\t\t\t$score = $this->data['biometric_data']['blood_glucose'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($type == \"fasting\") {\r\n\t\t\t\tif ($score > 100) {\r\n\t\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t\t}\r\n\t\t\t\tif ($score > 125) {\r\n\t\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($type == \"non-fasting\") {\r\n\t\t\t\tif ($score > 130) {\r\n\t\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t\t}\r\n\t\t\t\tif ($score > 200) {\r\n\t\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$score = $score . \" mg/dl (\" . $type . \")\";\r\n\t\t}\r\n\r\n\t\telse if ($section == 'Waist_circumference') {\r\n\t\t\t$title = \"Waist Circumference\";\r\n\t\t\t$text = \"Waist Circumference and Body Mass Index (BMI) are interrelated; however waist circumference can provide an independent prediction of risk in addition to BMI. Body fat that accumulates around the stomach area poses a greater health risk than fat stored in the lower half of the body.\";\r\n\t\t\t$range = \"< 35 inches (female) | < 40 inches (male)\";\r\n\t\t\t$score = $this->data['biometric_data']['waist'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($this->demographics['gender'] == 'F') {\r\n\t\t\t\tif ($score >= 35.0) {\r\n\t\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($this->demographics['gender'] == 'M') {\r\n\t\t\t\tif ($score >= 40.0) {\r\n\t\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$score = $score . \" inches\";\t\t\t\r\n\t\t}\r\n\r\n\t\telse if ($section == \"Body_mass_index\") {\r\n\t\t\t$title = \"Body Mass Index\";\r\n\t\t\t$text = \"Body Mass Index uses a mathematical formula that takes into account both a personīs height and weight. BMI is a personīs weight in kilograms divided by height in meters squared (BMI=kg/m2). BMI correlates with, but does not equal body fat. The relation between body shape and BMI changes with age and gender. BMI is one of many factors related to developing a chronic disease (such as heart disease, cancer or diabetes). Other factors that may be important to consider when assessing your risk for chronic disease include diet, physical activity, waist circumference, blood pressure, blood sugar level, cholesterol level, and family history of disease.\";\r\n\t\t\t$range = \"18.5 - 24.9\";\r\n\t\t\t$score = $this->data['biometric_data']['bmi'];\r\n\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\tif ($score > 30) {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($score > 24.9) {\r\n\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($score >= 18.5) {\r\n\t\t\t\t$image = \"green_chips.png\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if ($section == \"Blood_pressure\") {\r\n\t\t\t$title = \"Blood Pressure\";\r\n\t\t\t$text = \"Blood Pressure is the pressure of the blood against the walls of the arteries. The top number, systolic pressure, the pressure in the arteries as the heart contracts to pump blood to the body. The bottom number, diastolic pressure, measures the pressure in the arterial walls between heart beats. High blood pressure makes your heart work harder than normal. Both the heart and arteries are then more prone to injury. High blood pressure increases the risk of heart attacks, strokes, and/or kidney failure.\";\r\n\t\t\t$range = \"Systolic: < 120 mm Hg | Diastolic: < 80 mm Hg\";\r\n\t\t\t$sys = $this->data['biometric_data']['bp_systolic'];\r\n\t\t\t$dia = $this->data['biometric_data']['bp_diastolic'];\r\n\t\t\tif ($sys > 140) {\r\n\t\t\t\t$sysScore = 1;\r\n\t\t\t}\r\n\t\t\telse if ($sys > 120) {\r\n\t\t\t\t$sysScore = 3;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$sysScore = 5;\r\n\t\t\t}\r\n\t\t\tif ($dia > 90) {\r\n\t\t\t\t$diaScore = 1;\r\n\t\t\t}\r\n\t\t\telse if($dia > 80) {\r\n\t\t\t\t$diaScore = 3;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$diaScore = 5;\r\n\t\t\t}\r\n\t\t\t$tot = (($sysScore + $diaScore) / 2.0) * 20.0;\r\n\t\t\tif ($tot >= 80) {\r\n\t\t\t\t$image = \"green_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($tot >= 50) {\r\n\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t\t$score = $sys . \" / \" . $dia . \" mm Hg\";\r\n\t\t}\r\n\r\n\t\telse if ($section == \"Cholesterol\") {\r\n\t\t\t$title = \"Total Cholesterol\";\r\n\t\t\t$text = \"Cholesterol is an essential fatty substance produced by the body used to create bile, hormones and fat soluble vitamins. Cholesterol is found in foods that come from animals such as meats, fish, poultry, eggs and dairy. High levels of circulating cholesterol may form deposits in artery walls leading to narrowing and hardening of the arteries and heart disease. Cholesterol does not dissolve in water and is combined with lipoproteins to assist in its transportation in the blood. Low-density lipoproteins (LDL), high-density lipoproteins (HDL), triglycerides, and other cholesterol levels such as VLDLS are all included in the total cholesterol value.\";\r\n\t\t\t$range = \"< 200 mg/dl\";\r\n\t\t\t$score = $this->data['biometric_data']['cholesterol'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($score > 239) {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($score > 199) {\r\n\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t}\r\n\t\t\t$score = $score . \" mg/dl\";\r\n\t\t}\r\n\r\n\t\telse if ($section == \"Hdl\") {\r\n\t\t\t$title = \"High-Density Lipoprotein (HDL) Cholesterol\";\r\n\t\t\t$text = \"HDL cholesterol is nicknamed \\\"good\\\" cholesterol because it removes excess cholesterol from the body and transports it to the liver where it is eliminated from the body. This, in turn, prevents LDL cholesterol accumulation in the arterial walls and can reduce the risk for heart disease. Higher levels of HDL cholesterol are optimal.\";\r\n\t\t\t$range = \"> 50 mg/dl (female) | 40 mg/dl (male)\";\r\n\t\t\t$score = $this->data['biometric_data']['hdl'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($score < 30) {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($scoe < 40) {\r\n\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t}\r\n\t\t\t$score = $score . \" mg/dl\";\r\n\t\t}\r\n\r\n\t\telse if ($section == \"Ldl\") {\r\n\t\t\t$title = \"Low Density Lipoprotein (LDL) Cholesterol\";\r\n\t\t\t$text = \"LDL cholesterol is nicknamed the \\\"bad\\\" cholesterol because in excess levels it can build plaque deposits on your arterial wall; a condition known as arteriolosclerosis. Low levels of LDL cholesterol are optimal.\";\r\n\t\t\t$range = \"< 100 mg/dl\";\r\n\t\t\t$score = $this->data['biometric_data']['ldl'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($score > 149) {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($score > 139) {\r\n\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t}\r\n\t\t\t$score = $score . \" mg/dl\";\r\n\t\t}\r\n\r\n\t\telse if ($section == \"Triglycerides\") {\r\n\t\t\t$title = \"Triglycerides\";\r\n\t\t\t$text = \"Triglycerides are composed of fatty acids and glycerol. Like cholesterol, it circulates in your blood, but is stored in body fat and is used when the body requires extra energy. Triglyceride levels are very sensitive and can be affected by food consumption before a screening. Optimally, triglyceride levels should be performed on a fasting individual.\";\r\n\t\t\t$range = \"< 150 mg/dl\";\r\n\t\t\t$score = $this->data['biometric_data']['triglycerides'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($score > 199) {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t\telse if ($score > 149) {\r\n\t\t\t\t$image = \"yellow_chips.png\";\r\n\t\t\t}\r\n\t\t\t$score = $score . \" mg/dl\";\r\n\t\t}\r\n\r\n\t\telse if ($section == \"TC_HDL_Ratio\") {\r\n\t\t\t$title = \"TC/HDL Cardiac Ratio\";\r\n\t\t\t$text = \"A ratio of total cholesterol divided by HDL cholesterol greater than 4.0 can indicate an increased risk of developing heart disease. A high ratio suggests there is a large amount of LDL cholesterol circulating in the blood that can stick to arterial walls and not enough HDL cholesterol to eliminate the excess.\";\r\n\t\t\t$range = \"< 4.0\";\r\n\t\t\t$score = $this->data['biometric_data']['cholesterol'] / $this->data['biometric_data']['hdl'];\r\n\t\t\t$image = \"green_chips.png\";\r\n\t\t\tif ($score >= 4.0) {\r\n\t\t\t\t$image = \"red_chips.png\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$info = array('title' => $title,\r\n\t\t\t 'text' => $text,\r\n\t\t\t 'image' => $image,\r\n\t\t\t 'score' => $score,\r\n\t\t 'range' => $range\r\n\t );\r\n\r\n\t\treturn $info;\r\n\t}", "protected function _getSectionsFields()\n {\n $arr = array(\n 'general' => array( // This is a section. See `getSectionId()` for how it gets transformed into an actual section name.\n 'label' => $this->__('General Settings'),\n 'header' => $this->__('General settings about imported posts.'),\n // If 'header' is present, it will be used. If it's a callable, its return value will be used.\n 'fields' => array( // An array of fields, by field code\n 'post_type' => array(\n 'label' => $this->__('Post Type'),\n 'type' => 'select',\n // Type can be one of the existing renderer types (select, checkbox, number, text), or make your own! See `_getFieldRenderers()`\n 'value' => $this->createCommand(array($this, 'getApiLoginOptions')),\n // If no value, it is automatically taken from the local data with the field's ID as key!\n // If value is present, it will be used. If it's a callable, its return value will be used.\n )\n ),\n ),\n );\n return $arr;\n }", "public function getExtra(){\n $_ARR = false;\n\n if(is_array($this->head)){\n foreach($this->head as $key => $val)\n if(substr_compare($key,'_',0,1,true) != 0)\n $_ARR[$key] = $val;\n\n }\n\n return $_ARR;\n }", "function getAdditionalValuesAsArray() {\n\t\t$values = parent::getAdditionalValuesAsArray ();\n\t\t$tables = array_keys ($this->owner);\n\t\t$values ['owner'] = Array ();\n\t\tforeach ($tables as $table) {\n\t\t\tforeach ($this->owner [$table] as $id) {\n\t\t\t\t$values ['owner'] [$table] [$id] = $id;\n\t\t\t}\n\t\t}\n\t\t$values ['headerstyle'] = $this->row ['headerstyle'];\n\t\t$values ['bodystyle'] = $this->row ['bodystyle'];\n\t\treturn $values;\n\t}", "public function getArticlesBySection(string $section): array {\n\t\t$selected = [];\n\t\t$q = $this->pdo->prepare(\"SELECT \".$this->columns.\" from `articles` WHERE `ArticleSection` LIKE :section\");\n\t\t$q->bindValue(\":section\", \"%\\\"\".$section.\"\\\"%\", PDO::PARAM_STR);\n\t\t$q->execute();\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t$sections = json_decode($a[\"ArticleSection\"], true);\n\t\t\tforeach($sections as $s){\n\t\t\t\t$article = $this->makeArticleFromDB($a);\n\t\t\t\tif(mb_strtolower($section) == mb_strtolower($s) && !in_array($article, $selected, true)){\n\t\t\t\t\t$selected[] = $article;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $selected;\n\t}", "public function prepareData() {\r\n $sections = GearSection::getAll($this->id_shop);\r\n $this->smarty->assign('sections', $sections);\r\n $data = array();\r\n foreach($sections as $section) {\r\n $opts = GearOption::getBySection($section->id, $this->id_shop);\r\n $std = new stdClass();\r\n $std->id = $section->id;\r\n $std->name = $section->name;\r\n $std->label = $section->label;\r\n $std->options = $opts;\r\n array_push($data, $std);\r\n }\r\n \r\n if ($this->imported) { // generate css after import\r\n require_once 'classes/FrontStyle.php';\r\n FrontStyle::generateGearCss($data);\r\n }\r\n \r\n return $data;\r\n }", "public function getAdditional();", "public function append($section){\n\t\t$body = $this->toArray();\n\t\t$_section = $this->get($section);\n\t\t$temp_body = [];\n\t\t$i = 0;\n\t\t$j = sizeof($body);\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($key != $section){\n\t\t\t\tif($i == ($j - 1)){\n\t\t\t\t\t$temp_body[$key] = $value;\n\t\t\t\t\t$temp_body[$section] = $_section;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_body[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t$this->updateFile($temp_body);\n\t}", "protected function getAllData() : array\n {\n if (method_exists($this, 'withOtherData'))\n {\n $this->otherData += $this->withOtherData();\n }\n\n return $this->otherData;\n }", "private function parseEdgerc($edgerc, $section) {\r\n\t\t$parsed_array = array();\r\n\t\t$contents = file_get_contents($edgerc);\r\n\t\tpreg_match_all(\"/\\[([^\\]].*?)\\]\\s*([^\\[]*)/\", $contents, $matches);\r\n\t\tif (false !== array_search($section, $matches[1])) {\r\n\t\t\t$sectionkey = array_search($section, $matches[1]);\r\n\t\t\tpreg_match_all(\"/^\\s*(host|client_token|client_secret|access_token|max_body)\\s*[:=]\\s*([^\\s]*)\\s*$/m\", $matches[2][$sectionkey], $tokens);\r\n\t\t\tforeach ($tokens[1] as $tokenkey => $tokenvalue) {\r\n\t\t\t\t$parsed_array[$section][$tokenvalue] = $tokens[2][$tokenkey];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->error_array[] = \"Section: $section not found in $edgerc\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn $parsed_array;\r\n\t}", "public function getSections(): iterable;", "abstract protected function getAdditionalJsonData(): array;", "function get_section_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_5821ee172a4d4',\n\t\t\t'label' => 'Rows',\n\t\t\t'name' => 'Rows_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821e254f6599',\n\t\t\t'label' => 'Rows of content',\n\t\t\t'name' => 'rows',\n\t\t\t'type' => 'flexible_content',\n\t\t\t'required' => 0,\n\t\t\t'button_label' => 'Add Row',\n\t\t\t'layouts' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => '5821e26955f33',\n\t\t\t\t\t'name' => 'row',\n\t\t\t\t\t'label' => 'Row',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_row_local_field( $id )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821d6ba5de39',\n\t\t\t'label' => 'Wrapper options',\n\t\t\t'name' => 'Wrapper_Options_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_1111e711149fe',\n\t\t\t'label' => 'Enable paddings for section?',\n\t\t\t'name' => 'paddings',\n\t\t\t'type' => 'checkbox',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'right' => 'Right',\n\t\t\t\t'top' => 'Top',\n\t\t\t\t'bottom' => 'Bottom',\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'left',\n\t\t\t\t1 => 'right',\n\t\t\t\t2 => 'top',\n\t\t\t\t3 => 'bottom'\n\t\t\t),\n\t\t\t'layout' => 'horizontal',\n\t\t\t'toggle' => 1,\n\t\t),\n\t\tarray (\n\t\t\t'key' => 'bgrd_582si7ez6imbg',\n\t\t\t'label' => 'Expande the section',\n\t\t\t'name' => 'expanded',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'nope' => 'No',\n\t\t\t\t'yep' => 'Yes',\n\t\t\t),\n\t\t\t'default_values' => array ( 'nope' ),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821d6ba6de39',\n\t\t\t'label' => 'Background',\n\t\t\t'name' => 'Background_Options_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821t6ba6ze48',\n\t\t\t'label' => 'Background',\n\t\t\t'name' => 'background',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'bgrd_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821da4aabd7c',\n\t\t\t'label' => 'Divider Options',\n\t\t\t'name' => 'Divider_Options_tab',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821da4aabd8r',\n\t\t\t'label' => 'Dividers',\n\t\t\t'name' => 'dividers',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'dibo_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a4d4',\n\t\t\t'label' => 'AJAX',\n\t\t\t'name' => 'Ajax_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a3d5',\n\t\t\t'label' => 'Type',\n\t\t\t'name' => 'ajax_type',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'choices' => array (\n\t\t\t\t'false' => 'No, thanks',\n\t\t\t\t'underneath' => 'Load underneath'\n\t\t\t),\n\t\t\t'default_values' => array (\n\t\t\t\t'false'\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a1d7',\n\t\t\t'name' => 'separator_1',\n\t\t\t'type' => 'message',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => 0,\n\t\t\t'message' => '<hr />',\n\t\t\t'new_lines' => '',\n\t\t\t'esc_html' => 0,\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a2d6',\n\t\t\t'label' => 'Loading button',\n\t\t\t'name' => 'ajax_button',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'choices' => array (\n\t\t\t\t'under-rows' => 'Button under rows',\n\t\t\t\t'in-context' => 'In context'\n\t\t\t),\n\t\t\t'default_values' => array (\n\t\t\t\t'under-rows'\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a0d8',\n\t\t\t'label' => 'Show more button label',\n\t\t\t'name' => 'ajax_label_show',\n\t\t\t'type' => 'text',\n\t\t\t'required' => '',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'under-rows'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t),\n\t\t\t'placeholder' => 'Show more'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a9c9',\n\t\t\t'label' => 'Hide button label',\n\t\t\t'name' => 'ajax_label_hide',\n\t\t\t'type' => 'text',\n\t\t\t'required' => '',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'under-rows'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t),\n\t\t\t'placeholder' => 'Show less'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a8c9',\n\t\t\t'label' => 'AJAX trigger',\n\t\t\t'name' => 'ajax_trigger',\n\t\t\t'type' => 'text',\n\t\t\t'required' => '',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '50'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'in-context'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'prepend' => 'ajax-trigger=',\n\t\t\t'placeholder' => 'example-trigger'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x1a1v7',\n\t\t\t'name' => 'separator_2',\n\t\t\t'type' => 'message',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => 0,\n\t\t\t'message' => '<hr />',\n\t\t\t'new_lines' => '',\n\t\t\t'esc_html' => 0,\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x1a0v8',\n\t\t\t'label' => 'Show at once',\n\t\t\t'name' => 'ajax_at_once',\n\t\t\t'type' => 'number',\n\t\t\t'required' => '',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'append' => 'row(s)',\n\t\t\t'default_value' => '1',\n\t\t\t'min' => '0'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x1a9v9',\n\t\t\t'label' => 'Showing steps',\n\t\t\t'name' => 'ajax_steps',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'choices' => array (\n\t\t\t\t'all' => 'All hidden rows',\n\t\t\t\t'one-by-one' => 'One by one'\n\t\t\t),\n\t\t\t'default_values' => array (\n\t\t\t\t'under-rows'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'under-rows'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t)\n\t\t),\n\t);\n}", "protected function create_section_data() {\n\t\t$this->enable();\n\t\t$this->post_types();\n\t\t$this->headings();\n\t\t$this->min_headings_num();\n\t\t$this->exclude_keywords();\n\t\t$this->title_to_id();\n\t\t$this->id_prefix();\n\t\t$this->in_widget();\n\t\t$this->customize_css();\n\t\t$this->shotcut();\n\t\t$this->fixed_menu_selector();\n\t\t$this->scroll_offset();\n\t}", "public function getSection() {\n try {\n $client = new SoapClient($this->SECTION_WSDL);\n $res = $client->findAllActiveSection();\n return $res;\n //print_r($res);\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }", "public function dumpSectionElements()\n\t{\t\t\n /*\n * Changing this query in order to link the section elements with student report.\n */ \n $sql = \"select \n e.section_id as sectionId,\n e.id as elementId,\n s.title as sectionName,\n e.title as elementName,\n e.source_type as sourceType,\n e.factor_id as factorId,\n e.survey_question_id as surveyQuestionId\n from\n report_section_elements e\n join\n report_sections s ON (e.section_id = s.id)\n join\n reports r ON (r.id = s.report_id)\n where\n r.name = 'student-report'\n order by section_id , elementName\"; \n try {\n $em = $this->getEntityManager();\n $stmt = $em->getConnection()->executeQuery($sql); \n } catch (\\Exception $e) {\n throw new SynapseDatabaseException($e->getMessage() . \": \" . $e->getTraceAsString());\n } \n $results = $stmt->fetchAll();\n return $results;\n\t}", "public function getSections(): array\n {\n return $this->sections;\n }", "function add_another_section($sections){\n\t\n\t//$sections = array();\n\t$sections[] = array(\n\t\t\t\t'title' => __('A Section added by hook', 'nhp-opts'),\n\t\t\t\t'desc' => __('<p class=\"description\">This is a section created by adding a filter to the sections array, great to allow child themes, to add/remove sections from the options.</p>', 'nhp-opts'),\n\t\t\t\t//all the glyphicons are included in the options folder, so you can hook into them, or link to your own custom ones.\n\t\t\t\t//You dont have to though, leave it blank for default.\n\t\t\t\t'icon' => trailingslashit(get_template_directory_uri()).'options/img/glyphicons/glyphicons_062_attach.png',\n\t\t\t\t//Lets leave this as a blank section, no options just some intro text set above.\n\t\t\t\t'fields' => array()\n\t\t\t\t);\n\t\n\treturn $sections;\n\t\n}", "public function getExtraPageData();", "public function extra(): array;", "public function getAdditionalInfosAt($offset)\n {\n return $this->get(self::ADDITIONALINFOS, $offset);\n }", "function getDataArray( $contentObjectattribute )\n {\n $cv = eZContentObjectVersion::fetchVersion( $contentObjectattribute->attribute( 'version' ), $contentObjectattribute->attribute( 'contentobject_id' ) );\n $data_map = $cv->attribute( 'data_map' );\n \n $ini = eZINI::instance( 'content.ini' );\n $key_map = $ini->variable( 'GISSettings', 'attributes' );\n $keys = array_keys( $key_map );\n \n foreach ( $keys as $key )\n {\n if ( is_object( $data_map[$key] ) )\n $return[$key_map[$key]] = $data_map[$key]->content();\n }\n return $return;\n }", "public function GetRawKeys($section)\n {\n $result = [];\n $tmpArray = Util::GetAttribute($this->vars, $section, []);\n foreach ($tmpArray as $key => $value) {\n $newValue = $this->GetRaw($section, $key, \"\");\n $result[ $key ] = $newValue;\n }\n return $result;\n }", "public function getExtraFields(int $storeId): array;", "function infoarray()\n\t\t{\n\t\t$a = array();\n\t\tforeach(explode(\"\\n\", $this->me['info']) as $line)\n\t\t\t{\n\t\t\tpreg_match('/(^[^=]*) = (.*$)/', trim($line), $matches);\n\t\t\tif(count($matches) > 2)\n\t\t\t\t{\n\t\t\t\t$a[$matches[1]] = $matches[2];\n\t\t\t\t}\n\t\t\t}\n\t\treturn $a;\n\t\t}", "public function generateExtraDataForSlice (Slice $slice) : array\n\t{\n\t\t$result = [];\n\n\t\t/** @var SliceExtraDataGeneratorInterface $dataGenerator */\n\t\tforeach ($this->sliceExtraDataGenerators as $dataGenerator)\n\t\t{\n\t\t\t$result = $dataGenerator->appendExtraData($slice, $result);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getSections()\r\n {\r\n $sql=\"SELECT * FROM sections\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }", "private function getSections() {\n\t\t$sections = array();\n\t\tforeach (Craft::$app->getSections()->getEditableSections() as $section) {\n\t\t\t$sections[$section->id] =['value'=>$section->handle, 'label' =>Craft::t('site',$section->name)];\n\t\t}\n\t\treturn $sections;\n\t}", "public function to_array() {\n\t\t$config = array();\n\t\t\n\t\tforeach( $this->sections as $id => $section ) {\n\t\t\t$config[$id] = $section->to_array();\n\t\t}\n\t\t\n\t\treturn $config;\n\t}", "public function GetKeys($section)\n {\n $result = [];\n $tmpArray = Util::GetAttribute($this->vars, $section, []);\n foreach ($tmpArray as $key => $value) {\n $newValue = $this->Get($section, $key, \"\");\n $result[ $key ] = $newValue;\n }\n return $result;\n }", "function add_another_section($sections){\r\n\t\r\n\t$sections = array();\r\n\t$sections[] = array(\r\n\t\t\t\t'title' => __('A Section added by hook', 'SimpleKey'),\r\n\t\t\t\t'desc' => __('<p class=\"description\">This is a section created by adding a filter to the sections array, great to allow child themes, to add/remove sections from the options.</p>', 'SimpleKey'),\r\n\t\t\t\t//all the glyphicons are included in the options folder, so you can hook into them, or link to your own custom ones.\r\n\t\t\t\t//You dont have to though, leave it blank for default.\r\n\t\t\t\t'icon' => trailingslashit(get_template_directory_uri()).'options/img/glyphicons/glyphicons_062_attach.png',\r\n\t\t\t\t//Lets leave this as a blank section, no options just some intro text set above.\r\n\t\t\t\t'fields' => array()\r\n\t\t\t\t);\r\n\t\r\n\treturn $sections;\r\n\t\r\n}", "function sage_get_sections($field_name = 'sections') {\n\n if (!$field_name) return;\n\n $field_data = sage_get_field( $field_name );\n\n // check if the flexible content field exists\n if( !$field_data ) return;\n\n // loop through the rows of data\n $content = array();\n $i = 0;\n\n foreach ( $field_data as $field ) {\n\n $field['field_name'] = $field_name;\n\n // collect layout content\n $content[] = sage_get_row_content($field);\n\n }\n\n return implode('', $content);\n\n}", "public function getAdditionalDetail($items) {\n\n $tmp_array = array();\n\n if (!empty($items)) {\n foreach ($items as $item) {\n $tmp_array[] = $this->getItemAdditionDetails($item);\n }\n }\n //print_r($tmp_array); exit;\n return $tmp_array;\n }", "private function get_additional_entry_item( $addon_meta_data ) {\n\n\t\tif ( ! isset( $addon_meta_data['value'] ) || ! is_array( $addon_meta_data['value'] ) ) {\n\t\t\treturn array();\n\t\t}\n\t\t$status = $addon_meta_data['value'];\n\t\t$additional_entry_item = array(\n\t\t\t'label' => __( 'Google Sheets Integration', Forminator::DOMAIN ),\n\t\t\t'value' => '',\n\t\t);\n\n\n\t\t$sub_entries = array();\n\t\tif ( isset( $status['connection_name'] ) ) {\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Integration Name', Forminator::DOMAIN ),\n\t\t\t\t'value' => $status['connection_name'],\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $status['is_sent'] ) ) {\n\t\t\t$is_sent = true === $status['is_sent'] ? __( 'Yes', Forminator::DOMAIN ) : __( 'No', Forminator::DOMAIN );\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Sent To Google Sheets', Forminator::DOMAIN ),\n\t\t\t\t'value' => $is_sent,\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $status['description'] ) ) {\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Info', Forminator::DOMAIN ),\n\t\t\t\t'value' => $status['description'],\n\t\t\t);\n\t\t}\n\n\t\t$additional_entry_item['sub_entries'] = $sub_entries;\n\n\t\t// return single array\n\t\treturn $additional_entry_item;\n\t}", "public function comment_sections()\n {\n /*\n if (count($this->comment_sections) > 0) {\n return $this->comment_sections;\n }\n else {\n $this->comment_sections = ($this->attr_raw != '') ? explode(\"\\n\",$this->attr_raw) : array();\n return $this->comment_sections;\n }\n */\n return ($this->attr_raw != '') ? explode(\"\\n\\n\",$this->attr_raw) : array();\n }", "public function get_all_sections() {\n\t\t$sql = \"SELECT section_id FROM peducator_sections \n\t\tWHERE peducator_id='$this->peducator_id'\";\n\t\t$result = mysqli_query($this->connect_to_db, $sql);\n\n\t\t$arr = [];\n\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\tarray_push($arr, get_section($row['section_id']));\n\t\t}\n\n\t\treturn $arr;\t\n\t}", "public function getData($getSectionName=null, $getSectionKey=null)\n\t{\n\t\t// Data to return\n\t\t$returnData = array();\n\t\t\n\t\t// Want specific field (need sectionName and sectionKey)\n\t\tif (isset($getSectionName) and isset($getSectionKey)) {\n\t\t\t// Section data\n\t\t\t$sectionData = $this->_data[$getSectionName];\n\t\t\t\n\t\t\t// Return value dependent on if section data array or not\n\t\t\tif (count($sectionData) > 1) {\n\t\t\t\tforeach ($sectionData as $key => $subSectionData)\n\t\t\t\t\t$returnData[$key][$getSectionKey] = $subSectionData[$getSectionKey];\n\t\t\t} else {\n\t\t\t\t$returnData = $sectionData[0][$getSectionKey];\n\t\t\t}\t\t\t\n\t\t}\n\t\telseif (isset($getSectionName)) {\n\t\t\t// Get section dataset\n\t\t\t$sectionDataset = $this->_data[$getSectionName];\n\t\t\t// Get section data\n\t\t\t$sectionData = (count($sectionDataset) > 1) ? $sectionDataset : $sectionDataset[0] ;\n\t\t\t\n\t\t\t$returnData = $sectionData;\n\t\t}\n\t\t// Return everything\n\t\telse {\n\t\t\tforeach ($this->_data as $sectionName => $sectionDataset) {\t\t\t\t\n\t\t\t\t// Get section data\n\t\t\t\t$sectionData = (count($sectionDataset) > 1) ? $sectionDataset : $sectionDataset[0] ;\n\t\t\t\t\n\t\t\t\t// Check if just empty array\n\t\t\t\tif ($sectionData == array())\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\t// Assign data depending on if interpret as array or not\n\t\t\t\tif ($sectionName == 'default' or $this->_formAsArray === false)\n\t\t\t\t\t$returnData = array_merge($returnData, $sectionData);\n\t\t\t\telse\n\t\t\t\t\t$returnData[$sectionName] = $sectionData;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\treturn $returnData;\n\t}", "public function getAdditionalFields() {\n\t\t\n\t\t$fields = array();\n\t\t\n\t\tif ($this->installed()) {\n\t\t\t$ro_settings = $this->config->get('related_options');\n\t\t\t$std_fields = array('sku', 'upc', 'ean', 'location');\n\t\t\tforeach ($std_fields as $field) {\n\t\t\t\tif ( isset($ro_settings['spec_'.$field]) && $ro_settings['spec_'.$field] ) {\n\t\t\t\t\t$fields[] = $field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields;\n\t}", "public function get_meta() : array\n {\n return $this->additional['meta'] ?? [];\n }", "protected function loadFeedData() {\n $data = array();\n \n if ($feedConfigFile = $this->getConfig($this->configModule, 'feeds')) {\n $data = $feedConfigFile->getSectionVars();\n }\n return $data;\n }", "function wpex_portfolio_single_meta_sections() {\n\n\t// Default sections\n\t$sections = array( 'date', 'author', 'categories', 'comments' );\n\n\t// Apply filters for easy modification\n\t$sections = apply_filters( 'wpex_portfolio_single_meta_sections', $sections );\n\n\t// Turn into array if string\n\tif ( $sections && ! is_array( $sections ) ) {\n\t\t$sections = explode( ',', $sections );\n\t}\n\n\t// Return sections\n\treturn $sections;\n\n}", "function print_additional_settings_section_info() {\n }", "public function generateFullSectionData($zone = 'create')\n\t{\n\t\t$page_data = array();\n\n\t\tif ($zone == 'create') {\n\t\t\t$page_data[] = array(\n\t\t\t\t'id' => 'person_name',\n\t\t\t\t'field_type' => 'person_name'\n\t\t\t);\n\t\t\t$page_data[] = array(\n\t\t\t\t'id' => 'person_email',\n\t\t\t\t'field_type' => 'person_email'\n\t\t\t);\n\t\t}\n\n\t\t$page_data[] = array(\n\t\t\t'id' => 'chat_department',\n\t\t\t'field_type' => 'chat_department'\n\t\t);\n\n\t\t// Custom fields\n\t\t$fields = App::getSystemService('chat_fields_manager')->getFields();\n\t\tforeach ($fields as $f) {\n\t\t\t$page_data[] = array(\n\t\t\t\t'id' => 'chat_field['.$f->getId().']',\n\t\t\t\t'field_type' => 'chat_field',\n\t\t\t\t'field_id' => $f->getId()\n\t\t\t);\n\t\t}\n\n\t\treturn $page_data;\n\t}", "function c_ini_data($filename,$process_sections=false)\r\n {\r\n\r\n if (file_exists($filename))\r\n {\r\n $output = parse_ini_file($filename,$process_sections);\r\n return (array) $output;\r\n }\r\n else\r\n {\r\n trigger_error($filename.' configuration file not found.');\r\n }\r\n\r\n }", "public function getInformation(): array;", "public function additional(array $data);", "private function retrieveSections() {\n\t\t$this->sections = array();\n\n\t\t$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\tself::TABLE_SECTIONS,\n\t\t\t'content_uid = ' . $this->getContentUid() .\n\t\t\t\ttx_oelib_db::enableFields(self::TABLE_SECTIONS),\n\t\t\t'',\n\t\t\t'sorting'\n\t\t);\n\t\tif (!$dbResult) {\n\t\t\tthrow new Exception(DATABASE_QUERY_ERROR);\n\t\t}\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {\n\t\t\t$GLOBALS['TSFE']->sys_page->versionOL(self::TABLE_SECTIONS, $row);\n\t\t\t$GLOBALS['TSFE']->sys_page->fixVersioningPid(\n\t\t\t\tself::TABLE_SECTIONS, $row\n\t\t\t);\n\t\t\tif ($GLOBALS['TSFE']->sys_language_content > 0) {\n\t\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(\n\t\t\t\t\tself::TABLE_SECTIONS,\n\t\t\t\t\t$row,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_content,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_contentOL\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->sections[] = $row;\n\t\t}\n\t}", "function snax_admin_get_settings_fields_for_section( $section_id = '' ) {\n\n\t// Bail if section is empty.\n\tif ( empty( $section_id ) ) {\n\t\treturn false;\n\t}\n\n\t$fields = snax_admin_get_settings_fields();\n\t$retval = isset( $fields[ $section_id ] ) ? $fields[ $section_id ] : false;\n\n\treturn (array) apply_filters( 'snax_admin_get_settings_fields_for_section', $retval, $section_id );\n}", "public function getAllSections();", "public static function get_config($section) {\n global $CFG, $SITE;\n\n // Get the standard mobile settings.\n $settings = \\tool_mobile\\api::get_config($section);\n\n // Add custom settings.\n $settings->tool_mobilecgs_disabledblocks = get_config('tool_mobilecgs', 'disabledblocks');\n $settings->tool_mobilecgs_hidepastcourses = get_config('tool_mobilecgs', 'hidepastcourses');\n\n return $settings;\n }", "function mace_admin_get_settings_fields_for_section( $section_id = '' ) {\n\n\t// Bail if section is empty.\n\tif ( empty( $section_id ) ) {\n\t\treturn false;\n\t}\n\n\t$fields = mace_admin_get_settings_fields();\n\t$retval = isset( $fields[ $section_id ] ) ? $fields[ $section_id ] : false;\n\n\treturn (array) apply_filters( 'mace_admin_get_settings_fields_for_section', $retval, $section_id );\n}", "function get_additional_fields($product_id)\n {\n $additional_fields = $this->crud_model->get_type_name_by_id('product', $product_id, 'additional_fields');\n $ab = json_decode($additional_fields);\n foreach ($ab as $i => $row) {\n\n if ($i == 'name') {\n $name = json_decode($row);\n }\n\n if ($i == 'value') {\n $value = json_decode($row);\n }\n\n }\n if ($name == false || $value == false) {\n return array();\n }\n foreach ($name as $n => $row) {\n $final[] = array(\n 'name' => $row,\n 'value' => $value[$n]\n );\n }\n\n return $final;\n }", "public function getAllSectionsRefData()\n {\n if (empty($this->allSectionsRefData)) {\n $this->allSectionsRefData =\n $this->refDataService->fetchListOptions(\n 'submission_section'\n );\n }\n\n return $this->allSectionsRefData;\n }", "public function getNext($section){\n\t\t$body = $this->toArray();\n\t\tif(!$this->hasNext($section)){\n\t\t\treturn false;\n\t\t}\n\t\t$index = $this->sectionIndex($section);\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($i == ($index + 1)){\n\t\t\t\treturn array($key => $body[$key]);\n\t\t\t}\n\t\t\t$i++;\n\t\t} return false;\n\t}", "public function getExtraData();", "function getInfo ()\n\t{\n\t\t$node = $this->getElementsByTagname(\"MetaData\");\n\n\t\tif($node !== false)\n\t\t{\n\t\t\t$childs = $node[0]->child_nodes();\n\n\t\t\tforeach ($childs as $child)\n\t\t\t{\n\t\t\t\t\tif (($child->node_type() == XML_ELEMENT_NODE) && ($child->tagname == \"General\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t$childs2 = $child->child_nodes();\n\n\t\t\t\t\t\tforeach ($childs2 as $child2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($child2->node_type() == XML_ELEMENT_NODE) && ($child2->tagname == \"Title\" || $child2->tagname == \"Description\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$arr[$child2->tagname] = $child2->get_content();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// General-tag was found. Stop foreach-loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// for compatibility reasons:\n\t\t$arr[\"title\"] = $arr[\"Title\"];\n\t\t$arr[\"desc\"] = $arr[\"Description\"];\n\n\t\treturn $arr;\n\t}", "public static function getConfigSection($sectionName)\n {\n $out = [];\n foreach (self::$config as $key => $config) {\n if (strpos($key, $sectionName . '.') === 0) {\n $out[$key] = $config;\n }\n }\n return $out;\n }", "public function getSections(){\n\t\treturn $this->sections;\n\t}", "public function getEventsForSection( $section ) {\n\t\t$events = [];\n\n\t\t$isDefault = ( $section === self::DEFAULT_SECTION );\n\n\t\tforeach ( $this->notifications as $event => $attribs ) {\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\tisset( $attribs['section'] ) &&\n\t\t\t\t\t$attribs['section'] === $section\n\t\t\t\t) ||\n\t\t\t\t(\n\t\t\t\t\t$isDefault &&\n\t\t\t\t\t(\n\t\t\t\t\t\t!isset( $attribs['section'] ) ||\n\n\t\t\t\t\t\t// Invalid section\n\t\t\t\t\t\t!in_array( $attribs['section'], self::$sections )\n\t\t\t\t\t)\n\t\t\t\t)\n\n\t\t\t) {\n\t\t\t\t$events[] = $event;\n\t\t\t}\n\t\t}\n\n\t\treturn $events;\n\t}", "public static function toArray(SiteSectionInterface $section): array {\n return [\n 'basePath' => $section->getBasePath(),\n 'contentLocale' => $section->getContentLocale(),\n 'sectionGroup' => $section->getSectionGroup(),\n 'sectionID' => $section->getSectionID(),\n 'name' => $section->getSectionName(),\n ];\n }", "private function getDetails()\n {\n $details = array();\n $num_fields_added = 0;\n $num_fields_deleted = 0;\n $num_fields_modified = 0;\n $total_fields_before = sizeof($this->furthest_metadata);\n $total_fields_after = sizeof($this->latest_metadata);\n\n foreach($this->metadata_changes as $field => $metadata)\n {\n $new_metadata = $this->latest_metadata[$field];\n $old_metadata = $this->furthest_metadata[$field];\n\n // Check for fields added.\n if (!$old_metadata)\n {\n $num_fields_added++;\n }\n // Check for deleted fields.\n else if (!$new_metadata)\n {\n $num_fields_deleted++;\n }\n // Check for fields modified.\n else\n {\n $differences = array_diff_assoc($new_metadata, $old_metadata);\n if (!empty($differences))\n {\n $num_fields_modified++;\n }\n }\n }\n \n return array(\n \"num_fields_added\" => $num_fields_added,\n \"num_fields_deleted\" => $num_fields_deleted,\n \"num_fields_modified\" => $num_fields_modified,\n \"total_fields_before\" => $total_fields_before,\n \"total_fields_after\" => $total_fields_after\n );\n }", "private function getData($params = null){\n //for now we append the params to some static test data\n return [ 'meta-data' => $params,\n 'data' => [\n 'Buffalo',\n 'Rochester',\n 'Syracuse',\n 'Capital',\n 'Arizona',\n ]\n ];\n }", "function tep_parse_section_path($sPath) {\r\n// make sure the section IDs are integers\r\n $sPath_array = array_map('tep_string_to_int', explode('_', $sPath));\r\n\r\n// make sure no duplicate section IDs exist which could lock the server in a loop\r\n $tmp_array = array();\r\n $n = sizeof($sPath_array);\r\n for ($i=0; $i<$n; $i++) {\r\n if (!in_array($sPath_array[$i], $tmp_array)) {\r\n $tmp_array[] = $sPath_array[$i];\r\n }\r\n }\r\n\r\n return $tmp_array;\r\n }", "public static function getSectionArray($json){\n\t\t\t$decoded = json_decode($json, true);\n\t\t\t$decoded = $decoded['mobileview']['sections'];\n\t\t\t\n\t\t\treturn MWJsonDecoder::getArray($decoded, 'id');\n\t\t}", "public function as_array(){\n return isset($this->data[$this->alias])? $this->data[$this->alias] : $this->data;\n }", "public function getAdditionalInformation()\n {\n return [\n 'isReturnable' => true,\n 'isRepairable' => true,\n 'isTransportable' => true,\n 'isSerializable' => true,\n 'isOnSiteInterventionPossible' => true,\n 'isCumbersome' => true,\n ];\n }", "public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }", "private function getDocBlockData(DocBlock $docBlock): array\n {\n $data = [];\n foreach ($docBlock->getTags() as $tag) {\n if ((int) preg_match('/^return-([1-9][0-9]{2})$/', $tag->getName(), $matches) > 0) {\n $parts = $this->addDefaultParts($tag);\n $data[$matches[1]] = $this->merger->merge(\n $data[$matches[1]] ?? [],\n [\n 'description' => '',\n 'content' => [\n $parts[0] => [\n 'schema' => json_decode($parts[1] ?? '{}') ?: new stdClass()\n ]\n ]\n ]\n );\n }\n }\n return $data;\n }", "public function extract()\n {\n $this->__jsonize();\n $extractions = [];\n foreach ($this->options as $key => $arrays) {\n if (is_array($arrays)) {\n $extractions[$key] = [];\n foreach ($arrays as $array) {\n $result = $this->__arrayGet($array);\n if (!is_null($result)) {\n $extractions[$key][] = $result;\n }\n unset($result);\n }\n } else {\n $result = $this->__arrayGet($arrays);\n if (!is_null($result)) {\n $extractions[$key][] = $result;\n }\n unset($result);\n }\n }\n return $extractions;\n }" ]
[ "0.6589263", "0.6559182", "0.64308864", "0.6360188", "0.6348156", "0.62410045", "0.62030965", "0.6126719", "0.6024277", "0.59985507", "0.5922746", "0.5912897", "0.5759158", "0.57543546", "0.5721159", "0.57016665", "0.5696629", "0.56945145", "0.56469655", "0.5641058", "0.5630611", "0.5626867", "0.5615307", "0.5589249", "0.55868566", "0.5572854", "0.5570604", "0.5559303", "0.5552259", "0.5533562", "0.55283", "0.55249184", "0.552181", "0.55164576", "0.55106866", "0.5508575", "0.55067027", "0.550657", "0.5503253", "0.5502566", "0.5496552", "0.5450482", "0.5446561", "0.5427593", "0.5427145", "0.54208803", "0.541058", "0.540998", "0.54011637", "0.5394567", "0.5387851", "0.53682965", "0.5361973", "0.5356444", "0.53510076", "0.5343985", "0.5338594", "0.53329563", "0.5307291", "0.5302481", "0.5298566", "0.5296503", "0.52767324", "0.5271512", "0.5235612", "0.5227033", "0.52224195", "0.52216125", "0.52112126", "0.5210712", "0.5206001", "0.52019745", "0.51996666", "0.51977336", "0.5196872", "0.519141", "0.5189851", "0.5187082", "0.51830727", "0.5174605", "0.5155176", "0.5131648", "0.5123816", "0.51228076", "0.51173216", "0.51109564", "0.51081413", "0.5107778", "0.5107749", "0.510313", "0.510238", "0.50974756", "0.509046", "0.50833553", "0.5080378", "0.5075291", "0.50749505", "0.5066807", "0.5062783", "0.5057831" ]
0.61609966
7
fetches all options to cache
public function fetchAll() { $settings=$this->em->getRepository('CreavoOptionBundle:Setting')->findAll(); /** @var Setting $setting */ foreach($settings AS $setting) { $this->addToCache($setting); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheOptions();", "public function cacheOptions ()\n {\n\n foreach ( $this->optionsToPersist as $option ) {\n\n $this->optionsCache[ $option ] = $this->getOption ( $option );\n\n }\n\n }", "public \tfunction\tretrieveOptions() {\n\t\t\t//For each option category.\n\t\t\tforeach($this -> options as $category => $k) {\n\t\t\t\t//For each option. \n\t\t\t\tforeach ($this -> options[$category] as $key => $value) {\n\t\t\t\t\t//Set the option. \n\t\t\t\t\t$this -> options[$category][$key]\t\t=\tget_option($key);\n\t\t\t\t\t\n\t\t\t\t\t//If the option is serialized.\n\t\t\t\t\tif (is_serialized($this -> options[$category][$key])) {\n\t\t\t\t\t\t//Unserialize the option.\n\t\t\t\t\t\t$this -> options[$category][$key]\t=\t \n\t\t\t\t\t\tunserialize($this -> options[$category][$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function apc_cache_shunt_all_options($false) {\n\tglobal $ydb; \n\t\n\t$key = APC_CACHE_ALL_OPTIONS; \n\tif(apc_exists($key)) {\n\t\t$ydb->option = apc_fetch($key);\n\t\t$ydb->installed = apc_fetch(APC_CACHE_YOURLS_INSTALLED);\n\t\treturn true;\n\t} \n\t\n\treturn false;\n}", "public function doRetrieveAll(){\n\t\t\t$this->openConnection();\n\t\t\t$options=null;\n\n\t\t\t$query=\"SELECT flagList\n\t\t\t\t\tFROM options\";\n\t\t\t$result = $this->connessione->query($query);\n\t\t \n\t\t\twhile($row = $result->fetch_array(MYSQLI_ASSOC))\n\t\t\t{ \n\t\t\t\t\t$options=new ListOption();\n\t\t\t\t\t$options->setFlagList($row[\"flagList\"]);\n\t\t\t}\n\t\n\t\t\t$result->close();\n\t\t\t$this->closeConnection();\n\t\n\t\t\treturn $options;\n\t\t}", "private function get_caches () {\n $caches_slug = 'cache';\n return $this->get_option($caches_slug, array());\n }", "protected function readUserOptions() {\n\t\t// add cache resource\n\t\t$cacheName = 'user-option-'.PACKAGE_ID;\n\t\tWCF::getCache()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', WCF_DIR.'lib/system/cache/CacheBuilderOption.class.php');\n\t\t\n\t\t// get options\n\t\t$this->options = WCF::getCache()->get($cacheName, 'options');\n\t}", "public function getAll($cache = true) {}", "protected function get_options()\n\t{}", "public function getAll()\n {\n return $this->options;\n }", "public function options_load();", "public function cache($options = true);", "function getOptions() ;", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "public function all() {\n\t\t$this->delete_all_plugin_options();\n\t\t$this->delete_all_user_metas();\n\t\t$this->delete_all_transients();\n\n\t\t// Clear options cache.\n\t\twp_cache_delete( 'alloptions', 'options' );\n\t}", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function all()\n\t{\n\t\treturn $this->options;\n\t}", "static function cached_all(){\n return static::get_cache();\n }", "private function getAllOptions() {\n return $this->config[$this->context];\n }", "public static function allCache() \n\t{\n\t return Cache::rememberforever('settings', function()\n\t {\n\t return Setting::all();\n\t });\n\t}", "function wp_load_alloptions($force_cache = \\false)\n {\n }", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function get_options()\n {\n }", "abstract public function getOptions();", "public function setCacheOptions($options);", "public function cacheAll()\n {\n $data = $this->resource->get()->wait();\n\n $this->client->pipeline(function ($pipe) use ($data) {\n foreach ( $data->result->result as $k => $v ) {\n $pipe->set($this->keyPrefix . $v->id, serialize($v));\n }\n });\n\n return;\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function findAllOptions();", "private function load_options()\n\t\t{\n\t\t\t$options = NULL;\n\n\t\t\t// load from persistent store\n\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t// reading from database\n\t\t\t\t$options = get_option( $this->option_name, $this->defaults );\n\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t// reading from filesystem\n\t\t\t\tif ( file_exists( $this->filename ) ) {\n\t\t\t\t\t$data = file_get_contents( $this->filename );\n\t\t\t\t\t$options = json_decode( $data, TRUE );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: add capability to store in DS specific table\n\n\t\t\t// this ensures we have *something*, even if it's an empty array\n\t\t\tif ( NULL === $options )\n\t\t\t\t$options = $this->defaults;\n\n\t\t\t$this->_options = array_merge( $this->defaults, $options );\n\t\t}", "public function get_all(){\n $cache_data_list=[];\n if($this->driver=='file'){\n foreach ($cache_list=$this->file->file_walk($this->path) as $value){\n $cache_data_list[]=$this->file->read_file($value);\n }\n }\n if($this->driver==\"redis\"){\n foreach ($this->redis->hGetAll($this->path) as $key=>$value){\n $cache_data_list[]=$value;\n }\n }\n return $cache_data_list;\n }", "public function options(Request $request)\n {\n return Cache::remember(\n 'all_shows',\n '1000',\n fn() => Show::orderBy('start_date')->get()->pluck('id', 'name')->toArray(),\n );\n }", "public function getCache();", "private function getOptions()\n {\n $options = array();\n\n if ($this->proxyCacheDirectory) {\n $this->ensureDirectoryExists($this->proxyCacheDirectory);\n\n $options['proxy.path'] = $this->proxyCacheDirectory;\n }\n\n if ($this->annotationCacheDirectory) {\n $this->ensureDirectoryExists($this->annotationCacheDirectory);\n\n $options['annotation.path'] = $this->annotationCacheDirectory;\n }\n\n return $options;\n }", "protected function cache()\n {\n // Cache location items\n $this->locations->get(); // All\n $this->locations->menu(); // Menu\n $this->locations->mapItems(); // Map\n $this->locations->featured(); // Featured\n\n // Cache properties\n $this->properties->cacheAll(); // All\n $this->properties->specials();\n }", "public function load_options() {\n\t\treturn $this->get_config();\n\t}", "function getOptions();", "private function gather_plugin_options() {\n $options = array();\n foreach ( $this->OPTIONS as $value ) {\n $options[ $value ] = get_option( $value );\n }\n return array( '_wp_super_cache_options' => $options );\n }", "protected static abstract function getOptions();", "protected function cacheOptions(string $key): array\n {\n $options = $this->option($this->cacheOptionsKey($key), false);\n\n if ($options === false) {\n return [\n 'active' => false\n ];\n }\n\n $prefix = str_replace(['/', ':'], '_', $this->system()->indexUrl()) .\n '/' .\n str_replace('.', '/', $key);\n\n $defaults = [\n 'active' => true,\n 'type' => 'file',\n 'extension' => 'cache',\n 'root' => $this->root('cache'),\n 'prefix' => $prefix\n ];\n\n if ($options === true) {\n return $defaults;\n } else {\n return array_merge($defaults, $options);\n }\n }", "public function getOptions()\n\t{\n\t\t$options = get_option($this->optionVar);\n\t\tif($options) {\n\t\t\t$this->options = unserialize($options);\n\t\t} else {\n\t\t\t$this->options = [];\n\t\t}\n\t}", "protected function get_registered_options()\n {\n }", "protected function autoloadOptions()\n {\n $loadedOpts = 0;\n\n // We'll autoload only once\n if ($this->autoloaded) {\n return $loadedOpts;\n }\n\n $sql = $this->select(['option_name', 'option_value'])->where('option_autoload', '=', 1);\n $stmt = $sql->execute();\n\n foreach ($stmt->fetchAll() as $option) {\n $name = $option['option_name'];\n $value = $option['option_value'];\n $this->options[$name] = $value;\n $loadedOpts++;\n }\n\n return $loadedOpts;\n }", "function get_options() {\t\t\r\n\t\t$saved_options = unserialize(get_option(THEME_ID . '_options'));\r\n\t\tif (!empty($saved_options) && is_object($saved_options)) {\r\n\t\t\tforeach($saved_options as $name => $value) {\r\n\t\t\t\t$this->$name = $value;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public function load_options() {\n\t\t$this->disable_hash = get_option( 'health-check-disable-plugin-hash', null );\n\t\t$this->allowed_plugins = get_option( 'health-check-allowed-plugins', array() );\n\t\t$this->default_theme = ( 'yes' === get_option( 'health-check-default-theme', 'yes' ) ? true : false );\n\t\t$this->active_plugins = $this->get_unfiltered_plugin_list();\n\t\t$this->current_theme = get_option( 'health-check-current-theme', false );\n\t}", "public function load_settings()\r\n\t{\r\n\t\tif (!$this->_use_cache || !($this->_settings = $this->cache->get('settings')))\r\n\t\t{\r\n\t\t\t// Get settings from database\r\n\t\t\t$this->db->select('setting,value');\r\n\t\t\t$query = $this->db->get('settings');\r\n\r\n\t\t\tforeach ($query->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$this->_settings[$row->setting] = $row->value;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if we want to cache the results\r\n\t\t\tif ($this->_use_cache)\r\n\t\t\t{\r\n\t\t\t\t$this->cache->save('settings', $this->_settings, $this->_cache_ttl);\r\n\t\t\t\t$this->_repopulated_cache = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getOptionsExternally()\n\t{\n\t\t$this->loadExternally = 1;\n\n\t\treturn $this->getOptions();\n\t}", "public function getOptions()\r\n {\r\n }", "public function getAllOptions()\n {\n $department = $this->_departmentFactory->create();\n $departmentItems = $department->getCollection();\n $this->_loadedData = array();\n \n foreach($departmentItems as $item) {\n\t\t\tarray_push($this->_loadedData,$item->getData());\n\t\t}\n\n return $this->_loadedData;\n // echo '<pre>';\n // print_r($this->_loadedData);\n // die;\n }", "private function setOptsFromGET(){\n\n $this->_opt['save'] = 0;\n\n $this->_opt['show_reps'] = 1;\n\n /* Replace default Options with GET params */\n\n foreach($_GET as $key=>$value){\n\n $this->_opt[$key] = $value;\n }\n\n \n\n }", "function all_settings( $key ) {\n \n $CI = & get_instance();\n $cache_key = get_cache_id().'user_info';\n $cache_data = get_cache_data( $cache_key );\n \n if( $cache_data ) {\n $all_settings = $cache_data;\n \n }else{\n \n $CI->load->model('users_model');\n $user_information = $CI->users_model->get_user_information_by_id( get_user_id() );\n \n set_cache_data( $cache_key ,$user_information);\n \n $all_settings = $user_information;\n }\n \n \n if( $key ){\n return (isset($all_settings[$key]))?$all_settings[$key]:\"\";\n }\n \n return $all_settings;\n}", "public function fetchSettings()\n {\n return $this->store->fetch();\n }", "abstract protected function _manageFetchOptions($select, $options);", "public function get_options() {\n\n if( $this->args['database'] === 'transient' ) {\n $this->options = get_transient( $this->unique );\n } else if( $this->args['database'] === 'theme_mod' ) {\n $this->options = get_theme_mod( $this->unique );\n } else if( $this->args['database'] === 'network' ) {\n $this->options = get_site_option( $this->unique );\n } else {\n $this->options = get_option( $this->unique );\n }\n\n if( empty( $this->options ) ) {\n $this->options = array();\n }\n\n return $this->options;\n\n }", "protected function getOptions()\n {\n return array(\n 'default_ttl' => 15 * 60,\n 'private_headers' => array('Authorization', 'Cookie'),\n 'allow_reload' => true,\n 'allow_revalidate' => true,\n 'stale_while_revalidate' => 2,\n 'stale_if_error' => 3600,\n );\n }", "private function getAll($args = array())\n {\n global $wpdb;\n\n $defaults = array(\n 'offset' => 0,\n 'number' => 30,\n 'search' => ''\n );\n\n $args = wp_parse_args($args, $defaults);\n $cache_key = md5(serialize($args));\n $transients = wp_cache_get($cache_key);\n\n if (false === $transients) {\n\n $sql = \"SELECT * FROM $wpdb->options WHERE option_name LIKE '%\\_transient\\_%' AND option_name NOT LIKE '%\\_transient\\_timeout%'\";\n\n if (!empty($args['search'])) {\n\n $search = esc_sql($args['search']);\n $sql .= \" AND option_name LIKE '%{$search}%'\";\n }\n\n $offset = absint($args['offset']);\n $number = absint($args['number']);\n $sql .= \" ORDER BY option_id DESC LIMIT $offset,$number;\";\n\n $transients = $wpdb->get_results($sql);\n\n wp_cache_set($cache_key, $transients, '', 3600);\n }\n\n return $transients;\n }", "public function fetchAllOptionsProvider()\n {\n $modelsData = array(\n array(\n 'id' => 'prj1',\n 'name' => 'project a',\n 'members' => array('foo', 'bar'),\n ),\n array(\n 'id' => 'prj2',\n 'name' => 'project b',\n 'members' => array('foo', 'baz', 'xyz'),\n ),\n array(\n 'id' => 'prj3',\n 'name' => 'project x',\n 'members' => array('bar', 'xyz', 'abc'),\n ),\n array(\n 'id' => 'prj4',\n 'name' => 'project y',\n 'members' => array('abc', 'bar', 'baz'),\n ),\n array(\n 'id' => 'prj5',\n 'name' => 'project c',\n 'members' => array('foo', 'xyz', 'abc'),\n ),\n array(\n 'id' => 'prj6',\n 'name' => 'project q',\n 'members' => array('foo'),\n 'deleted' => true\n ),\n array(\n 'id' => 'prj7',\n 'name' => 'project w',\n 'members' => array('abc'),\n 'deleted' => true\n )\n );\n\n return array(\n array(\n $modelsData,\n array(),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('ids' => null),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array()),\n array(),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj2', 'prj5', 'prj1')),\n array('prj1', 'prj2', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj2', 'prj5', 'prj1'), 'noCache' => true),\n array('prj1', 'prj2', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('member' => 'foo'),\n array('prj1', 'prj2', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('noCache' => true),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5'),\n null\n ),\n array(\n $modelsData,\n array('includeDeleted' => true),\n array('prj1', 'prj2', 'prj3', 'prj4', 'prj5', 'prj6', 'prj7'),\n null\n ),\n array(\n $modelsData,\n array('member' => 'foo', 'includeDeleted' => true),\n array('prj1', 'prj2', 'prj5', 'prj6'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj1', 'prj6', 'prj7')),\n array('prj1'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj1', 'prj6', 'prj7'), 'includeDeleted' => true),\n array('prj1', 'prj6', 'prj7'),\n null\n ),\n array(\n $modelsData,\n array('ids' => array('prj-noexist'), 'includeDeleted' => true),\n array(),\n null\n ),\n array(\n $modelsData,\n array('search' => '123=ABC'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: search.\"\n )\n ),\n array(\n $modelsData,\n array('keywords' => 'foo bar baz'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: keywords.\"\n )\n ),\n array(\n $modelsData,\n array('maximum' => 3),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: maximum.\"\n )\n ),\n array(\n $modelsData,\n array('totalCount' => true),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: totalCount.\"\n )\n ),\n array(\n $modelsData,\n array('after' => 'prj1', 'ids' => array('prj3', 'prj5')),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: after.\"\n )\n ),\n array(\n $modelsData,\n array('totalCount' => true, 'ids' => array('prj1', 'prj2'), 'after' => 'prj1'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: totalCount, after.\"\n )\n ),\n array(\n $modelsData,\n array('member' => 'foo', 'flagMember' => 'bar'),\n null,\n array(\n 'InvalidArgumentException',\n \"Following option(s) are not valid for fetching projects: flagMember.\"\n )\n ),\n );\n }", "public static function getCache() {}", "public function getAll()\n\t{\n\t\tif (!class_exists('JCacheStorageHelper', false))\n\t\t{\n\t\t\tinclude_once JPATH_PLATFORM . '/joomla/cache/storage/helper.php';\n\t\t}\n\t\treturn;\n\t}", "public function _cache_refresh_all()\n {\n }", "function Atv_getRepoKegiatanAll(): object\n{\n return Cache::remember('repo-kegiatan-all', (60 * 60 * 2/* 2 hours */), function () {\n return Kegiatan::all()->map->kegiatanResourceMap();\n });\n}", "protected function getOptionSets() {\n return $this->getOptionSetsManager()->getOptions();\n }", "public static function loadDefaults() {\n if(!extension_loaded(\"apcu\")) Status::message(Status::ERROR, \"Please install/enable APCu\");\n // Get session states into cache if not cached\n if(!apcu_exists('StateCollection')) {\n $collection_to_load = [];\n if(DatabaseManager::fetchInto(\"main\", $collection_to_load, \"SELECT * FROM session_states\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of States\");\n // Load to cache\n apcu_store('StateCollection', $collection_to_load);\n }\n\n // Load available return statuses\n if(!apcu_exists('StatusCollection')) {\n $temp_statuses = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_statuses, \"SELECT * FROM statuses\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of Statuses\");\n apcu_store('StatusCollection', $temp_statuses);\n }\n\n // Load Data sources to cache\n if(!apcu_exists('DataSources')) {\n $temp_sources = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_sources, \"SELECT * FROM data_sources\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of data sources\");\n apcu_store('DataSources', $temp_sources);\n }\n\n // Load Data entries to cache\n if(!apcu_exists('DataEntries')) {\n $temp_entries = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_entries, \"SELECT * FROM data_entries\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of data entries\");\n apcu_store('DataEntries', $temp_entries);\n }\n\n // Load Data source types to cache\n if(!apcu_exists('DataSourceTypes')) {\n $temp_source_types = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_source_types, \"SELECT * FROM data_source_types\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of data source types\");\n apcu_store('DataSourceTypes', $temp_source_types);\n }\n\n // Load Data entry types to cache\n if(!apcu_exists('DataEntryTypes')) {\n $temp_entry_types = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_entry_types, \"SELECT * FROM data_entry_types\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of data entry types\");\n apcu_store('DataEntryTypes', $temp_entry_types);\n }\n\n // Load Connection types to cache\n if(!apcu_exists('ConnectionTypes')) {\n $temp_connection_types = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_connection_types, \"SELECT * FROM connection_types\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of connection types\");\n apcu_store('ConnectionTypes', $temp_connection_types);\n }\n\n // Load Connection node types to cache\n if(!apcu_exists('ConnectionNodeTypes')) {\n $temp_connection_node_types = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_connection_node_types, \"SELECT * FROM connection_node_types\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of connection node types\");\n apcu_store('ConnectionNodeTypes', $temp_connection_node_types);\n }\n\n // Load Items to cache\n if(!apcu_exists('Items')) {\n $temp_items = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_items, \"SELECT * FROM items\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of Items\");\n apcu_store('Items', $temp_items);\n }\n \n // Load Relations to cache\n if(!apcu_exists('Relations')) {\n $temp_relations = [];\n if(DatabaseManager::fetchInto(\"main\", $temp_relations, \"SELECT * FROM relations\", [], 'id') === false)\n Status::message(Status::ERROR, \"Couldn't retrieve collection of Relations\");\n apcu_store('Relations', $temp_relations);\n }\n }", "public function cacheGet() {\n }", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM learnable_language_options';\r\n\t\t$sqlQuery = new SqlQuery2($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "function wp_cache_get_multiple($keys, $group = '', $force = \\false)\n {\n }", "public function listAll() : array\n {\n return \\Cache::remember('query_list_all_config', 60 * 60, function () {\n return $this->config->all()->pluck('value', 'name')->all();\n });\n }", "function wpjsfsp_get_options() {\n\treturn \\WPJSFSP\\Options::get_all();\n}", "public function fetch($options = [])\n {\n return parent::fetch($options);\n }", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "protected function getAllOptions()\n {\n $this->methodExpectsRequest(__METHOD__);\n $options = $this->getRequest()->getAllOptions();\n foreach ($this->getRequest()->getAllFlags() as $name => $value) {\n $options[$this->flags_option_name[$name]] = $value;\n }\n return $options;\n }", "private function loadCache(): void\n {\n //====================================================================//\n // Safety Check\n if (!is_string($this->cacheKey) || empty($this->cacheKey)) {\n return;\n }\n //====================================================================//\n // Connect to Apcu Cache\n $this->cacheAdapter = new ApcuAdapter();\n //====================================================================//\n // Load Links from Cache\n try {\n /** @var array $cache */\n $cache = $this->cacheAdapter->get($this->cacheKey, function (ItemInterface $item): array {\n $item->expiresAfter(self::$cacheTtl);\n\n return array();\n });\n $this->cache = $cache;\n $this->cacheItem = $this->cacheAdapter->getItem($this->cacheKey);\n } catch (InvalidArgumentException $e) {\n $this->cache = array();\n }\n //====================================================================//\n // Load Empty Value\n if (!isset($this->cache)) {\n $this->cache = array();\n }\n }", "public function getOptions(){ return $this->option_map; }", "public function load()\n {\n $this->settings = get_option($this->optionName);\n }", "function getAllOptionsInfos()\n {\n return $this->options_infos;\n }" ]
[ "0.7268947", "0.7268178", "0.68475544", "0.6625522", "0.6381333", "0.6301372", "0.6260428", "0.6176879", "0.60747427", "0.6051961", "0.60417885", "0.5985683", "0.59673333", "0.59346783", "0.59316635", "0.59224695", "0.59152085", "0.59088993", "0.58953696", "0.58949435", "0.58897567", "0.58759093", "0.58759093", "0.58749276", "0.5871927", "0.5871927", "0.5871699", "0.586164", "0.58525527", "0.5838556", "0.5820485", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5817219", "0.5809564", "0.58044267", "0.5767347", "0.5751027", "0.5749424", "0.5730491", "0.57183784", "0.5715583", "0.57093954", "0.56581354", "0.56565094", "0.5656466", "0.5651658", "0.5648744", "0.56409967", "0.56276363", "0.5625841", "0.561658", "0.5607768", "0.56076264", "0.56031376", "0.5594167", "0.55769736", "0.55752206", "0.55712825", "0.5569533", "0.5560926", "0.5557214", "0.5554273", "0.5551482", "0.5543408", "0.552047", "0.5519582", "0.5509431", "0.5501063", "0.5500385", "0.549974", "0.5491327", "0.5482175", "0.5477846", "0.5474892", "0.54480076", "0.54480076", "0.54480076", "0.54480076", "0.54480076", "0.54480076", "0.54480076", "0.5443939", "0.543875", "0.543687", "0.54362214", "0.54310775" ]
0.7315877
0
adds a setting to the cache
protected function addToCache(Setting $setting) { $this->settings[$setting->getName()]=$setting->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function storeCacheSetting()\n {\n Cache::forever('setting', $this->setting->getKeyValueToStoreCache());\n }", "function wp_cache_add($key, $value, $group = '', $expiration = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->add($key, $value, $group, $expiration);\n}", "function wp_cache_add($key, $data, $flag = '', $expire = 0)\n{\n global $wp_object_cache;\n return $wp_object_cache->add($key, $data, $flag, $expire);\n}", "public function cache()\n {\n add_settings_field(\n 'cache',\n apply_filters($this->plugin_name . 'label-cache', esc_html__('Cache', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description' => 'Enable cacheing of your security.txt file.',\n 'id' => 'cache',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['cache']) ? $this->options['cache'] : false,\n ]\n );\n }", "function wp_cache_set($key, $value, $group = '', $expiration = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->set($key, $value, $group, $expiration);\n}", "public function set($key, $value): CacheInterface;", "public function setValToCache($key, $value, $timeToCache = 0);", "function wp_cache_add($key, $data, $group = '', $expire = 0)\n {\n }", "protected function set_cache($value) {\n \t set_transient( $this->get_cache_id(), $value, $this->cache_time ); \t \t\n\t}", "public function enableCache() :void\n {\n Settings::setCache($this->cacheAdapter->buildCache());\n }", "function add($key, $pVal, $exp = 0) {\n\t\t\t$file = CACHE_DIR.md5($key).\".cache\";\n\t\t\tif(!file_exists($file)) {\n\t\t\t\treturn $this->set($key,$pVal,$exp);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}", "function object_cache_add($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->add($key, $data, $flag, $expire);\n}", "public function setObjToCache($key, $value, $timeToCache = 0);", "public function setCache($token){\n \n $this->cacheStack->push($token);\n }", "function wp_cache_add($key, $data, $group = '', $expire = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->add($key, $data, $group, (int) $expire);\n}", "public function storeSetting($setting,$key)\n\t{\n\t\t$this->settings[$key]=$setting;\n\t}", "public static function put ($key, $value){\t\t\n\t\tif (Setting::$cache[$key]==$value){\n\t\t\treturn $value;\n\t\t}\n\t\t$database = new database( _DB_SERVER, _DB_USER, _DB_PASS, _DB_NAME, '');\n\t\t$database->setQuery ( \"DELETE FROM setting WHERE name = '$key'\" );\n\t\tif (!$database->query ()){\n\t\t\thandle_error('unexpected database query failure ' . $database->getErrorNum() . \" error message :\" . $database->getErrorMsg());\n\t\t}\n\t\t\n\t\t$database->setQuery ( \"INSERT INTO setting (name, value) VALUES ('$key','$value')\" );\n\t\tif (!$database->query ()){\n\t\t\thandle_error('unexpected database query failure ' . $database->getErrorNum() . \" error message :\" . $database->getErrorMsg());\n\t\t}\n\t\t\n\t\tSetting::$cache[$key] = $value;\n\t\treturn Setting::$cache[$key];\n\t}", "protected function saveToCache() {}", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "public function storeSetting($setting, $key) {\n\t\t$this->settings[$key] = $setting;\n\t}", "public static function setCache($cache) {}", "public function setCache($url,$data){\n\t\t$hash = md5($url);\n\t\treturn apc_add($hash, $data, $this->expire_time);;\n\t}", "public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}", "function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}", "function object_cache_set($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->set($key, $data, $flag, $expire);\n}", "public function set($key, $value) {\n if (@apc_store($key, array('time' => time(), 'data' => serialize($value)), Shindig_ConfigGet('cache_time')) == false) {\n throw new CacheException(\"Couldn't store data in cache\");\n }\n }", "public function saveToCacheForever();", "private function storeInCache($name, $value)\n {\n if ($this->isCacheEnabled()) {\n $this->cache->setValue('conf_' . $name, $value);\n }\n }", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}", "public function set($key, $value) {\n\n\t\t\t// Retrieve cache\n\t\t\t$filename = $this->_getFileName();\n\t\t\t$dataArray = $this->_loadCache($filename);\n\n\t\t\t// Build and add data to cache\n\t\t\t$data = array(\n\t\t\t\t'time' => time(),\n\t\t\t\t'data' => serialize($value)\n\t\t\t);\n\n\t\t\tif (is_array($dataArray)) {\n\t\t\t\t$dataArray[$key] = $data;\n\t\t\t} else {\n\t\t\t\t$dataArray = array($key => $data);\n\t\t\t}\n\n\t\t\t$cacheData = json_encode($dataArray);\n\n\t\t\tif (true !== file_put_contents($filename, $cacheData)) {\n\t\t\t\treturn false;\n\t\t\t} \n\n\t\t\treturn $this;\n\n\t\t}", "function set($key,$value,$expires=null){\n\t\t$_this =& self::getInstance();\n\t\t\n\t\t$content = array();\n\t\t$content['key'] \t= $key;\n\t\t$content['created'] = time();\n\t\t$content['expires'] = time()+$expires;\n\t\t$content['data'] \t= $value;\n\t\tfile_put_contents($_this->cache_dir.$key, json_encode($content));\n\t\t\n\t\tself::$set_keys[] = $key;\n\t}", "public function setCaching($cache);", "function wp_cache_set($key, $data, $group = '', $expire = 0)\n {\n }", "function cache_set( $key, $value, $ttl = null ) {\n\n\t\tif ( $ttl == null ) {\n\t\t\t$ttl = ( isset( $this->db->ttl) ) ? $this->db->ttl : $this->ttl;\n\t\t}\n\n\t\t$key = 'db_api_' . $key;\n\n\t\tif ( extension_loaded('apc') && (ini_get('apc.enabled') == 1) ) {\n\t\t\treturn apc_store( $key, $value, $ttl );\n\t\t}\n\n\t\t$this->cache[$key] = $value;\n\n\n\t}", "public function setCache($value)\n {\n $this->config->cache = (bool)$value;\n }", "public function set( $key, $value ) {\n $this->cache[ $key ] = $value;\n }", "private static function set( $key, $value ) {\n\t\t// this method will raise an exception on invalid data\n\t\tself::validate( $key, $value );\n\t\t// set the value in the cache\n\t\tself::$_cache[$key] = $value;\n\t}", "public function set( $key, $value )\n {\n $this->cache->save( $key, $value );\n }", "public function cached()\n {\n // check cache is available else set cache and return\n return Cache::get('Klaravel\\Settings\\Setting', function () {\n $data = $this->get();\n Cache::put('Klaravel\\Settings\\Setting', $data, 60 * 24);\n\n return $data;\n });\n }", "public function set($key, $value) {\n\t\t$this->cache[$key] = $value;\n\t}", "public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}", "function acf_append_setting($name, $value)\n{\n}", "function wp_cache_set($key, $data, $group = '', $expire = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->set($key, $data, $group, (int) $expire);\n}", "function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {\n\t\t// Intentionally empty\n\t}", "function setcache( $name, $d, $b = NULL )\n{\n\t\treturn FALSE;\n}", "public static function enableCaching(): void\n {\n static::$caching = true;\n }", "public function cache_set($name, $value)\n\t{\n\t\t$arr = _SESSION('page.'.$this->script_name(), array());\n\t\t$arr[$name] = $value;\n\t\t$_SESSION['page.'.$this->script_name()] = $arr;\n\t}", "public function updateCache();", "function add($setting) {\n if (!is_a($setting, 'admin_setting')) {\n debugging('error - not a setting instance');\n return false;\n }\n\n $this->settings->{$setting->name} = $setting;\n return true;\n }", "public static function cache()\n {\n $cache = Cache::instance('system');\n if (!$cache->get('config-autoload')) {\n $cache->set('config-autoload', self::$data);\n }\n }", "function append($key, $value) {\n return $this->memcached->append($key, $value);\n }", "final public function set(object $value): CacheItemInterface\n\t{\n\t\tif ($stm = $this->_prepare('INSERT INTO `Cache` (\n\t\t\t\t`key`,\n\t\t\t\t`value`,\n\t\t\t\t`expires`\n\t\t\t) VALUES (:key, :value, :expires)\n\t\t\tON DUPLIATE KEY UPDATE\n\t\t\t\t`value` = :value,\n\t\t\t\t`expires`= COALESCE(:expires, NULL);')) {\n\t\t\t$stm->bindValue(':key', $this->getKey());\n\t\t\t$stm->bindValue(':value', serialize($value));\n\n\t\t\tif (isset($this->_expires)) {\n\t\t\t\t$stm->bindValue(':expires', $this->_expires->format(DateTimeInterface::W3C));\n\t\t\t}\n\n\t\t\t$stm->execute();\n\t\t}\n\n\t\treturn $this;\n\t}", "public function add_to_internal_cache($derived_key, $value)\n {\n $this->cache[$derived_key] = $value;\n }", "function add($name, $key, $data) {\n if (!isset($this->cache[$name])) {\n $this->cache[$name] = array();\n }\n $this->cache[$name][$key] = $data;\n $data = json_encode($data);\n //error_log(\"Added to cache: '$name' key: '$key' data: '$data'\");\n }", "public static function add($key = string, $value = string)\n {\n // self::delete($key);\n // \\DB::insert('systemsettings')\n // ->set(array(\n // $key => $value,\n // 'updated_at' => date('Y-m-d H:i:s'),\n // ))\n // ->execute();\n\n }", "public function enableCaching()\n {\n $this->cache = true;\n }", "public function enableCache($casheSet) {\n\t\t$this->cache = $casheSet;\n\t}", "function store_into_cache($key, $val, $ttl = CACHE_TTL){\n\tglobal $SYSTEM_SHOW_CACHE_METRICS, $TAG;\n\n\t$key = \"$TAG:$key\";\n\n\t$timer_bgn = microtime(true);\n\n\tif ( function_exists('apc_store') ) {\n\t\tapc_store($key, $val, $ttl);\n\t} else {\n\t\t$redis = conn_redis();\n\t\t$redis->setex($key, $ttl, json_encode($val, JSON_NUMERIC_CHECK));\n\t}\n\n\t$timer_end = microtime(true);\n\tif ($SYSTEM_SHOW_CACHE_METRICS)\n\t\telog(\"time took caching for key: $key: \" . ($timer_end - $timer_bgn));\n\n\treturn $val;\n}", "public function set($setting_data = '', string $setting_key = '');", "public function addCacheVar($name, $value)\n {\n $this->cacheVars[$name] = $value;\n return $this;\n }", "protected function setRuleToCache($cacheKey, UrlRuleInterface $rule)\n {\n $this->_ruleCache[$cacheKey][] = $rule;\n }", "function cache($name, $set = null)\n{\n $file = '/tmp/cache/'.$name.'.tmp';\n\n if (!is_dir('/tmp/cache'))\n {\n mkdir('/tmp/cache');\n }\n\n if ($set)\n {\n $GLOBALS['cache'][$file] = $set;\n $set = var_export($set, true);\n $tmp = '/tmp/cache/'.$name.uniqid('', true).'.tmp';\n file_put_contents($tmp, '<?php $val = '.$set.';', LOCK_EX);\n rename($tmp, $file);\n return file_exists($tmp);\n }\n elseif (isset($GLOBALS['cache'][$file]))\n {\n return $GLOBALS['cache'][$file];\n }\n else\n {\n if (file_exists($file))\n {\n include $file;\n $GLOBALS['cache'][$file] = $val;\n return $val;\n }\n }\n}", "function set($key, $pVal, $exp) {\n\t\t\t$file = CACHE_DIR.md5($key).\".cache\";\n\t\t\t$val = serialize($pVal);\n\t\t\t$stream = @fopen($file, \"wb\");\n\t\t\tif($stream) {\n\t\t\t\t@fwrite($stream,$val);\n\t\t\t\tfclose($stream);\n\t\t\t\t$this->db->insert(\"fileCache\", array(\"key\",\"expires\",\"size\"),\n\t\t\t\tarray(md5($key),intval($exp), filesize($file)),true);\n\t\t\t\tdebugLog(\"Cache file erstellt\", \"Es wurde eine neues Cache file erstellt - KEY: '\".$key.\"'\",$file);\n\t\t\t\tglobal $__cachemem;\n\t\t\t\t$__cachemem[$key] = $pVal;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "protected function add_setting($key, $val) {\n\t\t$settings = $this->get_settings();\n\t\t$settings[$key] = $val;\n\t\t$this->set_settings($settings);\n\t\treturn $this;\n\t}", "public function addSetting($setting)\n\t{\n\t\tif (is_array($setting)) {\n\t\t\t$setting = Setting::factory($setting);\n\t\t}\n\t\tif (!($setting instanceof Setting)) {\n\t\t\tthrow new \\Exception(\"\\$setting must be an array or properties or an instance of \\\\User\\\\Settings\\\\Setting\");\n\t\t}\n\t\t$this->settings[$setting->key()] = $setting;\n\t}", "public function enableCache()\n\t{\n\t\t$this->_enableCache = true;\n\t}", "public function use_cache(bool $value) {\n\t\t$this->use_cache = $value;\n\t}", "function wp_cache_add($key, $data, $group = '', $expire = 0)\r\n\t{\r\n\t\tstatic $exists = null;\r\n\t\tif (null === $exists) {\r\n\t\t\t$exists = function_exists('wp_suspend_cache_addition');\r\n\t\t}\r\n\r\n\t\tif (!$exists || !wp_suspend_cache_addition()) {\r\n\t\t\tglobal $wp_object_cache;\r\n\t\t\tif (empty($group)) { $group = 'default'; }\r\n\t\t\treturn $wp_object_cache->add($key, $data, $group, $expire);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "static public function addCache($configuration) {\n\t\tif(!isset($configuration['cache_id'])) {\n\t\t\t$mComponentcache=new Maerdo_Model_Componentcache();\n\t\t\treturn($mComponentcache->insert(array('name'=>$configuration['name'],'type'=>$configuration['frontend_type'],'backend_type'=>$configuration['backend_type'])));\n\t\t}\n\t\t\n\t}", "public function add()\n\t{\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_enable'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_icon_display'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_display_empty'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_select_menu'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_text'\n\t\t);\n\t\t\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_icon'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_ccm_enable'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_ccm_text'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_dc_enable'\n\t\t);\n\t}", "public function setUpCache();", "static public function putCache($key, $data)\n {\n if (getenv('AMTEL_CACHE') == 'redis') {\n Cache::store('redis')->put($key, $data, getenv('AMTEL_CACHE_SEC'));\n }\n }", "public function setSetting($key, $value)\n {\n \t// escape the value to make sure it is safe data for mysql\n \t$safe_value = mysql_real_escape_string($value);\n \t// insert vs update\n \tif (isset ($this->settings[$key]))\n \t{\n \t\t$this->qdb_object->updateSetting ($key, $safe_value);\n \t}\n \telse \n \t{\n \t\t$this->qdb_object->insertSetting ($key, $safe_value);\n \t}\n \t// now set the new value in cache (ie within the instance)\n \t// alternate re-run loadSettings to confirm it's definately updated\n \t$this->settings[$key] = $value;\n \t\n \t// qdb function will not return if error so we always return true\n \treturn true;\n }", "function add_to_cache($className, $path)\n{\n global $cache_map, $cache_file;\n\n if(!empty($className))\n {\n if(!$cache_map)\n $cache_map = array();\n\n $cache_map[$className] = $path;\n\n file_put_contents($cache_file, '<?php ' . \"\\n\" . '$cache_map = ' .\"\\n\" . var_export($cache_map, true) . ';' );\n\n }\n}", "function set ($key, $value) {\n return $this->memcached->set($key, $value);\n }", "function wp_cache_set($key, $data, $group = '', $expire = 0)\r\n\t{\r\n\t\tglobal $wp_object_cache;\r\n\t\tif (empty($group)) { $group = 'default'; }\r\n\t\treturn $wp_object_cache->set($key, $data, $group, $expire);\r\n\t}", "public function cacheWrite( $name, $value ) {\n\t\tif ( ZC_CACHE == 'none' || $this->isAdmin() ) return;\n\t\t$name = $this->_cacheName( $name );\n\t\tif ( ZC_CACHE == 'apc' ) {\n\t\t\tapc_store( ZC_CACHE_PREFIX. $name, $value );\n\t\t}\n\t\telse {\n\t\t\t$file = ZC_CACHE_DIR . '/'. $name. '.cache';\n\t\t\tfile_put_contents( $file, serialize( $value ) );\n\t\t}\n\t}", "public function set_cached_property($property, $value) {\n\t\t$this->_cached_properties[$property] = $value;\n\t}", "public function setex($key, $value)\n\t{\n\t\treturn $this->memcache->add($key, $value);\n\t}", "function datalist_set($name, $value) {\n\n\tglobal $CONFIG, $DATALIST_CACHE;\n\n\t$name = trim($name);\n\n\t// cannot store anything longer than 32 characters in db, so catch before we set\n\tif (elgg_strlen($name) > 32) {\n\t\telgg_log(\"The name length for configuration variables cannot be greater than 32\", \"ERROR\");\n\t\treturn false;\n\t}\n\n\t$name = sanitise_string($name);\n\t$value = sanitise_string($value);\n\n\t// If memcache is available then invalidate the cached copy\n\tstatic $datalist_memcache;\n\tif ((!$datalist_memcache) && (is_memcache_available())) {\n\t\t$datalist_memcache = new ElggMemcache('datalist_memcache');\n\t}\n\n\tif ($datalist_memcache) {\n\t\t$datalist_memcache->delete($name);\n\t}\n\n\tinsert_data(\"INSERT into {$CONFIG->dbprefix}datalists set name = '{$name}', value = '{$value}' ON DUPLICATE KEY UPDATE value='{$value}'\");\n\n\t$DATALIST_CACHE[$name] = $value;\n\n\treturn true;\n}", "function update_category_cache()\n {\n }", "public function setCaching(bool $flag)\n {\n $this->cache = $flag;\n }", "private function set_cache( $key, $data = '' ) {\n\t\t$ttl = HOUR_IN_SECONDS;\n\n\t\t/**\n\t\t * Filters the cache expiration.\n\t\t *\n\t\t * Can be used to adjust the time until expiration in seconds for the cache\n\t\t * of the data retrieved for the given URL.\n\t\t *\n\t\t * @since 5.9.0\n\t\t *\n\t\t * @param int $ttl The time until cache expiration in seconds.\n\t\t */\n\t\t$cache_expiration = apply_filters( 'rest_url_details_cache_expiration', $ttl );\n\n\t\treturn set_site_transient( $key, $data, $cache_expiration );\n\t}", "public function add($key,$var,$ttl);", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "public function cacheOptions ()\n {\n\n foreach ( $this->optionsToPersist as $option ) {\n\n $this->optionsCache[ $option ] = $this->getOption ( $option );\n\n }\n\n }", "public function set_from_cache() {\n\t\t$this->from_cache = true;\n\t}", "function cache();", "public function cacheEnable($value = NULL) {\n $class_name = get_class($this);\n return variable_get($class_name . TingClientRequest::cache_enable);\n }", "public function set( $key, $value ) {\n\t\tif ( array_key_exists( $key, $this->cache ) ) {\n\t\t\t$this->ping( $key ); // push to top\n\t\t} elseif ( count( $this->cache ) >= $this->maxCacheKeys ) {\n\t\t\treset( $this->cache );\n\t\t\t$evictKey = key( $this->cache );\n\t\t\tunset( $this->cache[$evictKey] );\n\t\t}\n\t\t$this->cache[$key] = $value;\n\t}", "function def( $key, $value = false ) { \n \n if( $value !== false ) {\n \n $this->cache[$key] = $value;\n \n }\n \n else {\n \n $defined = array_key_exists($key, $this->cache) and isset($this->cache[$key]);\n \n if( $defined ) return $this->cache[$key];\n \n return null;\n \n }\n \n }", "public function cacheEnable($value = NULL) {\n $class_name = get_class($this);\n\n return variable_get($class_name . TingClientRequest::cache_enable, FALSE);\n }", "public function testCacheSetRetrievement(){\n\n $this->initCache();\n\n $this->assertNotEmpty($this->cache);\n\n // Trying to set, save and get value:\n $this->cache->set('test_var', 'testvalue');\n $this->cache->save();\n $this->assertEquals('testvalue', $this->cache->get('test_var'));\n }", "public function runTimeCacheSet($key, $value)\n\t{\n\t\t$this->runTimeCache[$key]\t= $value;\n\t}", "private function cache_settings( array $settings ) {\n\t\t$site_settings = array();\n\t\t$user_settings = array();\n\n\t\tforeach ( $settings as $setting_key => $setting_data ) {\n\t\t\tif ( ! isset( $setting_data['scope'] ) || ! isset( $setting_data['values'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( 'site' === $setting_data['scope'] ) {\n\t\t\t\t$site_settings[ $setting_key ] = $setting_data;\n\t\t\t} elseif ( 'user' === $setting_data['scope'] ) {\n\t\t\t\t$user_settings[ $setting_key ] = $setting_data;\n\t\t\t}\n\t\t}\n\n\t\t$this->transients->set( self::TRANSIENT_NAME, $site_settings, WEEK_IN_SECONDS );\n\t\t$this->user_transients->set( self::TRANSIENT_NAME, $user_settings, WEEK_IN_SECONDS );\n\t}", "public function add($key, $value)\n {\n $this->storage[$key] = $value;\n }", "public function set($key, $value) {\n $this->memcached->set($key, $value);\n }", "private function setCache()\n\t{\n\t\t$this->_cache = new Cache('./', array('prefix' => 'pageReader'));\n\t}", "private function registerCache()\n {\n $this->app->singleton('firewall.cache', function () {\n return new Cache(app('cache'));\n });\n }" ]
[ "0.7081158", "0.6737219", "0.65740365", "0.65041476", "0.6355629", "0.6296402", "0.6277461", "0.62366873", "0.62213206", "0.6219048", "0.6195598", "0.61488736", "0.6121935", "0.6042896", "0.6040885", "0.60152656", "0.6006894", "0.600595", "0.59982073", "0.5989549", "0.59833276", "0.59607404", "0.593861", "0.59236693", "0.59217316", "0.5910459", "0.5907862", "0.59063506", "0.5889989", "0.58857954", "0.588551", "0.5877172", "0.5873083", "0.58725667", "0.5856552", "0.58421856", "0.58244646", "0.5789759", "0.5783717", "0.5780539", "0.57485396", "0.57460374", "0.5738523", "0.5715411", "0.57146543", "0.57029235", "0.569716", "0.56763405", "0.5661073", "0.5651949", "0.5642927", "0.56387705", "0.56347334", "0.56282806", "0.5622308", "0.5612181", "0.5602986", "0.5597107", "0.55905133", "0.5570151", "0.5546577", "0.5528767", "0.5520523", "0.55068517", "0.5496987", "0.54927903", "0.5492548", "0.54816973", "0.54617417", "0.54501104", "0.5447026", "0.5442807", "0.54350704", "0.5431735", "0.5420166", "0.5413144", "0.54061013", "0.5400994", "0.5393456", "0.537633", "0.53674036", "0.53583914", "0.53444636", "0.53434575", "0.5340651", "0.5322394", "0.5319151", "0.53153694", "0.5314791", "0.53052926", "0.5304969", "0.5303175", "0.5296507", "0.52826744", "0.5281769", "0.52712315", "0.5270357", "0.5264792", "0.52635336", "0.5250766" ]
0.7340887
0
transforms value to stringrepresentation for the database (e.g. array to json)
protected function transformValueToDatabase($value,$type) { if($type==SettingInterface::TYPE_BOOLEAN) { Assert::boolean($value); return $value ? 1 : 0; } if($type==SettingInterface::TYPE_DATE_TIME) { if(!$value instanceof \DateTimeInterface) { throw new \Exception('value is not an datetime-object'); } return $value->format('Y-m-d H:i:s'); } if($type==SettingInterface::TYPE_ARRAY) { Assert::isArray($value); return json_encode($value); } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function valueToString($value) {\n\n\t\t\t// Is it null?\n\t\t\tif (is_null($value)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Array?\n\t\t\tif (is_array($value)) {\n\t\t\t\t$processed = array();\n\t\t\t\tforeach($value as $val) {\n\n\t\t\t\t\t// Another array?\n\t\t\t\t\tif (is_array($val)) {\n\n\t\t\t\t\t\t$processed[] = $this->valueToString($val);\n\n\t\t\t\t\t}\n\t\t\t\t\t// String?\n\t\t\t\t\telseif (is_string($val)) {\n\t\t\t\t\t\t$processed[] = $this->connection->Escape($val);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$processed[] = $val;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\treturn implode(\", \", $processed);\n\t\t\t}\n\n\t\t\treturn $value;\n\n\t\t}", "public function serialize($value)\n {\n if ($this->getDataType() === 'json') {\n return json_encode($value);\n } elseif ($this->getDataType() === 'array') {\n return json_encode($value);\n } elseif ($this->getDataType() === 'list') {\n return implode(',', $value);\n }\n\n return trim($value);\n }", "private function transform($value) {\n $CI = & get_instance();\n // caso seja um array\n if (is_array($value)) {\n // percorre os valores\n foreach ($value as $x) {\n // se for um inteiro\n if (is_integer($x)) {\n $foo[] = $x;\n } else if (is_string($x)) {\n // se for string, adiciona aspas\n $foo[] = $CI->db->escape($x);\n }\n }\n // converte o array em string separada por \",\"\n $result = '(' . implode(',', $foo) . ')';\n }\n // caso seja uma string\n else if (is_string($value)) {\n // adiciona aspas\n $result = $CI->db->escape($value);\n }\n // caso seja valor nullo\n else if (is_null($value)) {\n // armazena NULL\n $result = 'NULL';\n }\n\n // caso seja booleano\n else if (is_bool($value)) {\n // armazena TRUE ou FALSE\n $result = $value ? 'TRUE' : 'FALSE';\n } else {\n $result = $CI->db->escape($value);\n }\n // retorna o valor\n return $result;\n }", "public function __toString()\n {\n if (is_array($this->value)) {\n return (string)json_encode($this->value);\n }\n return (string)$this->value;\n }", "function to_str(){\n //\n //A string version of a literal is basicaly the literal itself as a string \n //hence it should be encosed in double quotes incase it is needed to be \n //converted into json\n return \"'$this->value'\";\n }", "public function serialize($value){\n return parent::serialize($value);\n }", "private function transforme($value){\n if(is_array($value))\n {\n foreach ($value as $x)\n {\n if(is_integer($x))\n {\n $foo[] = $x;\n }\n else if(is_string($x))\n {\n $foo[]=\"'$x'\";\n }\n }\n $result = '('.implode(',',$foo).')';\n }\n //caso seja uma string\n else if(is_string($value))\n {\n $result = \"'$value'\";\n }\n // caso seja uma valor nulo\n else if(is_null($value))\n {\n $result = 'NULL';\n }\n //caso seja boleano\n else if(is_bool($value))\n {\n $result = $value ? 'TRUE' : 'FALSE';\n }\n else\n {\n $result = $value;\n }\n\n return $result;\n }", "public function transform($value)\n {\n if (null === $value) {\n return '';\n }\n\n if (!is_array($value)) {\n throw new UnexpectedTypeException($value, 'array');\n }\n\n $value = json_encode($value);\n\n if (json_last_error() !== JSON_ERROR_NONE) {\n throw new TransformationFailedException($this->getLastError(json_last_error()));\n }\n\n // replace the UTF-8 non break spaces\n return $value;\n }", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format ['cname=value'......]\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return \"`$obj->name`=$value\";\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n return implode(\",\",$values_str);\n }", "public static function str($value)\n {\n return json_encode($value);\n }", "public function convertValue($value) {\n\t\tswitch (TRUE) {\n\t\t\tcase is_array($value):\n\t\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t\t$value[$k] = $this->convertValue($v);\n\t\t\t\t}\n\t\t\t\treturn implode('_', $value);\n\t\t\tcase is_object($value):\n\t\t\t\treturn spl_object_hash($value);\n\t\t\tcase is_int($value):\n\n\t\t\tcase is_float($value):\n\n\t\t\tcase is_string($value):\n\n\t\t\tcase is_bool($value):\n\t\t\t\treturn preg_replace('/[\\\\/\\\\/:\\\\.\\\\\\\\\\\\?%=]+/', '_', strval($value));\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}", "function toJSON($value);", "public function toDatabase($value, Driver $driver)\n {\n $value = json_encode($value, JSON_UNESCAPED_UNICODE);\n return parent::toDatabase($value, $driver);\n }", "public static function serialize( $value=null )\n {\n if( is_array( $value ) )\n {\n return json_encode( $value );\n }\n if( is_object( $value ) )\n {\n return serialize( $value );\n }\n if( is_bool( $value ) )\n {\n return ( $value === true ) ? \"1\" : \"0\";\n }\n if( is_null( $value ) )\n {\n return \"\";\n }\n return trim( $value );\n }", "protected function toJson($value) {\r\n\t\treturn \\json_encode($value, \\JSON_UNESCAPED_UNICODE);\r\n\t}", "public function convert($value): string;", "function o_castString($value) {\n\t\t\treturn Obj::singleton()->castString($value);\n\t\t}", "private function asJson($value)\n {\n return json_encode($value);\n }", "public function reverseTransform($value)\n {\n if (empty($value)) {\n return '[]';\n }\n\n $simpleSelectionList = array();\n\n foreach ($value as $alias => $fieldSelection) {\n $field = $fieldSelection->getField();\n\n $simpleSelectionList[] = array(\n 'field' => $field->getId(),\n 'choiceList' => $this->getChoiceIdList($fieldSelection->getChoiceList()),\n 'value' => $fieldSelection->getValue(),\n );\n }\n\n return json_encode($simpleSelectionList);\n }", "function string_value($value) {\r\n\t\t// objects should have a to_string a value to compare to\r\n\t\tif (is_object($value)) {\r\n\t\t\tif (method_exists($value, 'to_string')) {\r\n\t\t\t\t$value = $value->to_string();\r\n\t\t\t} else {\r\n\t\t\t\ttrigger_error(\"Cannot convert $value to string\", E_USER_WARNING);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\t// arrays simply return true\r\n\t\tif (is_array($value)) {\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $value;\r\n\t}", "protected function transform($value): string\n {\n if (is_bool($value)) {\n return $value ? 'true' : 'false';\n }\n\n if (is_null($value)) {\n return 'null';\n }\n\n if (preg_match('/\\s/', $value)) {\n return (substr($value, 0, 1) === '\"' && substr($value, -1) === '\"')\n ? $value\n : \"\\\"$value\\\"\";\n }\n\n return $value;\n }", "public static function encode($value): string\n {\n return json_encode($value);\n }", "#[Pure] public function get_values(): string\n {\n if(gettype($this -> value) === \"string\") {\n return \"'\" . $this->value . \"'\";\n }else{\n $res = \"'\";\n foreach($this -> value as $v){\n $res .= strval($v) . \" \";\n }\n $res .= \"'\";\n }\n return $res;\n }", "public function serialize($value)\n {\n // Assuming the internal representation of the value is always correct\n return $value;\n }", "public function getValueAsString();", "protected function transform($value)\n {\n if (null === $this->valueTransformer) {\n return null === $value ? '' : $value;\n }\n return $this->valueTransformer->transform($value);\n }", "public function jsonSerialize() {\n return json_encode($this->value);\n }", "public function exportValue($value)\r\n {\r\n if (is_object($value)) {\r\n return sprintf('Object(%s)', get_class($value));\r\n }\r\n\r\n if (is_array($value)) {\r\n $a = array();\r\n foreach ($value as $k => $v) {\r\n $a[] = sprintf('%s => %s', $k, $this->exportValue($v));\r\n }\r\n\r\n return sprintf(\"Array(%s)\", implode(', ', $a));\r\n }\r\n\r\n if (is_resource($value)) {\r\n return sprintf('Resource(%s)', get_resource_type($value));\r\n }\r\n\r\n if (null === $value) {\r\n return 'null';\r\n }\r\n\r\n if (false === $value) {\r\n return 'false';\r\n }\r\n\r\n if (true === $value) {\r\n return 'true';\r\n }\r\n\r\n return (string) $value;\r\n }", "public function escapeString($value)\n\t{\n\t\tif (is_object($value)) {\n\t\t\t$id = $this->getObjectIdentifier($value, 'id');\n\t\t\t$properties = (new Reflection_Class(get_class($value)))->getAnnotedProperties(\n\t\t\t\tStore_Annotation::ANNOTATION, Store_Annotation::FALSE\n\t\t\t);\n\t\t\tif ($properties) {\n\t\t\t\t$value = clone $value;\n\t\t\t\tforeach (array_keys($properties) as $property_name) {\n\t\t\t\t\tunset($value->$property_name);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$value = is_numeric($id) ? $id : serialize($value);\n\t\t}\n\t\treturn $this->connection->escape_string($value);\n\t}", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)\n //VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');\n\n $col_str= array_map(function($obj){\n //\n //Return the full description of the columns\n return \"`$obj->name`\"; \n }, $this->values);\n //\n //\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return $value;\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n $values= implode(\",\",$values_str);\n $cols= implode(\",\",$col_str);\n return \"($cols) VALUES ($values)\";\n }", "abstract function toEntity($value);", "function format_value( $value, $post_id, $field )\n {\n return json_decode($value);\n }", "private function get_field_value($value) {\r\n\t if ($value instanceof LazyDBExpressionType) {\r\n\t return $value->getExpression();\r\n\t } else if (is_array ( $value )) {\r\n\t\t\treturn \"'\" . $this->add_slashes( serialize($value) ) . \"'\";\r\n\t\t} else {\r\n\t\t\treturn \"'\" . $this->add_slashes ( $value ) . \"'\";\r\n\t\t}\r\n\t}", "function __toString()\n {\n return strval($this->value);\n }", "protected function normalizeValue($value)\n {\n if (is_array($value)) {\n return implode(',', $value);\n } elseif (is_bool($value)) {\n return $value ? 'true' : 'false';\n }\n\n return $value;\n }", "public function serializeValue($value)\n {\n if (is_numeric($value)) {\n $data = (float)$value;\n return (string)$data;\n }\n if (is_array($value) && !empty($value)) {\n $data = [];\n foreach ($value as $qty) {\n $data[] = $this->fixQty($qty);\n }\n return serialize($data);\n }\n return '';\n }", "function to_database($value, Backend $backend) {\n return $value;\n }", "public static function toJsonValue($value) {\n if (is_object($value)) {\n $ret = static::objectToString($value);\n } elseif (is_resource($value)) {\n $ret = static::resourceToString($value);\n } elseif (is_array($value)) {\n $ret = array();\n foreach ($value as $key => $sub) {\n $ret[$key] = static::toJsonValue($sub);\n }\n } else {\n $ret = $value;\n }\n //$c[$n] = strval($v);\n return $ret;\n }", "protected function asJson($value)\n {\n return json_encode($value);\n }", "protected function asJson($value)\n {\n return json_encode($value);\n }", "final public function __toString()\n {\n return strval($this->value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function get_values(){\n $value_str = '';\n if (is_array($this->value)){\n foreach ($this->value as $val){\n $value_str .= $val.' ';\n }\n } else {\n $value_str .= $this->value;\n }\n\n return $value_str;\n }", "protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }", "public function __toString()\n {\n $type = gettype($this->value);\n\n switch ($type) {\n case 'boolean':\n return $this->boolean($this->value);\n break;\n case 'integer':\n return $this->int($this->value);\n break;\n case 'double':\n return $this->float($this->value);\n break;\n case 'string':\n return $this->string($this->value);\n break;\n case 'array':\n return $this->array($this->value);\n break;\n case 'object':\n return $this->object($this->value);\n break;\n case 'resource':\n return $this->resource($this->value);\n break;\n case 'NULL':\n return 'NULL';\n break;\n default:\n return '(unknown type)';\n break;\n };\n }", "private function ensureString($value)\n {\n if (is_string($value)) {\n return $value;\n }\n\n if (is_array($value) || $value instanceOf \\Traversable) {\n $string = array();\n foreach ($value as $val) {\n if (is_object($val) && method_exists($val, '__toString')) {\n $string[] = $val->__toString();\n }\n else {\n $string[] = (string) $val;\n }\n }\n return implode(',', $string);\n }\n\n if (is_object($value) && method_exists($value, '__toString')) {\n return $value->__toString();\n }\n }", "public function dbSerialize(): string;", "function wddx_serialize_value($value){\n \t //typecast\n \t $value = (array)$value;\n\n \t $toReturn = '<struct>';\n \t foreach($value as $key => $val){\n if(is_array($val)){\n if(is_array($val[0])){\n $toReturn .= '<var name=\"'.$key.'\"><array length=\"'.count($val).'\">'.$this->wddx_serialize_value($val).'</array></var>';\n }else{\n //$toReturn .= '<struct>';\n foreach($val as $mk => $mv){\n \n if(is_int($mv)){\n $type = 'number';\n }else{\n $type = 'string';\n }\n\n $toReturn .= '<var name=\"'.$mk.'\"><'.$type.'>'.$mv.'</'.$type.'></var>';\n }\n //$toReturn .= '</struct>';\n }\n }else{\n\n if(is_int($val)){\n $type = 'number';\n }else{\n $type = 'string';\n }\n\n \t $toReturn .= '<var name=\"'.$key.'\"><'.$type.'>'.$val.'</'.$type.'></var>';\n }\n \t }\n \t $toReturn .= '</struct>';\n \t \n \t return $toReturn;\n \t}", "protected function encodeData(array $value) {\n\t\treturn wireEncodeJSON($value); \n\t}", "protected function check_for_array_or_object($value)\n {\n if (is_array($value) || is_object($value))\n {\n $value = serialize($value);\n }\n\n return $value;\n }", "public function reverseTransform($valueAsArray)\n {\n if (empty($valueAsArray)) {\n $valueAsArray = [];\n }\n if (!is_array($valueAsArray)) {\n $valueAsArray = [$valueAsArray];\n }\n return serialize($valueAsArray);\n }", "public function transform($value)\n {\n if (null === $value) {\n return null;\n }\n if (!is_array($value)) {\n $value = $value->toArray();\n }\n\n return implode($this->separator, array_map(function($tag) { return $tag->getTitle(); }, $value));\n }", "public function __toString()\n {\n return (string)$this->value;\n }", "public function encode($value)\n\t{\n\t\t// null, bool and scalar values\n\t\tif(is_null($value)) {\n\t\t\t$this->_writeValue('null');\n\t\t\treturn;\n\t\t}\n\t\telseif ($value === false) {\n\t\t\t$this->_writeValue('false');\n\t\t\treturn;\n\t\t}\n\t\telseif ($value === true) {\n\t\t\t$this->_writeValue('true');\n\t\t\treturn;\n\t\t}\n\t\telseif (is_scalar($value)) {\n\t\t\t$this->_encodeScalar($value);\n\t\t\treturn;\n\t\t}\n\n\t\t// array of values\n\t\tif ($this->_isList($value)) {\n\t\t\t$this->_encodeList($value);\n\t\t\treturn;\n\t\t}\n\t\t// objects and associative arrays\n\t\telse {\n\t\t\t$this->_encodeObject($value);\n\t\t\treturn;\n\t\t}\n\t}", "public static function encode($value)\n\t{\n\n\t\tif (is_string($value))\n\t\t{\n\t\t\tif (strpos($value, 'js:') === 0)\n\t\t\t\treturn substr($value, 3);\n\t\t\telse\n\t\t\t\treturn $value;\n\t\t}\n\t\telse if ($value === null)\n\t\t\treturn 'null';\n\t\telse if (is_bool($value))\n\t\t\treturn $value ? 'true' : 'false';\n\t\telse if (is_integer($value))\n\t\t\treturn \"$value\";\n\t\telse if (is_float($value))\n\t\t{\n\t\t\tif ($value === -INF)\n\t\t\t\treturn 'Number.NEGATIVE_INFINITY';\n\t\t\telse if ($value === INF)\n\t\t\t\treturn 'Number.POSITIVE_INFINITY';\n\t\t\telse\n\t\t\t\treturn rtrim(sprintf('%.16F', $value), '0'); // locale-independent representation\n\t\t}\n\t\telse if (is_object($value))\n\t\t{\n\t\t\tif (method_exists($value, 'toJs'))\n\t\t\t\treturn $value->toJs();\n\t\t\treturn self::encode(get_object_vars($value));\n\t\t}\n\t\telse if (is_array($value))\n\t\t{\n\t\t\t$es = array();\n\t\t\tif (($n = count($value)) > 0 && array_keys($value) !== range(0, $n - 1))\n\t\t\t{\n\n\t\t\t\tforeach ($value as $k => $v)\n\t\t\t\t{\n\t\t\t\t\tif (null === $v)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t$es[] = $k . \":\" . self::encode($v);\n\t\t\t\t}\n\n\t\t\t\treturn '{' . implode(',' . PHP_EOL, $es) . '}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($value as $v)\n\t\t\t\t\t$es[] = self::encode($v);\n\t\t\t\treturn '[' . implode(',', $es) . ']';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn '';\n\t}", "function to_export($value) {\n return (string) $value;\n }", "private function value($value, array $schema = array()) {\n\t\tif (is_array($value) && count($value) > 0) {\n\t\t\tforeach ($value as $key => $val) {\n\t\t\t\t$value[$key] = $this->value($val, $schema);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t\tif ($value === null) {\n\t\t\treturn 'NULL';\n\t\t}\n\n\t\tif(count($schema) > 0){\n\t\t\tswitch ($type = $schema['type']) {\n case 'boolean':\n return $this->_toNativeBoolean($value);\n case 'float':\n return floatval($value);\n case 'string':\n case 'nchar':\n case 'varchar':\n case 'nvarchar':\n return \"'\".$value.\"'\";\n\t\t\t\t\t\t\tcase 'ntext':\n\t\t\t\t\t\t\t\treturn \"\\\"\".$value.\"\\\"\";\n case 'integer':\n case 'bigint':\n case 'int':\n return intval($value);\n case 'date':\n return \"'\".date(\"Y-m-d\", strtotime($value)).\"'\";\n case 'datetime':\n return \"'\".date(\"Y-m-d H:i:s\", strtotime($value)).\"'\";\n\n }\n\t\t}\n\t}", "public function __toString()\n {\n return strval($this->_data);\n }", "function twig_jsonencode_filter($value, $options = 0)\n {\n if ($value instanceof Twig_Markup) {\n $value = (string) $value;\n } elseif (is_array($value)) {\n array_walk_recursive($value, '_twig_markup2string');\n }\n return json_encode($value);\n }", "function twig_jsonencode_filter($value, $options = 0)\n {\n if ($value instanceof Twig_Markup) {\n $value = (string) $value;\n } elseif (is_array($value)) {\n array_walk_recursive($value, '_twig_markup2string');\n }\n return json_encode($value, $options);\n }", "protected function encode($value)\n {\n return $value;\n }", "public function __toString(): string\n {\n return (string)$this->value;\n }", "public function transform($value);", "public function to_string() {\n\n\t\t$data = $this->get_data();\n\n\t\treturn ! empty( $data ) ? json_encode( $data ) : '';\n\t}", "public function marshal($value)\n {\n if (is_array($value)) {\n $array = [];\n foreach ($value as $key => $valueArray) {\n if (!empty($valueArray['key']) && !empty($valueArray['value']) && !isset($array[ $valueArray['key'] ])) {\n $array[ $valueArray['key'] ] = $valueArray['value'];\n }\n }\n $value = $array;\n }\n return $value;\n }", "public function makeStorableArrayFieldValue($value)\n {\n if ($this->helper->isEncodedArrayFieldValue($value)) {\n $value = $this->helper->decodeArrayFieldValue($value);\n }\n $value = $this->helper->serializeValue($value);\n\n return $value;\n }", "public function toString(mixed $value): string;", "protected function asJson($value)\n {\n if (!$this->isValueObject($value)) {\n return parent::asJson($value);\n }\n return $value->toJson();\n }", "public function transform($value)\n {\n $tagString = '';\n if($value instanceof ArrayCollection) {\n foreach ($value as $v) {\n $tagString .= $v->getName() . ',';\n }\n $tagString = substr($tagString, 0, -1);\n }\n\n return $tagString;\n }", "public function convertToPHPValue($value);", "function format_value( $value, $post_id, $field )\n\t\t{\n\n\t\t\tif(is_array($value)) {\n\t\t\t\t$array = array();\n\n\t\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t\t$array[$k] = json_decode( $v, true );\n\t\t\t\t}\n\n\t\t\t\treturn $array;\n\t\t\t}\n\n\t\t}" ]
[ "0.72117746", "0.72028947", "0.71429914", "0.70724684", "0.70197403", "0.67709", "0.6738562", "0.6663284", "0.65874994", "0.65386635", "0.6516149", "0.6456159", "0.6440957", "0.6428363", "0.64261514", "0.6423", "0.64224404", "0.6401813", "0.6376807", "0.6297528", "0.6290637", "0.62815404", "0.62670535", "0.62650347", "0.62556344", "0.6246276", "0.6243507", "0.623158", "0.6222831", "0.6221224", "0.61954635", "0.6184932", "0.6177059", "0.6176632", "0.6169371", "0.6168531", "0.61532974", "0.61488014", "0.612655", "0.612655", "0.61215127", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61194503", "0.61180776", "0.610399", "0.60958254", "0.60427845", "0.6036328", "0.6034501", "0.603359", "0.60289156", "0.6028408", "0.60280204", "0.6003871", "0.60033166", "0.6002128", "0.5995519", "0.59913015", "0.59869057", "0.5985413", "0.5984704", "0.5977533", "0.59676605", "0.59670895", "0.59575677", "0.59538645", "0.59507364", "0.5940829", "0.59403473", "0.5938714", "0.5932248", "0.5922135" ]
0.60883474
74
transforms stringrepresentation from database to phpobjects (e.g. json to array)
protected function transformValueFromDatabase($value,$type) { if($type==SettingInterface::TYPE_STRING) { return (string)$value; } if($type==SettingInterface::TYPE_INTEGER) { return (integer)$value; } if($type==SettingInterface::TYPE_BOOLEAN) { if(in_array($value,[true,1,'y','yes','true'])) { return true; } if(in_array($value,[false,0,'n','no','false'])) { return false; } } if($type==SettingInterface::TYPE_DATE_TIME) { return \DateTime::createFromFormat('Y-m-d H:i:s',$value); } if($type==SettingInterface::TYPE_ARRAY) { return json_decode($value,true); } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toPhp();", "abstract public function toPhp();", "function convert_to_latin1($obj)\n{\n global $config;\n $ret = $obj;\n // wenn die Verbindung zur Datenbank nicht auf utf8 steht, dann muessen die Rückgaben in utf8 gewandelt werden,\n // da die Webseite utf8-kodiert ist\n if ($config['mysql_can_change_encoding'] == false && $config['mysql_standard_character_set'] != 'utf8') {\n if (is_array($obj)) {\n foreach ($obj as $key => $val) {\n $obj[$key] = utf8_decode($val);\n }\n }\n if (is_string($obj)) {\n $obj = utf8_decode($obj);\n }\n $ret = $obj;\n }\n\n return $ret;\n}", "function convert_to_utf8($obj)\n{\n global $config;\n $ret = $obj;\n // wenn die Verbindung zur Datenbank nicht auf utf8 steht, dann muessen die Rückgaben in utf8 gewandelt werden,\n // da die Webseite utf8-kodiert ist\n if (!isset($config['mysql_can_change_encoding'])) {\n get_sql_encodings();\n }\n\n if ($config['mysql_can_change_encoding'] == false && $config['mysql_standard_character_set'] != 'utf8') {\n if (is_array($obj)) {\n foreach ($obj as $key => $val) {\n //echo \"<br> Wandle \" . $val . \" nach \";\n $obj[$key] = utf8_encode($val);\n //echo $obj[$key];\n }\n }\n if (is_string($obj)) {\n $obj = utf8_encode($obj);\n }\n $ret = $obj;\n }\n\n return $ret;\n}", "public function convert();", "function s2o( $str, $assoc = false ) {\n\t\treturn json_decode( $str, $assoc );\n\t}", "abstract public function Convert($data);", "public function convert($data);", "function object_array($object){\r\n\t$table_name = $object->gettablename();\r\n\t$arr_column = $object->getcolumnnames();\r\n\t$arr_object = array();\r\n\t$arr = $object->searchbyobject(NULL, NULL, TRUE);\r\n\r\n\tswitch($table_name){\r\n\t\tcase \"itpedido_conf\": $table_name = \"itpedidoconf\";\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tif(is_array($arr)){\r\n\t\tforeach($arr as $row){\r\n\t\t\t$ob = objectbytable($table_name, NULL, $object->getconnection());\r\n\t\t\tforeach($arr_column as $column){\r\n\t\t\t\t@call_user_func(array($ob, \"set\".$column), $row[$column]);\r\n\t\t\t}\r\n\t\t\t$arr_object[] = $ob;\r\n\t\t}\r\n\t}\r\n\treturn $arr_object;\r\n}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "public function toPhp() {}", "function DBEscape($data) {\n\t$link = DBConnect();\n\n\tif (!is_array($data))\n\t\t$data = mysqli_real_escape_string($link, $data);\n\telse {\n\t\t$arr = $data;\n\n\t\tforeach ($arr as $key => $value) {\n\t\t\t$key = DBEscape($key);\n\t\t\t$value = DBEscape($value);\n\n\t\t\t$data[$key] = $value;\n\t\t}\n\t}\n\n\tDBClose($link);\n\treturn $data;\n}", "function objectToSQL($object,$table,$field=\"\",$update=\"add\") {\n if (is_array($object)) {\n while(list($k,$v) = each($object)) {\n if (!is_numeric($k)) {\n $array[$k] = $v;\n }\n }\n } else {\n $array = get_object_vars($object);\n }\n while(list($key,$val) = @each($array)) {\n if (substr($key,0,1)!=\"_\") {\n if ($k1) { $k1 .= \",\"; }\n if ($v1) { $v1 .= \",\"; }\n if ($k2) { $k2 .= \",\"; }\n $q = \"'\";\n if (is_numeric($val)) {\n $q=\"\";\n }\n if (is_array($val) || is_object($val)) {\n $val = @serialize($val);\n } else { \n\t\t\t$val = addslashes(stripslashes($val));\n\t\t}\n $k1 .= $key;\n $v1 .= \"$q$val$q\";\n $k2 .= \"$key=$q$val$q\";\n if ($key==$field) {\n $fieldval=\"$q$val$q\";\n }\n }\n }\n if ($update==\"add\") {\n $sql = \"insert into $table ($k1) values ($v1)\";\n }\n if ($update==\"update\") {\n $sql = \"update $table set $k2 where $field=$fieldval\";\n }\n return $sql;\n}", "public function convert($data) {\r\n\t\tif(is_array($data) || is_object($data)) {\r\n\t\t\t$result = array();\r\n\t\t\tforeach ($data as $key => $value) {\r\n\t\t\t\t$result[$key] = $this->__convert($value);\r\n\t\t\t}\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function cast_query_results($rs)\n{\n $fields = mysqli_fetch_fields($rs);\n $data = array();\n $types = array();\n foreach ($fields as $field) {\n switch ($field->type) {\n case 3:\n $types[$field->name] = 'int';\n break;\n case 4:\n $types[$field->name] = 'float';\n break;\n default:\n $types[$field->name] = 'string';\n break;\n }\n }\n while ($row = mysqli_fetch_assoc($rs)) {\n array_push($data, $row);\n }\n\n for ($i = 0; $i < count($data); $i++) {\n foreach ($types as $orgname => $type) {\n settype($data[$i][$orgname], $type);\n }\n }\n return $data;\n}", "function twe_db_prepare_input($string) {\n if (is_string($string)) {\n return trim(stripslashes($string));\n } elseif (is_array($string)) {\n reset($string);\n while (list($key, $value) = each($string)) {\n $string[$key] = twe_db_prepare_input($value);\n }\n return $string;\n } else {\n return $string;\n }\n }", "public function toObject();", "function convertJson($str){\n $str = str_replace(\"idPersonne\",'\"idPersonne\"',$str);\n $str = str_replace(\"{nom\",'{\"nom\"',$str);\n $str = str_replace(\"prenom\",'\"prenom\"',$str);\n $str = str_replace(\"'\",'\"',$str);\n return $str;\n }", "protected function fromDatabase( $data )\n\t{\n\t\tforeach ( $data AS $field => $value ) \n\t\t{\t\n\t\t\tif ( isset( static::$schema[ $field ] ) )\n\t\t\t{\n\t\t\t\tif ( is_array( static::$schema[ $field ] ) )\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ][ 'type' ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ];\n\t\t\t\t}\n\t\n\t\t\t\t$this->data[ $field ] = $this->sanitize( $type, $value );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->loaded = true;\n\t}", "public function convertToPhpValue($data);", "function _convert_to_table_data($entity)\n {\n $data = (array) $entity;\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n $data[$key] = $this->object->serialize($value);\n }\n }\n return $data;\n }", "public function arrayToObject($data){\n\t\t$namespaceDAO = explode(\"\\\\\", get_class($this));\n\t\t$nameDAO = array_pop($namespaceDAO);\n\t\t$pos = strpos($nameDAO, \"DAO\");\n\t\t$class = \"\\\\Models\\\\Business\\\\\" . substr($nameDAO, 0,$pos);\n\t\t$setters = $this->getSettersFromClass($class);\n\t\t$object = new $class;\n\t\t$i = 0;\n\t\tforeach ($data as $key => $value) {\n\t\t\t$object->$setters[$i]($value);\n\t\t\t$i++;\n\t\t}\n\t\treturn $object;\n\t}", "private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }", "public static function ArrayValueForPhp($String) {\n return str_replace('\\\\', '\\\\', html_entity_decode($String, ENT_QUOTES));\n // $String = str_replace('\\\\', '\\\\', html_entity_decode($String, ENT_QUOTES));\n // return str_replace(array(\"'\", \"\\n\", \"\\r\"), array('\\\\\\'', '\\\\\\n', '\\\\\\r'), $String);\n }", "public function convertObjIntoAssArr(){\n\n $assArrOfObjPro = array();\n//taking value from array and checking if property is in class and than assign key and value to make array\n foreach(self::$db_table_fields as $db_table_field){\n if(property_exists($this,$db_table_field)){\n $assArrOfObjPro[$db_table_field] = $this->$db_table_field;\n }\n } return $assArrOfObjPro;\n }", "public function reverseTransform($string) {\n\t\t\treturn json_decode($string);\n\t\t}", "function convert_from_sql_row($row)\n\t{\n $this->SignupId = (int)$row->SignupId;\n $this->UserId = (int)$row->UserId;\n $this->RunId = (int)$row->RunId;\n $this->State = (string)$row->State;\n $this->PrevState = (string)$row->PrevState;\n $this->Gender = (string)$row->Gender;\n $this->Counted = (string)$row->Counted;\n $this->UpdatedById = (int)$row->UpdatedById;\n $this->TimeStamp = (string)$row->TimeStamp;\n\t}", "function getInfoFromBD($sql)\n{\n $mysqli = makeSqlConnection();\n\t\t\n\t\t$res = $mysqli->query($sql);\n\n $rows = array();\n while($r = mysqli_fetch_assoc($res))\n {\n $obj = (object) $r;\n\n //$obj->assigned_user_name = getUserName($obj->assigned_user_id);\n $obj->contact_name = getContactName($obj->contact_id);\n $obj->parent_name = getParentName($obj->parent_type,$obj->parent_id);\n\n $a = (array) $obj;\n $rows[] = $a;\n }\n\n if( empty( $rows ) )\n {\n return '{\"results\" :[]}';\n }\n else\n {\n //Convierte el arreglo en json y lo retorna\n $temp = json_encode(utf8ize($rows));\n return '{\"results\" :'.$temp.'}';\n }\n}", "public function toMixed();", "function db_driver_unescape($data)\n{\n global $_db;\n\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = str_replace('\\'\\'', '\\'', $data);\n\n return $data;\n}", "private function mapSqlToObject($rs) {\n $langue = new langue();\n $langue->_id = $rs[\"id\"];\n $langue->_key_identifier = $rs[\"key_identifier\"];\n $langue->_english = $rs[\"english\"];\n $langue->_french = $rs[\"french\"];\n $langue->_spanish = $rs[\"spanish\"];\n $langue->_german = $rs[\"german\"];\n $langue->_italien = $rs[\"italien\"];\n return $langue;\n }", "abstract public function convert_from_storage($source);", "private function mapSqlToObject($rs)\n {\n $temp_prod = new temp_prod();\n $temp_prod->_id = $rs[\"id\"];\n $temp_prod->_session_id = $rs[\"session_id\"];\n $temp_prod->_base64_image = $rs[\"base64_image\"];\n $temp_prod->_bonrepli = $rs[\"bonrepli\"];\n $temp_prod->_commentaire = $rs[\"commentaire\"];\n $temp_prod->_dimension = $rs[\"dimension\"];\n $temp_prod->_escargot = $rs[\"escargot\"];\n $temp_prod->_idn_key = $rs[\"idn_key\"];\n $temp_prod->_idmodelmetier = $rs[\"idmodelmetier\"];\n $temp_prod->_idproduit = $rs[\"idproduit\"];\n $temp_prod->_opt = $rs[\"opt\"];\n $temp_prod->_prix = $rs[\"prix\"];\n $temp_prod->_unitprix = $rs[\"unitprix\"];\n $temp_prod->_idsupport = $rs[\"idsupport\"];\n $temp_prod->_support = $rs[\"idsupport\"];\n $temp_prod->_qte = $rs[\"qte\"];\n $temp_prod->_title = $rs[\"title\"];\n $temp_prod->_data = ($rs[\"data\"]);\n $temp_prod->_random_str = json_decode($rs[\"random_str\"]);\n $temp_prod->_escargot_val = json_decode($rs[\"escargot_val\"]);\n $temp_prod->_contours = json_decode($rs[\"contours\"]);\n $temp_prod->_liserai = json_decode($rs[\"liserai\"]);\n $temp_prod->_id_dimension = $rs[\"id_dimension\"];\n $temp_prod->_id_qte = $rs[\"id_qte\"];\n return $temp_prod;\n }", "function db2value($rec)\n {\n $languages = $this->getLanguages();\n if($this->isMlNode())\n {\n if(is_array($rec[$this->fieldName()]))\n {\n foreach($rec[$this->fieldName()] as $lng=>$value)\n {\n $result[$lng]=stripslashes($value);\n }\n } else $result = stripslashes($rec[$this->fieldName()]);\n }\n else\n {\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n $result[$languages[$i]] = stripslashes($rec[$this->fieldName().'_'.$languages[$i]]);\n }\n }\n return $result;\n }", "function strip_slashes($stdObject_or_array_or_string)\n {\n static $level = 0;\n static $processed_objects = array();\n $level++;\n $processed_objects[] = $stdObject_or_array_or_string;\n if (is_string($stdObject_or_array_or_string)) {\n $stdObject_or_array_or_string = str_replace(\"\\\\'\", \"'\", str_replace('\\\\\"', '\"', str_replace(\"\\\\\\\\\", \"\\\\\", $stdObject_or_array_or_string)));\n } elseif (is_object($stdObject_or_array_or_string) && !in_array($stdObject_or_array_or_string, $processed_objects)) {\n foreach (get_object_vars($stdObject_or_array_or_string) as $key => $val) {\n if ($val != $stdObject_or_array_or_string && $key != '_mapper') {\n $stdObject_or_array_or_string->{$key} = $this->strip_slashes($val);\n }\n }\n $processed_objects[] = $stdObject_or_array_or_string;\n } elseif (is_array($stdObject_or_array_or_string)) {\n foreach ($stdObject_or_array_or_string as $key => $val) {\n if ($key != '_mixins') {\n $stdObject_or_array_or_string[$key] = $this->strip_slashes($val);\n }\n }\n }\n $level--;\n if ($level == 0) {\n $processed_objects = array();\n }\n return $stdObject_or_array_or_string;\n }", "public function toEntity($array);", "public function toEntity($array);", "function ConversToObject($array){\r\n\t\t\t$td = new TuyenDi();\r\n\t\t\t$td->MaChuyen = $array[\"MaChuyen\"];\r\n\t\t\t$td->TenTuyen = $array[\"TenTuyen\"];\t\t\t\r\n\t\t\t$td->GioDi = $array[\"GioDi\"];\r\n\t\t\t$td->LoaiXe = $array[\"LoaiXe\"];\r\n\t\t\t$td->SoGhe = $array[\"SoGhe\"];\r\n\t\t\t$td->GiaVe = $array[\"GiaVe\"];\r\n\t\t\treturn $td;\r\n\t\t}", "function toArray($object);", "function object_to_array($data)\r\n{\r\n if (is_array($data) || is_object($data))\r\n {\r\n $result = array();\r\n foreach ($data as $key => $value)\r\n {\r\n $result[$key] = object_to_array($value);\r\n }\r\n return $result;\r\n }\r\n return $data;\r\n}", "function fromDbToArray($conn, $stmSql, $stmArgs) {\r\n $tempArray = array();\r\n \r\n for($argsIndex = 0; $argsIndex < count($stmArgs); $argsIndex++) {\r\n $stmSql = preg_replace('/:var/', $stmArgs[$argsIndex], $stmSql, 1);\r\n }\r\n \r\n try {\r\n $stm = $conn -> prepare($stmSql);\r\n $stm->execute();\r\n } catch(PDOException $e) {\r\n echo(\"Failed to Query: \" . $e -> getMessage());\r\n die($e -> getMessage());\r\n }\r\n \r\n while($row = $stm -> fetch()) {\r\n $tempArray[$row[1]] = intval($row[0]);\r\n }\r\n \r\n return $tempArray;\r\n }", "function _wp_json_convert_string($input_string)\n {\n }", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "function resultToArray($result,$fields,$encoding='')\r\n\t{\r\n\t\t$result_array = array();\r\n\t\twhile ($one_row=mysql_fetch_assoc($result))\r\n\t\t\t\t$result_array[]=$one_row;\r\n\t\treturn $result_array;\r\n\t}", "private function mapSqlToObject($rs) {\n if(!$rs){\n return \"false\";\n }\n $sous_prix = new souscategory_prix();\n $sous_prix->_id = $rs[\"id\"];\n $sous_prix->_id_modelmetier_category = $rs[\"id_modelmetier_category\"];\n $sous_prix->_id_coeff_prix = $rs[\"id_coeff_prix\"];\n $sous_prix->_id_support = $rs[\"id_support\"];\n return $sous_prix;\n }", "public function dbSerialize(): string;", "public function select($string_query){\n\n $result = this->query($string_query);\n $data = array();\n\n\t while ($row = mysqli_fetch_array($result)) {\n\t foreach ($row as $key => $value) {\n\t \t$row[key] = utf8_encode($value);\n\t }\n\t array_push($data, $row); \n\t }\n\t unset($result)\n\t return $data;\n\n}", "function _to_object($result, $model)\r\n\t{\r\n\t\t$items = array();\r\n\r\n\t\tforeach ($result as $row)\r\n\t\t{\r\n\t\t\t$item = new $model();\r\n\r\n\t\t\tforeach ($this->fields as $field)\r\n\t\t\t{\r\n\t\t\t\tif (isset($row->{$field}))\r\n\t\t\t\t{\r\n\t\t\t\t\t$item->{$field} = $row->{$field};\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$item->{$field} = NULL;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$item->_refresh_stored_values();\r\n\r\n\t\t\t$items[$item->id] = $item;\r\n\t\t}\r\n\r\n\t\treturn $items;\r\n\t}", "public static function toArray() {\n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\";\n \n // Obtain an array of persons records.\n $records = Database::query($str);\n \n // Push each row into a new array to be outputted.\n $x = 0;\n $output = array();\n while($row = mysql_fetch_array($records)){\n $output[$x]['id'] = $row['id'];\n $output[$x]['firstName'] = $row['firstName'];\n $output[$x]['lastName'] = $row['lastName'];\n $output[$x]['email'] = $row['email'];\n $output[$x]['password'] = $row['password'];\n $x++;\n }\n \n return $output;\n }", "public function transform($array) {\n//\t\t\tld(\"transform\");\n//\t\t\tld(json_encode($array));\n\t\t\treturn json_encode($array);\n\t\t}", "function encodeData($data)\n {\n if (is_array($data)) {\n /*\n * Traitement des tableaux\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->encodeData($value);\n }\n } else {\n /*\n * Traitement des chaines individuelles\n */\n if ($this->typeDatabase == 'pgsql') {\n if ($this->UTF8 && mb_detect_encoding($data) != \"UTF-8\") {\n $data = mb_convert_encoding($data, 'UTF-8');\n }\n $data = pg_escape_string($data);\n } else {\n $data = addslashes($data);\n }\n }\n return $data;\n }", "function to_php($value, Backend $backend) {\n return $value;\n }", "static function decodeSimple($o){\n\t\t// get type\n\t\t$pos = strpos($o,\"\\n\");\n\t\tif($pos !== false){\n\t\t\t$type = substr($o,2,$pos - 2);\n\t\t\t$endPos = $pos + strlen(\"\\n\");\n\t\t\t}\n\t\n\t\t// create object or array\n\t\tif(strlen($type) and $type != 'array' and class_exists($type))\n\t\t\t$ret = new $type;\n\t\telse\n\t\t\t$ret = array();\n\t\n\t\tself::complexify($ret,$o,$endPos);\n\t\n\t\t//funx::debug(var_export($ret,true),'object decoded');\n\t\treturn $ret;\n\t\t}", "public function databaseObjects() {\n \t$out = '';\n \t$objects = Application::availableObjects();\n \tforeach($objects as $object) {\n \t\t$out .= \"[\\\"\".$object.\"\\\"], \";\n \t}\n \treturn substr($out, 0, -2);\n }", "private function MongoCollectionToArray($mongo_collection_data){\n $data=[];\n $mongo_data_array=[];\n foreach ($mongo_collection_data as $single_document) {\n \n foreach ($single_document as $key => $value) {\n if(is_object($value))\n { //convert the _id object to string to store it\n $value=(string)$value;\n }\n $data[$key] = $value;\n }\n array_push($mongo_data_array,$data);\n }\n return $mongo_data_array;\n }", "public function convertTypoScriptArrayToPlainArrayTestdata() {}", "final public function bsonSerialize(): array|object {}", "public function testConvertObjectToArrayWithCasting()\n {\n $method = new \\ReflectionMethod('PhpORM\\Storage\\AuraExtendedPdo', 'convertToArray');\n $method->setAccessible('true');\n\n $expected = array('id' => 1, 'name' => 'Tester');\n $entity = new \\stdClass();\n $entity->id = $expected['id'];\n $entity->name = $expected['name'];\n\n $storage = new AuraExtendedPdo(new \\stdClass(), new \\stdClass());\n $res = $method->invoke($storage, $entity);\n\n $this->assertEquals($expected, $res);\n }", "function arrayIntoObject (&$object,$array) {\nwhile(list($key,$val)=@each($array)) {\n if (!is_numeric($key)) {\n if ($v2 = @unserialize($val)) { $val = $v2; }\n $object->$key = $val;\n }\n}\n}", "function convert_array_to_object($array)\n\t{\n\t\t$obj = \"\";\n\t\tif (!is_null($array) && is_array($array) && count($array)!=0)\n\t\t{\n\t\t\tforeach($array as $key => $value)\n\t\t\t{\t\n\t\t\t\t$obj->$key = $value;\n\t\t\t}\n\t\t}\n\t\treturn $obj;\n\t}", "function recordObjects2Array($obj) {\n\tif ( is_object($obj) ) {\n\t\t$obj = (array) $obj;\n\t}\n\tif ( is_array($obj) ) {\n\t\t$new = array();\n\t\tforeach($obj as $key => $val) {\n\t\t\t$new[$key] = recordObjects2Array($val);\n\t\t}\n\t}\n\telse { \n\t\t$new = $obj;\n\t}\n\treturn $new;\n}", "abstract public function convert_to_storage();", "private function dataConvert($array)\n {\n $result = false;\n if(count($array) && isset($array[0]) && is_array($array[0]))\n {\n $class = get_class($this);\n foreach($array as $arr)\n {\n $result[] = new $class((int) $arr[$this->primaryName]);\n }\n }\n else if(count($array))\n {\n $class = get_class($this);\n $result = new $class((int) $array[$this->primaryName]);\n }\n return $result;\n }", "function object_to_array( $input ) {\n\tif ( is_scalar( $input ) ) {\n\t\treturn $input;\n\t}\n\t\n\treturn array_map( '\\your\\space\\object_to_array', (array) $input );\n}", "private function massageObject($object) {\n\t\t$table = $this->mung($this->getClassFromObject($object));\n\t\t$vars = $this->getColumns($object);\n\t\t$data = [];\n\t\tforeach($vars as $name => $default) {\n\t\t\t$data[$name] = $object->$name;\n\t\t}\n\t\t$keys = array_keys($data);\n\t\treturn [$table, $keys, $data];\n\t}", "private function convertObjectToString ($str)\n {\n if ( is_array($str) || is_object($str) )\n return serialize($str);\n\n return $str;\n }", "function toSQL($mixed,$addslashes = false,$quotes = true){\n\tif (is_null($mixed)){\n\t\treturn 'NULL';\n\t}\n\tif (!is_array($mixed)){\n\t\treturn tosql_string($mixed,$addslashes,$quotes);\n\t}\n\t$string = '';\n\tforeach($mixed as $value){\n\t\tif ($string != ''){\n\t\t\t$string .= ',';\n\t\t}\n\t\t$string .= tosql_string($value,$addslashes,$quotes);\n\t}\n\treturn $string;\n}", "public function convertPlainArrayToTypoScriptArrayTestdata() {}", "function getJsonObjFromResult(&$result){\n // by reference doorgeven, waardoor deze niet gekopieerd word\n // naar een nieuwe variabele voor deze functie.\n\n $fixed = array();\n \n $typeArray = array(\n MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_INT24, \n MYSQLI_TYPE_LONG, MYSQLI_TYPE_LONGLONG,\n MYSQLI_TYPE_DECIMAL, \n MYSQLI_TYPE_FLOAT, MYSQLI_TYPE_DOUBLE );\n $fieldList = array();\n // haal de veldinformatie van de velden in deze resultset op\n while($info = $result->fetch_field()){\n $fieldList[] = $info;\n }\n // haal de data uit de result en pas deze aan als het veld een\n // getaltype zou moeten bevatten\n while ($row = $result -> fetch_assoc()) {\n $fixedRow = array();\n $teller = 0;\n\n foreach ($row as $key => $value) {\n if (in_array($fieldList[$teller] -> type, $typeArray )) {\n $fixedRow[$key] = 0 + $value;\n } else {\n $fixedRow[$key] = $value;\n }\n $teller++;\n }\n $fixed[] = $fixedRow;\n }\n\n // geef een json object terug\n return '{\"data\":'.json_encode($fixed).'}';\n}", "private function _castFields($recArray, $metas) {\n if(!is_array($recArray)) {\n var_dump($recArray);\n throw new \\Exception(\"DBO_ERROR: Must pass record array\");\n }\n foreach($metas as $meta) {\n $fieldName = $meta->name;\n if(key_exists($fieldName, $recArray)) {\n switch ($meta->type) {\n case 246: //Field is a floating point numeric\n $recArray[$fieldName] = floatval($recArray[$fieldName]);\n break;\n case 253: //Field is a string value\n $recArray[$fieldName] = strval($recArray[$fieldName]);\n break;\n case 3: //Field is an integer\n $recArray[$fieldName] = intval($recArray[$fieldName]);\n break;\n default: //Treat as string by default\n $recArray[$fieldName] = strval($recArray[$fieldName]);\n break;\n }\n }\n }\n return $recArray;\n }", "function db_array_to_update_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' ) $arr = toutf( $arr );\n\tif ( is_array( $arr ) ) {\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$v = ( $v );\n\t\t\t$op = substr( $k, -1 );\n\t\t\tif ( $op == '+' || $op == '-' ) {\n\t\t\t\t$k = substr( $k, 0, -1 );\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$k$op$v,\";\n\t\t\t} else {\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$v,\";\n\t\t\t}\n\t\t}\n\t\treturn substr( $s, 0, -1 );\n\t} else {\n\t\treturn $arr;\n\t}\n}", "public function toDatabase($value, Driver $driver)\n {\n $value = json_encode($value, JSON_UNESCAPED_UNICODE);\n return parent::toDatabase($value, $driver);\n }", "function rf_convert_vc_json($value)\n{\n $value = str_replace('``','\"', $value);\n $value = preg_replace('/`\\}`/', ']',$value);\n $value = preg_replace('/`\\{`/','[',$value);\n return htmlspecialchars($value);\n}", "public function convert($data)\n {\n if (is_object($data)) {\n $data = get_object_vars($data);\n }\n\n if (is_array($data)) {\n return array_map(__METHOD__, $data);\n } else {\n return $data;\n }\n }", "function cleanJSON($data)\n{\n//01.23.2013 naj - can handle json as either an object or an associative array\nforeach ($data as $key => $value)\n\t{\n\tif (is_object($value) || is_array($value))\n\t\t$temp = cleanJSON($value);\n\telse\n\t\t$temp = addslashes($value);\n\n\tif (is_object($data))\n\t\t$data->$key = $temp;\n\telse\n\t\t$data[$key] = $temp;\n\t}\nreturn $data;\n}", "function toPostgresArray($set) {\n settype($set, 'array'); // can be called with a scalar or array\n $result = array();\n foreach ($set as $t) {\n if (is_array($t)) {\n $result[] = toPostgresArray($t);\n } else {\n $t = str_replace('\"', '\\\\\"', $t); // escape double quote\n if (! is_numeric($t)) // quote only non-numeric values\n $t = '\"' . $t . '\"';\n $result[] = $t;\n }\n }\n return '{' . implode(\",\", $result) . '}'; // format\n }", "public function convertToPHPValue($value);", "public static function fromUTF8($obj, $data_codepage = null)\n\t{\n\t\t// Array || object\n\t\tif(is_array($obj) || is_object($obj)){\n\t\t\tforeach($obj as $key => &$val){\n\t\t\t\t$val = self::fromUTF8($val, $data_codepage);\n\t\t\t}\n\t\t\tunset($key, $val);\n\t\t\t\n\t\t\t//String\n\t\t}else{\n\t\t\tif(preg_match('u', $obj) && function_exists('mb_convert_encoding') && $data_codepage !== null)\n\t\t\t\t$obj = mb_convert_encoding($obj, $data_codepage, 'UTF-8');\n\t\t}\n\t\treturn $obj;\n\t}", "public function arrayToObject($array): static;", "function stringToObject( $data, $namespace='' ) {\n\t\treturn true;\n\t}", "function stringToObject( $data, $namespace='' ) {\n\t\treturn true;\n\t}", "public function transform(DatabaseNotification $object)\n {\n $parsedClassNamespace = explode('\\\\', $object->type);\n $notificationClassName = end($parsedClassNamespace);\n\n $objectArray = [\n 'id' => $object->id,\n 'type' => $notificationClassName,\n 'read_at' => $object->read_at,\n 'created_at' => $object->created_at\n ];\n $objectArray = $objectArray + $object->data;\n\n $this->transformGenericObjects($objectArray);\n \n return $objectArray;\n }", "function db_tableby_to_sqladd($arr){\t\n\tif ( is_array( $arr ) ) {\n\t\t$s='';\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$s.=DB_PRE.$k.' as '.$v.',';\n\t\t}\n\t\treturn $s;\n\t}elseif(strpos( $arr,',' )>0) \t{\n\t\treturn DB_PRE.str_replace(',',','.DB_PRE,$arr);\t\t\n\t}else {\n\t\tif (strpos( $arr,DB_PRE )>0){\n\t\t\treturn $arr;\n\t\t}else{\n\t\t\treturn DB_PRE.$arr;\n\t\t}\t\t\n\t}\n}", "private function convert(Array $object): Array {\n $parse = Array();\n foreach ($object as $key => $value) {\n if ($value instanceof stdClass) {\n $parse[$key] = $this->convert((Array) $value);\n } else {\n $parse[$key] = $value;\n }\n }\n return $parse;\n }", "abstract public function hydrate($data);" ]
[ "0.60761833", "0.6046287", "0.5960244", "0.59588826", "0.5954457", "0.5853837", "0.58534425", "0.58527", "0.58210033", "0.574732", "0.574732", "0.574732", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.5745846", "0.57400733", "0.572317", "0.569086", "0.56601745", "0.56464714", "0.56385714", "0.5603943", "0.55820704", "0.5572299", "0.5551418", "0.55270666", "0.5498771", "0.549413", "0.548676", "0.5473044", "0.5459428", "0.54371154", "0.54344946", "0.54300404", "0.54293954", "0.54257333", "0.5422053", "0.5412508", "0.5397368", "0.53941846", "0.53941846", "0.5377575", "0.53513783", "0.5340718", "0.53405124", "0.53364336", "0.53274596", "0.53268", "0.5326749", "0.5323399", "0.5317387", "0.5315331", "0.53022325", "0.53006154", "0.5291876", "0.5289612", "0.5279823", "0.52741355", "0.5268074", "0.52595407", "0.52576476", "0.52517015", "0.5251052", "0.52509266", "0.5248306", "0.5242214", "0.52349436", "0.52321815", "0.5218501", "0.52082026", "0.5205674", "0.5196533", "0.516626", "0.51644135", "0.5159691", "0.51594913", "0.5159352", "0.5156939", "0.51521176", "0.5151963", "0.5150473", "0.5147003", "0.5142991", "0.51382923", "0.51382923", "0.513794", "0.51356065", "0.5132722", "0.51320565" ]
0.0
-1
Parse the $str and return a date interval
public static function evaluateExpirationPeriod($str) { $interval = ''; if (is_numeric($str)) { // when only a number is entered $interval = 'P' . $str . 'D'; } else if (strstr($str, ':')) { // when he have a time [hours:minutes:seconds] $arr = explode(':', $str); $interval = "PT"; if (!empty($arr[0])) { $interval .= $arr[0] . 'H'; } if (!empty($arr[1])) { $interval .= $arr[1] . 'M'; } if (!empty($arr[2])) { $interval .= $arr[2] . 'S'; } } else { $interval = $str; } if (empty($interval)) { return null; } return new DateInterval(strtoupper($interval)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse(string $input): \\DateInterval\n {\n $input = trim($this->normalizer->normalize($input));\n\n $definition = Pattern::DEFINE . Pattern::INTEGER . Pattern::TIME_PART . ')';\n $expression = $definition . Pattern::INTERVAL_ONLY;\n\n if (preg_match($expression, $input, $matches)) {\n return \\DateInterval::createFromDateString($input);\n }\n\n throw new FormatException(\"Given string is not a valid time interval.\");\n }", "private function parseDates($str) {\n\n preg_match_all('/{DATE:(.+)}/U', $str, $m); \n $version = phpversion();\n\n if($version < '5.3.0') {\n\n $now = time();\n \n for($i=0,$j=count($m[0]);$i<$j;$i++) {\n\n $twTime = strtotime($m[1][$i]);\n\n $ival = $now - $twTime;\n\n if($this->dateFormat === 'friendly') {\n\n switch(true) {\n\n case ($ival < 10):\n $strTime = 'just now'; \n break; \n\n case ($ival <= 60):\n /* this is less than a minute */\n $ival = ($ival === 1) ? $ival . ' secod' : $ival . ' seconds';\n $strTime = $ival . ' ago'; \n break; \n\n case ($ival <= (60*60)):\n /* this is less than an hour */\n $minutes = round($ival/60, 0);\n $minutes = ($minutes === 1) ? $minutes . ' minute' : $minutes . ' minutes';\n $strTime = $minutes . ' ago';\n break;\n\n\n case ($ival <= (60*60*24)):\n /* this is less than a day */ \n $strHours = explode(\".\", ($ival/(60*60)));\n $hours = ($strHours[0] === 1) ? round($strHours[0],0) . ' hour' : round($strHours[0],0) .' hours';\n $minutePercent = $strHours[1];\n $minutes = str_split($minutePercent, 2);\n $minutes = round(($minutes[0]/100)*60, 0); \n $minutes = $minutes === 1 ? $minutes .' minute' : $minutes . ' minutes'; \n $strTime = $hours . ' '. $minutes . ' ago'; \n break;\n \n\n case ($ival > (60*60*24)):\n /* this is more than a day */ \n $strDays = explode(\".\", ($ival/(60*60*24)));\n $days = ($strDays[0] === '1') ? round($strDays[0],0) . ' day' : round($strDays[0],0) .' days';\n $hourPercent = $strDays[1];\n $hours = str_split($hourPercent, 2);\n $hours = round(($hours[0]/100)*24,0);\n $hours = ($hours === 1) ? $hours . ' hour' : $hours . ' hours';\n $strTime = $days . ' ' . $hours . ' ago'; \n break; \n\n }//endswitch \n\n \n //stardard date format PHP\n } else {\n\n }\n\n $str = str_replace($m[0][$i], $strTime, $str);\n\n }//endfor\n\n } else {\n\n } \n\n return $str; \n }", "public static function parse($str) {\n if (($str === null) || ($str == '')) {\n return null;\n }\n\n $ary = explode('-', $str);\n\n $year = (integer) $ary[0];\n $month = (integer) $ary[1];\n $day = (integer) $ary[2];\n\n return new Date($year, $month, $day);\n }", "function parsedate($datestring)\r\n\t{\r\n\r\n\r\n\t}", "public function stringDateToArray($str)\n {\n $pos=strpos($str, \" \");\n $str1=substr($str, 0,$pos);\n $str2=substr($str, $pos+1);\n $arraydate=explode(\":\", $str1);\n $arrayHour=explode(\":\",$str2);\n return array(\"day\"=>$arraydate[2],\"month\"=>$arraydate[1],\"year\"=>$arraydate[0],\n \"hour\"=>$arrayHour[0],\"minute\"=>$arrayHour[1],\"second\"=>$arrayHour[2]);\n }", "public function parse($string);", "function getDateInterval($interval){\n list($length,) = explode(\".\", $interval);\n list($hour, $min, $sec) = explode(\":\", $length);\n return new DateInterval(\"PT{$hour}H{$min}M{$sec}S\");\n}", "function fromString($string)\n {\n if ($string instanceof Am_Period) {\n $this->count = $string->getCount();\n $this->unit = $string->getUnit();\n }\n $string = trim(strtolower($string));\n\n if ($string === '') {\n $this->count = $this->unit = null;\n } elseif (preg_match('/^(\\d{4}-\\d{2}-\\d{2})(fixed|lifetime|d)*$/', $string, $regs)) {\n $this->count = $regs[1];\n $this->unit = self::FIXED;\n } elseif (preg_match($regex='/^(\\d+)\\s*(|w|'.join('|', array(self::DAY, self::MONTH, self::YEAR)).')$/', $string, $regs)) {\n $this->count = intval($regs[1]);\n $this->unit = $regs[2] == '' ? self::DAY : $regs[2];\n if ($this->unit == 'w') {\n $this->count *=7 ;\n $this->unit = self::DAY;\n }\n } elseif (preg_match('/lifetime$/', $string)) {\n $this->count = self::MAX_SQL_DATE;\n $this->unit = self::FIXED;\n } else {\n throw new Am_Exception_InternalError(\"Unknown format of Am_Period string : [\".htmlentities($string).\"]\");\n }\n }", "private function parseDate($string)\n {\n $month_local = $this->i8n('local-months');\n $month_en = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ];\n\n // A date can be prfixed with some words, we remove theme\n $string = $this->removeDatePrefixes($string);\n // We translate the local months name in the english one\n $date_str = trim(str_replace($month_local, $month_en, $string));\n\n // If the date does not contain any year, we add the current year\n if (!preg_match('/[0-9]{4}/', $string)) {\n $date_str .= ' ' . date('Y');\n }\n\n // Add the Hour and minutes\n $date_str .= ' 00:00';\n $date = DateTime::createFromFormat('j F Y H:i', $date_str);\n // In some case, the date is not recognized : as a workaround the actual date is taken\n if ($date === false) {\n $date = new DateTime();\n }\n return $date->getTimestamp();\n }", "public static function parse($string)\n {\n $string = File_Therion_Line::unescape($string);\n $data = explode(' ', $string, 3);\n \n if (count($data) > 1) {\n return array(\n new File_Therion_Date($data[0]),\n // data[1] must contain a '-'\n new File_Therion_Date($data[2])\n );\n } else {\n return new File_Therion_Date($data[0]);\n }\n }", "public static function parse($str) {\n\n $expr = '/(\\d{4})-(\\d{1,2})-(\\d{1,2}) (\\d{1,2}):(\\d{1,2}):(\\d{1,2})(\\.(\\d{1,9}))?(([-+])(\\d{2}):?(\\d{2})?)/';\n if( !preg_match( $expr, $str, $matches2 ))\n return null;\n\n $sign = $matches2[10];\n $tzone_hours = $matches2[11];\n $tzone_minutes = isset( $matches2[12] ) ? $matches2[12] : 0;\n $shift = ($sign=='-' ? +1 : -1)*(3600*$tzone_hours + 60*$tzone_minutes);\n\n $local_time = strtotime( $str );\n if( !$local_time )\n return null;\n\n $gmt_time = ($local_time+$shift);\n\n $nsec = isset( $matches2[8] ) ? $matches2[8] : 0;\n\n return new LusiTime($gmt_time,$nsec);\n }", "function str2date($in){\n\n\t$t = split(\"/\",$in);\n\n\tif (count($t)!=3) return -1;\n\n\tif (!is_numeric($t[0])) return -1;\n\tif (!is_numeric($t[1])) return -2;\n\tif (!is_numeric($t[2])) return -3;\n\n\tif ($t[2]<1902 || $t[2]>2037) return -3;\n\n\treturn mktime (0,0,0, $t[1], $t[0], $t[2]);\n}", "function getSeconds($str) {\n\t\t$timeArray = explode(\":\", $str, 3);\n\n\t\t$hour = 0;\n\t\t$min = 0;\n\t\t$sec = 0;\n\n\t\tswitch(count($timeArray)) {\n\t\t\tcase 1:\n\t\t\t\t$sec = $timeArray[0];\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$min = $timeArray[0];\n\t\t\t\t$sec = $timeArray[1];\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$hour = $timeArray[0];\n\t\t\t\t$min = $timeArray[1];\n\t\t\t\t$sec = $timeArray[2];\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn ($hour * 3600) + ($min * 60) + $sec;\n\t}", "abstract public function parse($string);", "function parseCron($aStr)\n{\n\t$regex = \"~^([-0-9,/*]+)\\\\s+([-0-9,/*]+)\\\\s+([-0-9,/*]+)\\\\s+([-0-9,/*]+)\\\\s+([-0-7,/*]+|(-|/|Sun|Mon|Tue|Wed|Thu|Fri|Sat)+)\\\\s+([^#]*)\\\\s*(#.*)?$~i\";\n\tif (preg_match($regex, $aStr, $job))\n\t{\n\t\tif ($job[C_DOW][0] != '*' AND !is_numeric($job[C_DOW]))\n\t\t{\n\t\t\t$job[C_DOW] = str_replace(\n\t\t\t\tArray(\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"),\n\t\t\t\tArray(0,1,2,3,4,5,6),\n\t\t\t\t$job[C_DOW]);\n\t\t}\n\t\t$job[C_CMD] = trim($job[C_CMD]);\n\t\t$job[C_COMMENT] = isset($job[C_COMMENT]) ? trim(substr($job[C_COMMENT],1)) : false;\n\t\t$job[C_CRONLINE] = $aStr;\n\n\t\t$job[\"lastScheduled\"] = getLastScheduledRunTime($job);\n\t}\n\treturn $job;\n}", "private static function convertAgoString($string) {\n\n // Current time\n $date = new DateTime(null);\n\n if(strpos($string, 'hour') !== false) {\n\n if(strpos($string, 'hours') !== false) {\n\n $hours = substr($string, 0, -10);\n $date->modify('-' . $hours . ' hours');\n\n } else {\n\n $hour = substr($string, 0, -9);\n $date->modify('-' . $hour . ' hour');\n \n }\n\n return [$date, 'Y-m-d\\THO', []];\n // return $date->format('Y-m-d\\THO');\n\n }\n\n if(strpos($string, 'minute') !== false) {\n\n if(strpos($string, 'minutes') !== false) {\n\n $minutes = substr($string, 0, -12);\n $date->modify('-' . $minutes . ' minutes');\n\n } else {\n\n $minute = substr($string, 0, -11);\n $date->modify('-' . $minute . ' minute');\n\n }\n\n return [$date, 'Y-m-d\\TH:iO', []];\n\n // return $date->format('Y-m-d\\TH:iO');\n\n }\n\n if(strpos($string, 'second') !== false) {\n\n if(strpos($string, 'seconds') !== false) {\n\n $seconds = substr($string, 0, -12);\n $date->modify('-' . $seconds . ' seconds');\n\n } else {\n \n $second = substr($string, 0, -11);\n $date->modify('-' . $second . ' second');\n \n }\n\n return [$date, 'Y-m-d\\TH:i:sO', []];\n\n // return $date->format('Y-m-d\\TH:i:sO');\n\n }\n\n }", "public static function str2min($str)\n {\n if (!strlen($str))\n return null;\n $h = 0;\n $m = 0;\n $pos = strpos($str, ':');\n if ($pos === false)\n $h = is_numeric($str) ? intval($str) : -1;\n else\n {\n $m = substr($str, $pos + 1);\n $h = is_numeric($m) ? intval($m) : -1;\n if (($m < 0) && ($m > 59))\n return -1;\n $h = substr($str, 0, $pos);\n $h = is_numeric($h) ? intval($h) : -1;\n }\n if (($h < 0) || ($h > 23))\n return -1;\n return $h * 60 + $m;\n }", "abstract protected function get_interval();", "function dates_interconv( $date_format1, $date_format2, $date_str )\n {\n $base_struc = split('[/.-]', $date_format1);\n $date_str_parts = split('[/.-]', $date_str );\n \n //print_r( $base_struc ); echo \"<br>\";\n //print_r( $date_str_parts ); echo \"<br>\";\n \n $date_elements = array();\n \n $p_keys = array_keys( $base_struc );\n foreach ( $p_keys as $p_key )\n {\n if ( !empty( $date_str_parts[$p_key] ))\n {\n $date_elements[$base_struc[$p_key]] = $date_str_parts[$p_key];\n }\n else\n return false;\n }\n \n $dummy_ts = mktime( 0,0,0, $date_elements['m'],$date_elements['d'],$date_elements['Y']);\n \n return date( $date_format2, $dummy_ts );\n }", "function check_date($date_str)\r\n{\r\n\tif (strlen($date_str) != 10) return false;\r\n\t$pattern = \"/[0-9]{4}-[0-9]{2}-[0-9]{2}/\";\r\n\tif (!preg_match($pattern, $date_str)) return false;\r\n\t// correct format, now check ranges\r\n\treturn strtotime($date_str);\r\n}", "function explode_date($str_date)\n\t{\n\t\t$ac = 1;\n\t\tif ( substr($str_date, 0, 1) == '-' )\n\t\t{\n\t\t\t$ac = -1;\n\t\t\t$str_date = substr($str_date, 1);\n\t\t}\n\t\t$day = intval(substr($str_date, strlen($str_date) - 2));\n\t\t$str_date = substr($str_date, 0, -2);\n\t\t$month = intval(substr($str_date, strlen($str_date) - 2));\n\t\t$year = intval(substr($str_date, 0, -2));\n\t\t$xtime = array(\n\t\t\t'm' => $month,\n\t\t\t'd' => $day,\n\t\t\t'y' => $ac * $year,\n\t\t);\n\t\treturn $this->checkdate($xtime) ? $xtime : array();\n\t}", "protected function parse($str)\n {\n }", "private function formatDate($string) {\n\t\t$dateStrings = explode(\"bis\", $string);\n\t\t$date = array();\n\n\t\tforeach ($dateStrings as $dateString) {\n\t\t\t$pos = strpos($dateString, \".201\");\n\t\t\t$dateItem = explode(\".\", substr($dateString, ($pos - 6), 11));\n\n\t\t\t$dateFinal = trim($dateItem[2]) . '-' . trim($dateItem[1]) . '-' . trim($dateItem[0]);\n\t\t\tarray_push($date, $dateFinal);\n\t\t}\n\n\t\treturn $date;\n\t}", "public function parse(string $input);", "public static function fromString($string)\n {\n if (!preg_match(self::REGEXP, $string, $match)) {\n throw InvalidIntervalFormatException::create('0.0.0.0/32', $string);\n }\n\n // fill IP compact format\n $match['ip'] .= str_repeat('.0', 3 - substr_count($match['ip'], '.'));\n\n return self::fromCIDR($match['ip'], $match['cidr']);\n }", "public static function parse_str($str)\n {\n }", "protected function parsePeriod(string $line): array\n {\n // Format: 00-Aaa-0000\n $matches = [];\n $regex = \"/{$this->date_regex}/\";\n\n if (preg_match_all($regex, $line, $matches) === 2) {\n $start = DateTime::createFromFormat('d-M-Y', $matches[1][0]);\n $end = DateTime::createFromFormat('d-M-Y', $matches[1][1]);\n } else {\n throw new Exception('Invalid period.');\n }\n\n return [$start, $end];\n }", "public function convertISO8601Duration($str) {\n preg_match_all('/\\d+/', $str, $matches);\n\n for($i=1; $i<=2; $i++) {\n if(isset($matches[0][$i])) {\n if (1 === preg_match_all( '/[0-9]/', $matches[0][$i])) {\n $zeroBefore = '0'.$matches[0][$i];\n $matches[0][$i] = $zeroBefore;\n }\n }\n }\n return implode(':', $matches[0]);\n }", "function parse_date($date_in){\n $explode = explode('.', $date_in);\n\n // If not period type of date format, then try dashes\n if (count($explode) == 1) {\n $explode = explode('-', $date_in);\n }\n\n // If neither of above formats, assume special case\n if (count($explode) != 3) {\n return \"SPECIAL_CASE\";\n }\n\n $day = trim($explode[0]);\n $month = parse_month(trim($explode[1]));\n $year = trim($explode[2]);\n\n if ($month == 0) {\n return \"SPECIAL_CASE\";\n }\n\n return $year.'.'.$month.'.'.$day;\n}", "function read_e($datestr, $ref=NULL) {\n $gotit = false;\n if (preg_match('/^([0-9][0-9][0-9][0-9])-([0-9]+)-([0-9]+)$/', $datestr, $m)) {\n # Canonical (ISO 8601)\n $year = $m[1];\n $month = $m[2];\n $day = $m[3];\n $gotit = true;\n } elseif (preg_match('/^([0-9]+)[-\\/]([0-9]+)[-\\/]([0-9]+)$/', $datestr, $m)) {\n # American Style\n $year = $m[3];\n $month = $m[1];\n $day = $m[2];\n if ($day > 12) {\n $gotit = true;\n }\n else {\n return array(NULL, new Error('Ambiguous, use yyyy-mm-dd OR dd.mm.yyyy'));\n }\n } elseif (preg_match('/^([0-9]+)\\.([0-9]+)\\.([0-9]+)$/', $datestr, $m)) {\n # European Style\n $year = $m[3];\n $month = $m[2];\n $day = $m[1];\n $gotit = true;\n }\n if ($gotit) {\n if ($month < 1 or $month > 12) {\n return array(NULL, new Error('Bad month number: '.$month));\n }\n if ($day < 1 or $day > 31) {\n return array(NULL, new Error('Bad day number: '.$day));\n }\n if ($year < 60) {\n $year += 2000;\n } elseif ($year < 100) {\n $year += 1900;\n }\n if (checkdate($month, $day, $year)) {\n return array(sprintf('%04d-%02d-%02d', $year, $month, $day), NULL);\n } else {\n return array(NULL, new Error('Invalid date, check your calendar'));\n }\n }\n if ($ref !== NULL) {\n list($ref, $err) = Date::read_e($ref);\n if ($err) {\n return array(NULL, $err);\n }\n } else {\n $ref = date('Y-m-d');\n }\n if ($datestr == 'today' or $datestr == 'now') {\n return array($ref, NULL);\n } elseif ($datestr == 'yesterday') {\n return array(Date::addDays($ref, -1), NULL);\n } elseif ($datestr == 'tomorrow') {\n return array(Date::addDays($ref, 1), NULL);\n } else {\n return array(NULL, new Error('Invalid date format'));\n }\n }", "private static function convertSearchDateString($string) {\n\n if(preg_match('/(?:^|\\s|$)\\d{2}-\\d{2}-\\d{2}(?:^|\\s|$)/', $string, $matches)) {\n\n // MM-DD-YY\n if(substr($matches[0], 6, 2) > 30) {\n $date = DateTime::createFromFormat('m-d-Y', substr($matches[0], 0, 6) . '19' . substr($matches[0], 6, 2));\n } else {\n $date = DateTime::createFromFormat('m-d-Y', substr($matches[0], 0, 6) . '20' . substr($matches[0], 6, 2));\n }\n\n return [$date, 'Y-m-d', []];\n // return $date->format('Y-m-d');\n\n } else if(preg_match('/(?:^|\\s|$)\\d{2}-\\d{2}-\\?\\?(?:^|\\s|$)/', $string, $matches)) {\n\n // MM-DD-??\n $date = DateTime::createFromFormat('m-d', substr($matches[0], 0, 5));\n\n return [$date, '', [\n 'Y' => null\n ]];\n\n } else if(preg_match('/(?:^|\\s|$)\\d{2}-\\?\\?-\\d{2}(?:^|\\s|$)/', $string, $matches)) {\n\n // MM-??-YY\n if(substr($matches[0], 6, 2) > 30) {\n $date = DateTime::createFromFormat('mY', substr($matches[0], 0, 2) . '19' . substr($matches[0], 6, 2));\n } else {\n $date = DateTime::createFromFormat('mY', substr($matches[0], 0, 2) . '20' . substr($matches[0], 6, 2));\n }\n\n return [$date, 'Y-m', [\n 'd' => null\n ]];\n\n } else if(preg_match('/(?:^|\\s|$)\\d{2}-\\?\\?-\\?\\?(?:^|\\s|$)/', $string, $matches)) {\n\n // MM-??-??\n $date = DateTime::createFromFormat('m', substr($matches[0], 0, 2));\n\n return [$date, '', [\n 'Y' => null,\n 'd' => null\n ]];\n\n } else if(preg_match('/(?:^|\\s|$)\\?\\?-\\d{2}-\\d{2}(?:^|\\s|$)/', $string, $matches)) {\n\n // ??-DD-YY\n if(substr($matches[0], 6, 2) > 30) { \n $date = DateTime::createFromFormat('dY', substr($matches[0], 3, 2) . '19' . substr($matches[0], 6, 2));\n } else {\n $date = DateTime::createFromFormat('dY', substr($matches[0], 3, 2) . '20' . substr($matches[0], 6, 2));\n }\n \n return [$date, 'Y', [\n 'm' => null\n ]];\n\n } else if(preg_match('/(?:^|\\s|$)\\?\\?-\\d{2}-\\?\\?(?:^|\\s|$)/', $string, $matches)) {\n\n // ??-DD-??\n $date = DateTime::createFromFormat('d', substr($matches[0], 3, 2));\n\n return [$date, '', [\n 'Y' => null,\n 'm' => null\n ]];\n\n } else if(preg_match('/(?:^|\\s|$)\\?\\?-\\?\\?-\\d{2}(?:^|\\s|$)/', $string, $matches)) {\n\n // ??-??-YY\n if(substr($matches[0], 6, 2) > 30) {\n $date = DateTime::createFromFormat('Y', '19' . substr($matches[0], 6, 2));\n } else {\n $date = DateTime::createFromFormat('Y', '20' . substr($matches[0], 6, 2));\n }\n\n return [$date, 'Y', [\n 'm' => null,\n 'd' => null\n ]];\n\n } else if(preg_match('/(?:^|\\s|$)\\?\\?-\\?\\?-\\?\\?(?:^|\\s|$)/', $string, $matches)) {\n\n // ??-??-??\n return [null, null, []];\n\n }\n\n return [null, null, []];\n \n }", "function aggregator_parse_w3cdtf($date_str) {\n if (preg_match('/(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})(:(\\d{2}))?(?:([-+])(\\d{2}):?(\\d{2})|(Z))?/', $date_str, $match)) {\n list($year, $month, $day, $hours, $minutes, $seconds) = array($match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);\n // calc epoch for current date assuming GMT\n $epoch = gmmktime($hours, $minutes, $seconds, $month, $day, $year);\n if ($match[10] != 'Z') { // Z is zulu time, aka GMT\n list($tz_mod, $tz_hour, $tz_min) = array($match[8], $match[9], $match[10]);\n // zero out the variables\n if (!$tz_hour) {\n $tz_hour = 0;\n }\n if (!$tz_min) {\n $tz_min = 0;\n }\n $offset_secs = (($tz_hour * 60) + $tz_min) * 60;\n // is timezone ahead of GMT? then subtract offset\n if ($tz_mod == '+') {\n $offset_secs *= -1;\n }\n $epoch += $offset_secs;\n }\n return $epoch;\n }\n else {\n return -1;\n }\n}", "public function parse($durationString)\n {\n $matches = array();\n $status = preg_match(self::$DURATION_PATTERN, $durationString, $matches);\n if ($status === false) {\n throw new \\Exception(\"Malformed simple date string {$durationString} must be P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]\");\n }\n $this->year = $this->grabInt($matches, 1);\n $this->month = $this->grabInt($matches, 2);\n $this->day = $this->grabInt($matches, 3);\n $this->hour = $this->grabInt($matches, 4);\n $this->minute = $this->grabInt($matches, 5);\n $this->second = $this->grabInt($matches, 6);\n }", "function valid_date($str) \n\t{\n\t\t//if (ereg(\"([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})\", $str)) {\n\t\tif (preg_match(\"/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/\", $str)) \n\t\t{\n\t\t\t//$arr = split(\"-\", $str);\n\t\t\t$arr = preg_split(\"/-/\", $str);\n\t\t\t$yyyy = (int) $arr[0];\n\t\t\t$mm = (int) $arr[1];\n\t\t\t$dd = (int) $arr[2];\n\t\t\treturn checkdate($mm, $dd, $yyyy);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function stringToDateTime($string) {}", "function extract_date_from_str($date) {\n\t\t$year = substr($date, 0, 4);\n\t\t$month = substr($date, 4, 2);\n\t\t$day = substr($date, 6, 2);\n\n\t\t$hour = substr($date, 9, 2);\n\t\t$minutes = substr($date, 11, 2);\n\t\t$seconds = substr($date, 13, 2);\n\n\t\treturn $year . \"/\" . $month . \"/\" . $day . \"_\" . $hour . \":\" . $minutes . \":\" . $seconds;\n\t}", "private function parse($source) {\n\t\t$this->source = $source;\n\n\t\t// Interval counter.\n\t\t$i = 0;\n\n\t\t/*\n\t\t * Empty string means value is ommited (not entered yet). Some values are not allowed to be empty or too large.\n\t\t * For example week days can only be one character. Months, hours, minutes are either one or two characters.\n\t\t * If more are entered, parser will raise and error.\n\t\t */\n\t\t$month_day_from = '';\n\t\t$month_day_till = '';\n\t\t$month_day_step = '';\n\t\t$week_day_from = '';\n\t\t$week_day_till = '';\n\t\t$week_day_step = '';\n\t\t$hours_from = '';\n\t\t$hours_till = '';\n\t\t$hour_step = '';\n\t\t$minutes_from = '';\n\t\t$minutes_till = '';\n\t\t$minute_step = '';\n\t\t$seconds_from = '';\n\t\t$seconds_till = '';\n\t\t$second_step = '';\n\n\t\t// Each month, week, hour, minute and second can have multiple <from's> and <to's> separated by a comma.\n\t\t$months = 0;\n\t\t$weeks = 0;\n\t\t$hours = 0;\n\t\t$minutes = 0;\n\t\t$seconds = 0;\n\n\t\t$state = self::STATE_NEW;\n\n\t\twhile (isset($this->source[$this->pos])) {\n\t\t\tif (!array_key_exists($i, $this->intervals)) {\n\t\t\t\t$this->intervals[$i] = [];\n\t\t\t}\n\n\t\t\tswitch ($state) {\n\t\t\t\tcase self::STATE_NEW:\n\t\t\t\t\t/*\n\t\t\t\t\t * Depending on first character in each interval, if it's a number, parse it as flexible interval.\n\t\t\t\t\t * Otherwise parse it as scheduling interval.\n\t\t\t\t\t */\n\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t$this->intervals[$i] = [\n\t\t\t\t\t\t\t'interval' => $this->source[$this->pos],\n\t\t\t\t\t\t\t'type' => ITEM_DELAY_FLEX_TYPE_FLEXIBLE,\n\t\t\t\t\t\t\t'delay' => $this->source[$this->pos],\n\t\t\t\t\t\t\t'period' => ''\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$state = self::STATE_FLEXIBLE_INTERVAL;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->intervals[$i]['type'] = ITEM_DELAY_FLEX_TYPE_SCHEDULING;\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Determine the time unit:\n\t\t\t\t\t\t * md - month days\n\t\t\t\t\t\t * wd - week days\n\t\t\t\t\t\t * h - hours\n\t\t\t\t\t\t * m - minutes\n\t\t\t\t\t\t * s - seconds\n\t\t\t\t\t\t */\n\t\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\t\t// At this point it can be minutes or month days, so check the next character.\n\t\t\t\t\t\t\t\tif (isset($this->source[$this->pos + 1])) {\n\t\t\t\t\t\t\t\t\tif ($this->source[$this->pos + 1] === 'd') {\n\t\t\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] = 'md';\n\t\t\t\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months] = [\n\t\t\t\t\t\t\t\t\t\t\t'from' => '',\n\t\t\t\t\t\t\t\t\t\t\t'till' => '',\n\t\t\t\t\t\t\t\t\t\t\t'step' => ''\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MONTH_FROM;\n\n\t\t\t\t\t\t\t\t\t\t$this->pos++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] = 'm';\n\t\t\t\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = [\n\t\t\t\t\t\t\t\t\t\t\t'from' => '',\n\t\t\t\t\t\t\t\t\t\t\t'till' => '',\n\t\t\t\t\t\t\t\t\t\t\t'step' => ''\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'w':\n\t\t\t\t\t\t\t\tif (isset($this->source[$this->pos + 1]) && $this->source[$this->pos + 1] === 'd') {\n\t\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] = 'wd';\n\t\t\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_FROM;\n\n\t\t\t\t\t\t\t\t\t$this->pos++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] = 'h';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] = 's';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t// Invalid first character.\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_FLEXIBLE_INTERVAL:\n\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $this->source[$this->pos];\n\t\t\t\t\t\t$this->intervals[$i]['delay'] .= $this->source[$this->pos];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($this->source[$this->pos] === '/') {\n\t\t\t\t\t\t$this->intervals[$i]['interval'] .= '/';\n\t\t\t\t\t\t$state = self::STATE_FLEXIBLE_PERIOD;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_FLEXIBLE_PERIOD:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (strlen($week_day_from) != 1 || strlen($week_day_till) > 1\n\t\t\t\t\t\t\t\t\t|| $this->source[$this->pos - 2] !== '/') {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (strlen($week_day_from) != 1\n\t\t\t\t\t\t\t\t\t|| (strlen($week_day_from) == 1 && strlen($week_day_till) > 1)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (strlen($week_day_till)) {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.'-'.$week_day_till.',';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['period'] .= $week_day_from.'-'.$week_day_till.',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.',';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['period'] .= $week_day_from.',';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$state = self::STATE_FLEXIBLE_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\tif (strlen($week_day_from)) {\n\t\t\t\t\t\t\t\t\t$week_day_till = $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\t\tif (strlen($week_day_till) != 1 || $this->source[$this->pos - 1] !== '-') {\n\t\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$week_day_from = $this->source[$this->pos];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_FLEXIBLE_HOUR_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ':':\n\t\t\t\t\t\t\tif (strlen($hours_from) != 1 && strlen($hours_from) != 2) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from.':';\n\t\t\t\t\t\t\t$this->intervals[$i]['period'] .= $hours_from.':';\n\n\t\t\t\t\t\t\t$state = self::STATE_FLEXIBLE_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$hours_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($hours_from) != 1 && strlen($hours_from) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_FLEXIBLE_MINUTE_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (strlen($minutes_from) != 2) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_from.'-';\n\t\t\t\t\t\t\t$this->intervals[$i]['period'] .= $minutes_from.'-';\n\n\t\t\t\t\t\t\t$state = self::STATE_FLEXIBLE_HOUR_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$minutes_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($minutes_from) != 1 && strlen($minutes_from) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_FLEXIBLE_HOUR_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ':':\n\t\t\t\t\t\t\tif (strlen($hours_till) != 1 && strlen($hours_till) != 2) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till.':';\n\t\t\t\t\t\t\t$this->intervals[$i]['period'] .= $hours_till.':';\n\n\t\t\t\t\t\t\t$state = self::STATE_FLEXIBLE_MINUTE_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$hours_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($hours_till) != 1 && strlen($hours_till) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_FLEXIBLE_MINUTE_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (strlen($minutes_till) != 2) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['period'] .= $minutes_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$minutes_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($minutes_till) != 1 && strlen($minutes_till) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_MONTH_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$months = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\t// Step can be entered of first month day is ommited.\n\t\t\t\t\t\t\tif (strlen($month_day_from) == 0) {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= '/';\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MONTH_STEP;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from.'-';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MONTH_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$months++;\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'w':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($this->source[$this->pos + 1] === 'd') {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from.'wd';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\t\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_FROM;\n\n\t\t\t\t\t\t\t\t$this->pos++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from.'h';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingMonthFrom($month_day_from)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$month_day_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($month_day_from) != 1 && strlen($month_day_from) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_MONTH_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$months = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MONTH_FROM;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$months++;\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\t// Step can be entered of first week day is ommited.\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till.'/';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MONTH_STEP;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'w':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($this->source[$this->pos + 1] === 'd') {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till.'wd';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\t\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_FROM;\n\n\t\t\t\t\t\t\t\t$this->pos++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till.'h';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingMonthTo($month_day_till)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$month_day_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($month_day_till) != 1 && strlen($month_day_till) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_MONTH_STEP:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthStep($month_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthStep($month_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MONTH_FROM;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months++;\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'w':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingMonthStep($month_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($this->source[$this->pos + 1] === 'd') {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step.'wd';\n\t\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\t\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_FROM;\n\n\t\t\t\t\t\t\t\t$this->pos++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthStep($month_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step.'h';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingMonthStep($month_day_step)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingMonthStep($month_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$month_day_step .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($month_day_step) != 1 && strlen($month_day_step) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_WEEK_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekFrom($week_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (strlen($week_day_from) == 0) {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= '/';\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_STEP;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekFrom($week_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.'-';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekFrom($week_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$weeks++;\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekFrom($week_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.'h';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingWeekFrom($week_day_from)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekFrom($week_day_from)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$week_day_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($week_day_from) != 1) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_WEEK_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekTo($week_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekTo($week_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_FROM;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$weeks++;\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekTo($week_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till.'/';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_STEP;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekTo($week_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till.'h';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingWeekTo($week_day_till)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekTo($week_day_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$week_day_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($week_day_till) != 1) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_WEEK_STEP:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekStep($week_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['step'] .= $week_day_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekStep($week_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_step.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['step'] .= $week_day_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_WEEK_FROM;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks++;\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekStep($week_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_step.'h';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['step'] .= $week_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingWeekStep($week_day_step)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_step.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['step'] .= $week_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingWeekStep($week_day_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_step.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['wd'][$weeks]['step'] .= $week_day_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$week_day_step .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($week_day_step) != 1) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_HOUR_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($hours_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['from'] .= $hours_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\t// Step can be entered of first hour is ommited.\n\t\t\t\t\t\t\tif (strlen($hours_from) == 0) {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= '/';\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_STEP;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($hours_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from.'-';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['from'] .= $hours_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($hours_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['from'] .= $hours_from;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours++;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingTimeFrom($hours_from, $state)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['from'] .= $hours_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($hours_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['from'] .= $hours_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$hours_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($hours_from) != 1 && strlen($hours_from) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_HOUR_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($hours_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['till'] .= $hours_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hours = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($hours_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['till'] .= $hours_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hours++;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($hours_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till.'/';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['till'] .= $hours_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_STEP;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingTimeTo($hours_till)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['till'] .= $hours_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($hours_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['till'] .= $hours_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$hours_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($hours_till) != 1 && strlen($hours_till) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_HOUR_STEP:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($hour_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hour_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['step'] .= $hour_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($hour_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hour_step.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['step'] .= $hour_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_HOUR_FROM;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours++;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\tif (!isset($this->source[$this->pos + 1])\n\t\t\t\t\t\t\t\t\t|| !$this->validateSchedulingTimeStep($hour_step)\n\t\t\t\t\t\t\t\t\t|| ($this->source[$this->pos + 1] !== '/'\n\t\t\t\t\t\t\t\t\t\t&& !is_numeric($this->source[$this->pos + 1]))) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hour_step.'m';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['step'] .= $hour_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($hour_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $hour_step.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$hours]['step'] .= $hour_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$hour_step .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($hour_step) != 1 && strlen($hour_step) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_MINUTE_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($minutes_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['h'][$minutes]['from'] .= $minutes_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (strlen($minutes_from) == 0) {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= '/';\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_STEP;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($minutes_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_from.'-';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['from'] .= $minutes_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($minutes_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_from.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['from'] .= $minutes_from;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes++;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($minutes_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_from.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['from'] .= $minutes_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$minutes_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($minutes_from) != 1 && strlen($minutes_from) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_MINUTE_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($minutes_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['till'] .= $minutes_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minutes = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($minutes_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['till'] .= $minutes_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minutes++;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($minutes_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till.'/';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['till'] .= $minutes_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_STEP;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($minutes_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['till'] .= $minutes_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$minutes_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($minutes_till) != 1 && strlen($minutes_till) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_MINUTE_STEP:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($minute_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minute_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['step'] .= $minute_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minute_step = '';\n\t\t\t\t\t\t\t$minutes = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($minute_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minute_step.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['step'] .= $minute_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_MINUTE_FROM;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minute_step = '';\n\t\t\t\t\t\t\t$minutes++;\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($minute_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $minute_step.'s';\n\t\t\t\t\t\t\t$this->intervals[$i]['m'][$minutes]['step'] .= $minute_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$minute_step .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($minute_step) != 1 && strlen($minute_step) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_SECOND_FROM:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($seconds_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_from;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['from'] .= $seconds_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minute_step = '';\n\t\t\t\t\t\t\t$minutes = 0;\n\n\t\t\t\t\t\t\t$seconds_from = '';\n\t\t\t\t\t\t\t$seconds = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (strlen($seconds_from) == 0) {\n\t\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= '/';\n\n\t\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_STEP;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '-':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($seconds_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_from.'-';\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['from'] .= $seconds_from;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_TILL;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeFrom($seconds_from, $state)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_from.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['from'] .= $seconds_from;\n\n\t\t\t\t\t\t\t$seconds_from = '';\n\t\t\t\t\t\t\t$seconds++;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$seconds_from .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($seconds_from) != 1 && strlen($seconds_from) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_SECOND_TILL:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($seconds_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_till;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['till'] .= $seconds_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minute_step = '';\n\t\t\t\t\t\t\t$minutes = 0;\n\n\t\t\t\t\t\t\t$seconds_from = '';\n\t\t\t\t\t\t\t$seconds_till = '';\n\t\t\t\t\t\t\t$seconds = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($seconds_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_till.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['till'] .= $seconds_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\n\t\t\t\t\t\t\t$seconds_from = '';\n\t\t\t\t\t\t\t$seconds_till = '';\n\t\t\t\t\t\t\t$seconds++;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeTo($seconds_till)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_till.'/';\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['till'] .= $seconds_till;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_STEP;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$seconds_till .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($seconds_till) != 1 && strlen($seconds_till) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::STATE_SCHEDULING_SECOND_STEP:\n\t\t\t\t\tswitch ($this->source[$this->pos]) {\n\t\t\t\t\t\tcase ';':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($second_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $second_step;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['step'] .= $second_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_NEW;\n\n\t\t\t\t\t\t\t$i++;\n\n\t\t\t\t\t\t\t$month_day_from = '';\n\t\t\t\t\t\t\t$month_day_till = '';\n\t\t\t\t\t\t\t$month_day_step = '';\n\t\t\t\t\t\t\t$months = 0;\n\n\t\t\t\t\t\t\t$week_day_from = '';\n\t\t\t\t\t\t\t$week_day_till = '';\n\t\t\t\t\t\t\t$week_day_step = '';\n\t\t\t\t\t\t\t$weeks = 0;\n\n\t\t\t\t\t\t\t$hours_from = '';\n\t\t\t\t\t\t\t$hours_till = '';\n\t\t\t\t\t\t\t$hour_step = '';\n\t\t\t\t\t\t\t$hours = 0;\n\n\t\t\t\t\t\t\t$minutes_from = '';\n\t\t\t\t\t\t\t$minutes_till = '';\n\t\t\t\t\t\t\t$minute_step = '';\n\t\t\t\t\t\t\t$minutes = 0;\n\n\t\t\t\t\t\t\t$seconds_from = '';\n\t\t\t\t\t\t\t$seconds_till = '';\n\t\t\t\t\t\t\t$second_step = '';\n\t\t\t\t\t\t\t$seconds = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ',':\n\t\t\t\t\t\t\tif (!$this->validateSchedulingTimeStep($second_step)) {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->intervals[$i]['interval'] .= $second_step.',';\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds]['step'] .= $second_step;\n\n\t\t\t\t\t\t\t$state = self::STATE_SCHEDULING_SECOND_FROM;\n\n\t\t\t\t\t\t\t$seconds_from = '';\n\t\t\t\t\t\t\t$seconds_till = '';\n\t\t\t\t\t\t\t$second_step = '';\n\t\t\t\t\t\t\t$seconds++;\n\t\t\t\t\t\t\t$this->intervals[$i]['s'][$seconds] = ['from' => '', 'till' => '', 'step' => ''];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (is_numeric($this->source[$this->pos])) {\n\t\t\t\t\t\t\t\t$second_step .= $this->source[$this->pos];\n\n\t\t\t\t\t\t\t\tif (strlen($second_step) != 1 && strlen($second_step) != 2) {\n\t\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$this->setError();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->pos++;\n\t\t}\n\n\t\t// String can end at any state. Validate the last entered characters depeding on the last state once more.\n\t\tswitch ($state) {\n\t\t\tcase self::STATE_FLEXIBLE_MINUTE_TILL:\n\t\t\t\tif (strlen($minutes_till) != 2) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till;\n\t\t\t\t$this->intervals[$i]['period'] .= $minutes_till;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_MONTH_FROM:\n\t\t\t\tif (!$this->validateSchedulingMonthFrom($month_day_from)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_from;\n\t\t\t\t$this->intervals[$i]['md'][$months]['from'] .= $month_day_from;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_MONTH_TILL:\n\t\t\t\tif (!$this->validateSchedulingMonthTo($month_day_till)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_till;\n\t\t\t\t$this->intervals[$i]['md'][$months]['till'] .= $month_day_till;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_MONTH_STEP:\n\t\t\t\tif (!$this->validateSchedulingMonthStep($month_day_step)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $month_day_step;\n\t\t\t\t$this->intervals[$i]['md'][$months]['step'] .= $month_day_step;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_WEEK_FROM:\n\t\t\t\tif (!$this->validateSchedulingWeekFrom($week_day_from)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_from;\n\t\t\t\t$this->intervals[$i]['wd'][$weeks]['from'] .= $week_day_from;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_WEEK_TILL:\n\t\t\t\tif (!$this->validateSchedulingWeekTo($week_day_till)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_till;\n\t\t\t\t$this->intervals[$i]['wd'][$weeks]['till'] .= $week_day_till;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_WEEK_STEP:\n\t\t\t\tif (!$this->validateSchedulingWeekStep($week_day_step)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $week_day_step;\n\t\t\t\t$this->intervals[$i]['wd'][$weeks]['step'] .= $week_day_step;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_HOUR_FROM:\n\t\t\t\tif (!$this->validateSchedulingTimeFrom($hours_from, $state)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $hours_from;\n\t\t\t\t$this->intervals[$i]['h'][$hours]['from'] .= $hours_from;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_HOUR_TILL:\n\t\t\t\tif (!$this->validateSchedulingTimeTo($hours_till)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $hours_till;\n\t\t\t\t$this->intervals[$i]['h'][$hours]['till'] .= $hours_till;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_HOUR_STEP:\n\t\t\t\tif (!$this->validateSchedulingTimeStep($hour_step)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $hour_step;\n\t\t\t\t$this->intervals[$i]['h'][$hours]['step'] .= $hour_step;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_MINUTE_FROM:\n\t\t\t\tif (!$this->validateSchedulingTimeFrom($minutes_from, $state)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_from;\n\t\t\t\t$this->intervals[$i]['m'][$minutes]['from'] .= $minutes_from;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_MINUTE_TILL:\n\t\t\t\tif (!$this->validateSchedulingTimeTo($minutes_till)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $minutes_till;\n\t\t\t\t$this->intervals[$i]['m'][$minutes]['till'] .= $minutes_till;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_MINUTE_STEP:\n\t\t\t\tif (!$this->validateSchedulingTimeStep($minute_step)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $minute_step;\n\t\t\t\t$this->intervals[$i]['m'][$minutes]['step'] .= $minute_step;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_SECOND_FROM:\n\t\t\t\tif (!$this->validateSchedulingTimeFrom($seconds_from, $state)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_from;\n\t\t\t\t$this->intervals[$i]['s'][$seconds]['from'] .= $seconds_from;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_SECOND_TILL:\n\t\t\t\tif (!$this->validateSchedulingTimeTo($seconds_till)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $seconds_till;\n\t\t\t\t$this->intervals[$i]['s'][$seconds]['till'] .= $seconds_till;\n\t\t\t\tbreak;\n\n\t\t\tcase self::STATE_SCHEDULING_SECOND_STEP:\n\t\t\t\tif (!$this->validateSchedulingTimeStep($second_step)) {\n\t\t\t\t\t$this->setError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this->intervals[$i]['interval'] .= $second_step;\n\t\t\t\t$this->intervals[$i]['s'][$seconds]['step'] .= $second_step;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->setError();\n\t\t\t\treturn;\n\t\t}\n\n\t\t$this->is_valid = true;\n\t}", "public function parse(string $string): array;", "function aDate($string){\n\n\n\t\t}", "public function dayIndex($str)\n\t{\n\t\t$str = preg_replace(\"/[^A-Z]/i\",\"\", trim($str));\n\t\tif (isset($this->dayTokenMap[$str]))\n\t\t{\n\t\t\treturn $this->dayTokenMap[$str];\n\t\t}\n\t\treturn 0;\n\t}", "public function checkIntervalFormat($interval)\n {\n $first = '\\s*\\-?\\d+\\s*';\n $int = '\\s*\\d+\\s*';\n return preg_match(\"~^\\s*((?:\\-?\\s*(?:\\d*\\.?\\d+|\\d+\\.?\\d*)(?:e[\\+\\-]?\\d+)?)\\s+(MICROSECOND|SECOND|MINUTE|HOUR|DAY|WEEK|MONTH|QUARTER|YEAR)\"\n . \"|\\'$first.$int\\'\\s*(SECOND|MINUTE|HOUR|DAY)_MICROSECOND\"\n . \"|\\'$first:$int\\'\\s*(MINUTE_SECOND|HOUR_SECOND)\"\n . \"|\\'$first $first\\'\\s*DAY_HOUR\"\n . \"|\\'$int-$int\\'\\s*YEAR_MONTH\"\n . \"|\\'$int:$int:$int\\'\\s*HOUR_SECOND\"\n . \"|\\'$first $int:$int\\'\\s*DAY_MINUTE\"\n . \"|\\'$first $int:$int:$int\\'\\s*DAY_SECOND\"\n . \")\\s*\\$~i\", $interval);\n }", "public static function parse(string $string): self;", "protected function parseInnerDate($dateString)\n {\n // 2016-08-08 14:49:34\n // Timezone is Europe/London\n \n $date = Carbon::createFromFormat(\"Y-m-d H:i:s\", $dateString, new \\DateTimeZone('Europe/London'));\n\n return $date;\n }", "private function _expandRanges($str)\n {\n if (strstr($str, \",\"))\n {\n $arParts = explode(',', $str);\n foreach ($arParts AS $part)\n {\n if (strstr($part, '-'))\n {\n $arRange = explode('-', $part);\n for ($i = $arRange[0]; $i <= $arRange[1]; $i++)\n {\n $ret[] = $i;\n }\n }\n else\n {\n $ret[] = $part;\n }\n }\n }\n elseif (strstr($str, '-'))\n {\n $arRange = explode('-', $str);\n for ($i = $arRange[0]; $i <= $arRange[1]; $i++)\n {\n $ret[] = $i;\n }\n }\n else\n {\n $ret[] = $str;\n }\n\n $ret = array_unique($ret);\n sort($ret);\n\n return $ret;\n }", "function mysql_to_date ($datestr) {\n\t\t$tempDate=array(substr($datestr,0,4),substr($datestr,4,2),substr($datestr,6,2));\n\t\t$tempTime=array(substr($datestr,8,2),substr($datestr,10,2),substr($datestr,12,2));\n\t\t$datestr=implode(\"-\",$tempDate).\" \".implode(\":\",$tempTime);\n\t\treturn $datestr;\n\t}", "function T10DateCalc($dateString){\n\t\t\t$this->_time = strtotime($dateString); // membuat unix tanggal dengan fungsi strtotime\n\t\t\t$this->_d = date('d',$this->_time); // ambil data Hari dari unix format\n\t\t\t$this->_m = date('m',$this->_time); // ambil data Bulan dari unix format\n\t\t\t$this->_y = date('Y',$this->_time); // ambil data Tahun dari unix format\n\t\t\t$this->_h = date('H',$this->_time); // ambil data Jam dari unix format\n\t\t\t$this->_i = date('i',$this->_time); // ambil data Menit dari unix format\n\t\t\t$this->_s = date('s',$this->_time); // ambil data Detik dari unix format\n\t\t}", "protected static function parse_cron_num($s, $min, $max)\n {\n $result = array();\n $v = explode(',', $s);\n foreach ($v as $vv)\n {\n $vvv = explode('/', $vv);\n $step = empty($vvv[1]) ? 1 : $vvv[1];\n $vvvv = explode('-', $vvv[0]);\n $_min = count($vvvv) == 2 ? $vvvv[0] : ($vvv[0] == '*' ? $min : $vvv[0]);\n $_max = count($vvvv) == 2 ? $vvvv[1] : ($vvv[0] == '*' ? $max : $vvv[0]);\n for ($i = $_min; $i <= $_max; $i += $step)\n {\n $result[$i] = intval($i);\n }\n }\n ksort($result);\n return $result;\n }", "public static function parseAISDateTime($str)\r\n {\r\n // Pozn. strptime() nefunguje na windowse, preto pouzijeme regex\r\n $pattern =\r\n '@(?P<tm_mday>[0-3][0-9])\\.(?P<tm_mon>[0-1][0-9])\\.(?P<tm_year>20[0-9][0-9])'.\r\n ' (?P<tm_hour>[0-2][0-9]):(?P<tm_min>[0-5][0-9]*)@';\r\n $datum = StrUtil::matchAll($pattern, $str);\r\n if (!$datum) {\r\n throw new Exception(\"Chyba pri parsovaní dátumu a času\");\r\n }\r\n \r\n return mktime($datum[\"tm_hour\"],$datum[\"tm_min\"],0,\r\n $datum[\"tm_mon\"],$datum[\"tm_mday\"],$datum[\"tm_year\"]);\r\n }", "private function __parseDate($date) {\n\t\treturn strtotime(str_replace('/', '-', $date));\n\t}", "function expand_interval_tags($raw) {\n static $filter = null;\n\n if (is_null($filter)) {\n $filter = new model\\IntervalFilter($this->_content);\n }\n\n // find any tags\n preg_match_all($this->term['interval_tok'], $raw, $matches, PREG_SET_ORDER);\n // do they match a time period?\n foreach ($matches as $match) {\n $orig_tag = $match[0];\n $date = $filter->interval_as_date($orig_tag);\n if ($date !== false) {\n $raw = preg_replace('/' . $orig_tag . '/', $this->term['tag_prefix'] . strftime(\\tpp\\config('date_format'), $date[1]), $raw);\n }\n }\n return $raw;\n }", "function DateStrToInt ($s, $h,$n,$z) {\n\tGlobal $iTimeType;\n\t\n\t$y = (int)substr($s, 0, 4);\t\t// year\n\t$m = (int)substr($s, 5, 2);\t\t// month\n\t$d = (int)substr($s, 8, 2);\t\t// day\n\t\n\tif ($m < 1) $m = 1;\n\tif (12 < $m) $m = 12;\n\tif ($d < 1) $d = 1;\n\tif (31 < $d) $d = 31;\n\tif ($h < 0) $h = 0;\n\tif (23 < $h) $h = 23;\n\tif ($n < 0) $n = 0;\n\tif (59 < $n) $n = 59;\n\t\n\tif ($iTimeType == 1) {\n\t\tif ($y < 1970) $y = 1970;\n\t\tif (2037 < $y) $y = 2037;\n\t\tif ($z < 0) $z = 0;\n\t\tif (59 < $z) $z = 59;\n\t\treturn mktime($h,$n,$z,$m,$d,$y);\n\t}\n\t\n\t$y -= 2000;\n\tif ($y < 0) $y = 0;\n\tif (213 < $y) $y = 213;\n\treturn $y*10000000+(50+$m*50+$d)*10000 + ($h*100) + $n;\n}", "function _date_diff($start, $end){\n $end = $end ? $end : date();\n \n $start = ($start instanceof DateTime) ? $start->format('Y-m-d H:i:s') : $start;\n $end = ($end instanceof DateTime) ? $end->format('Y-m-d H:i:s') : $end;\n \n $inv = $start > $end;\n $max = max($start, $end);\n $start = min($start, $end);\n $end = $max;\n \n $diff = strtotime($end) - strtotime($start);\n \n $interval = array();\n \n $interval['y'] = substr($end,0,4) - substr($start,0,4);\n $interval['m'] = substr($end,5,2) - substr($start,5,2);\n $interval['d'] = substr($end,8,2) - substr($start,8,2);\n $interval['h'] = substr($end,11,2) - substr($start,11,2);\n $interval['i'] = substr($end,14,2) - substr($start,14,2);\n $interval['s'] = substr($end,17,2) - substr($start,17,2);\n $interval['invert'] = $inv;\n \n // 1. При переходе с летнего времени на зимнее и наоборот возможны чудеса\n // 2. PHP5.3.2 вылетает с Fatal error при попытке изменить поле DateInterval::days\n // $interval['days'] = floor((strtotime($end) - strtotime($start)) / 86400);\n \n _date_diff_normalize($interval, substr($start,0,4), substr($start,5,2));\n \n $result = new DateInterval('P0Y');\n foreach ($interval as $key => $value){\n $result->{$key} = $value;\n }\n \n return $result;\n}", "protected function timeStringToDateInterval($timeString)\n {\n try {\n return new DateInterval(\n preg_replace(\n '/(\\d{2}):(\\d{2}):(\\d{2}).*/',\n 'PT$1H$2M$3S',\n $timeString\n )\n );\n } catch (Exception $e) {\n throw new InvalidArgumentException('Timestring is not a valid interval');\n }\n }", "public function testParseReturnsSelfIfIntervalIsValid()\n {\n $expected = (new Interval())\n ->setIsLowerInclusive(true)\n ->setLower(1)\n ->setUpper(2)\n ->setIsUpperInclusive(false);\n \n $actual = (new Interval())->parse('[1, 2)');\n \n $this->assertEquals($expected, $actual);\n \n return;\n }", "public static function fromString(string $str): self\n {\n $date = new DateTime($str);\n return new static($date);\n }", "private function GetUanicDate(&$s, &$res) {\n $s = $this->substr($s, 0, 8);\t \n\tif ($s && (strlen($s) == 8) && @is_numeric($s)) {\n\t $res = @substr_replace(@substr_replace($s, \"-\", 4,0), \"-\", 7, 0);\n }\n }", "public static function dateDiff($start, $end, $string=\"Day(s)\") {\n $dateStart = new \\DateTime($start);\n $dateEnd = new \\DateTime($end);\n $diff = $dateEnd->diff($dateStart)->format(\"%a \".$string);\n return $diff;\n }", "public function parseDate($string = null)\n {\n if ($string == null) {\n return null;\n }\n\n return Carbon::parse($string);\n }", "public function until(DateInterval|string|int $interval): self;", "public function parse(string $value);", "public static function convert($string) {\n \n if(strpos($string, 'Now') !== false) {\n\n list($date, $format, $exceptions) = self::convertNowString($string);\n\n } else if(strpos($string, 'Today') !== false) {\n\n list($date, $format, $exceptions) = self::convertTodayString($string);\n\n } else if(strpos($string, 'Yesterday') !== false) {\n\n list($date, $format, $exceptions) = self::convertYesterdayString($string);\n\n } else if(strpos($string, 'ago') !== false) {\n\n // Note that these are returning approximate values.\n list($date, $format, $exceptions) = self::convertAgoString($string);\n\n } else if(strpos($string, 'AM') !== false ||strpos($string, 'PM') !== false) {\n\n list($date, $format, $exceptions) = self::convertExactDateString($string);\n\n } else if(strpos($string, ', ') !== false) {\n\n list($date, $format, $exceptions) = self::convertDateNoTimeString($string);\n\n } else if(strpos($string, '/') !== false) {\n\n list($date, $format, $exceptions) = self::convertSlashDateString($string);\n\n } else if(strpos($string, '-') !== false && strlen($string) === 8) {\n\n list($date, $format, $exceptions) = self::convertSearchDateString($string);\n\n } else {\n \n list($date, $format, $exceptions) = self::convertYearString($string);\n\n }\n\n if($date === false || $date === null || $format === null) {\n return null;\n }\n\n $date->setTimeZone(new DateTimeZone(self::$tz_final));\n \n return self::convertDateTimeArray($date, $format, $exceptions);\n \n }", "function parse_date($data) {\n\t\t$data = str_replace ('.', '/', $data);\n\t $timestamp = strtotime($data);\n\t if (false === $timestamp) {\n\t\t$timestamp = '00:00:00';\n\t return date('Y-m-d H:i:s', $timestamp);\n\t } else {\n\t return date('Y-m-d H:i:s', $timestamp);\n\t }\n\t}", "function expand_ranges($str)\n {\n \tif (strstr($str, \",\"))\n \t{\n \t\t$tmp1 = explode(\",\", $str);\n\n \t\t$count = count($tmp1);\n\n \t\t//Loop through each comma-separated value\n\n \t\tfor ($i = 0; $i < $count; $i++)\n \t\t{\n \t\t\tif (strstr($tmp1[$i], \"-\"))\n \t\t\t{\n \t\t\t\t// Expand Any Ranges\n $tmp2 = explode(\"-\", $tmp1[$i]);\n\n for ($j = $tmp2[0]; $j <= $tmp2[1]; $j++)\n {\n \t$ret[] = $j;\n }\n\n }\n else\n {\n \t$ret[] = $tmp1[$i];\n }\n }\n\n\t\t}\n\t\telseif(strstr($str, \"-\"))\n\t\t{\n\t\t\t// Range Only, No Commas\n\t\t\t$range = explode(\"-\", $str);\n\n\t\t\tfor ($i = $range[0]; $i <= $range[1]; $i++)\n\t\t\t{\n\t\t\t\t$ret[] = $i;\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n \t// Single Value, Only\n \t$ret[] = $str;\n }\n\n\t\treturn $ret;\n\t}", "function dateFromStr1($strDate){\n $d=explode('/',$strDate);\n $year = $d[2];\n $month = $d[0];\n $day = $d[1];\n return mktime(0,0,0,$month,$day,$year);\n\n}", "function parse_input_date(string $value): ?array\n{\n $parsed_date = date_parse_from_format(\"Y-m-d H:i\", $value);\n if ($parsed_date[\"error_count\"] > 0) {\n return null;\n }\n return [\n \"epoch\" => mktime($parsed_date['hour'], $parsed_date['minute'], 0, $parsed_date['month'], $parsed_date['day'], $parsed_date['year']),\n \"date\" => explode(\" \", $value)[0],\n \"time_hour\" => $parsed_date['hour'],\n \"time_minute\" => $parsed_date['minute']\n ];\n}", "private static function convertExactDateString($string) {\n\n if(strlen($string) > 15) {\n\n // Only month and date -> This year\n $date = DateTime::createFromFormat('!M j, g:i A', $string, new DateTimeZone(self::$tz_mal));\n \n } else {\n\n // Contains Year\n $date = DateTime::createFromFormat('!M j, Y g:i A', $string, new DateTimeZone(self::$tz_mal));\n\n }\n\n return [$date, 'Y-m-d\\TH:iO', []];\n\n // return $date->format('Y-m-d\\TH:iO');\n \n\n }", "function read_date($str){\n if($str)\n return date('F j, Y, g:i:s a', strtotime($str));\n else\n return null;\n\n}", "private static function convertDateNoTimeString($string) {\n\n if(strlen(explode(', ', $string)[0]) > 3) {\n\n $date = DateTime::createFromFormat('!M j, Y', $string);\n \n return [$date, 'Y-m-d', []];\n\n } else if(strlen(explode(', ', $string)[0]) > 2) {\n\n $date = DateTime::createFromFormat('!M, Y', $string);\n \n return [$date, 'Y-m', []];\n\n }\n\n }", "private static function processInputAsDateString() {\n $unix = strtotime(self::$input);\n\n if ($unix) { \n self::$timestamp = $unix;\n self::setDateFromTimestamp(self::$timestamp);\n } else {\n self::setMessage(\"Sorry. Your input was invalid.\");\n }\n }", "function _parseDate($date) {\r\n\t\tif ( preg_match('/([A-Za-z]+)[ ]+([0-9]+)[ ]+([0-9]+):([0-9]+)/', $date, $res) ) {\r\n\t\t\t$year = date('Y');\r\n\t\t\t$month = $res[1];\r\n\t\t\t$day = $res[2];\r\n\t\t\t$hour = $res[3];\r\n\t\t\t$minute = $res[4];\r\n\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t$tmpDate = strtotime($date);\r\n\t\t\tif ( $tmpDate > time() ) {\r\n\t\t\t\t$year--;\r\n\t\t\t\t$date = \"$month $day, $year $hour:$minute\";\r\n\t\t\t}\r\n\t\t} elseif ( preg_match('/^\\d\\d-\\d\\d-\\d\\d/', $date) ) {\r\n\t\t\t// 09-10-04 => 09/10/04\r\n\t\t\t$date = str_replace('-', '/', $date);\r\n\t\t}\r\n\t\t$res = strtotime($date);\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException('Date conversion failed for '.$date);\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "function api_date($str){\n\t\treturn datetime_convert('UTC', 'UTC', $str, 'D M d H:i:s +0000 Y' );\n\t}", "function findMinutesInString($string)\n{\n $minutes = findNumberInString($string, array(\"minutes\", \"minute\", \"mins\", \"min\"));\n $minutes += findNumberInString($string, array(\"hours\", \"hour\", \"hrs\", \"hr\")) * 60;\n return $minutes;\n}", "function formataData($dateString){\n $arr = date_parse($dateString);\n return $arr[\"day\"].\"/\".$arr[\"month\"].\"/\".$arr[\"year\"];\n }", "function rlip_time_string_to_offset($time_string) {\n //valid time units - hours, minutes, seconds - plus time values\n $valid_units = array('d' => DAYSECS,\n 'h' => HOURSECS,\n 'm' => MINSECS);\n\n $result = 0;\n //track the current \"group\", e.g. 2d\n $current_group = '';\n\n //iterate through characters\n for ($i = 0; $i < strlen($time_string); $i++) {\n //retrieve current character\n $character = substr($time_string, $i, 1);\n\n if ($character >= '0' && $character <= '9') {\n //append digit\n $current_group .= $character;\n } else {\n //look up the value of the time unit\n $multiplier = $valid_units[$character];\n //value based on numeric string\n $value = (int)$current_group;\n //add to result\n $result += $multiplier * $value;\n\n $current_group = '';\n }\n }\n\n return $result;\n}", "function string2dataRSS($datestring)\n{\n\t\tdate_default_timezone_set('Europe/Rome');\n\t\t$datestring=str_replace(\"/\", \"-\",$datestring);\n\t\t$datestring_arr = explode(\"-\", $datestring);\n\t\t$datestring=$datestring_arr[2]. \"-\" .$datestring_arr[1]. \"-\". $datestring_arr[0];\n\t\t$datestring=strtotime($datestring);\n\t\t//print_r($datestring);\n\t\t$pubDate=date('r',$datestring);\n\t\treturn $pubDate;\n}", "function serial_date ( $str, $val )\n\t{\n\t\t//if ( !$this->valid_date( $str ) ) return FALSE; Already handle by valid_date function in form validation rule in the controller\n\n\t\tlist($table, $column) = explode(\".\", $val, 2);\n\t\t$sSql = \"SELECT COUNT(0) AS numrow FROM \" . $table . \" WHERE \" . $column . \" >= '\" . $str . \"'\";\n\t\t$query = $this->ci->db->query($sSql);\n\t\t$row = $query->row();\n\t\treturn ($row->numrow > 0) ? FALSE : TRUE;\n\t}", "function evaluateDateVariables($expr) {\n\t\t// Note that parse_str turns + into a space, so turn it back\n\t\t$base = str_replace(\"%2B\",\"+\",$expr);\n\t\t//echo \"base=\".$base.\"<br/>\";\n\t\t// for dates\n\t\t// expecting {reference}, +/-, number, unit \n\t\t// eg {now}+3d or {now}-1y\n\t\t// Can I have fractions of a number? {now}-1.5m?\n\t\t//sscanf($base, \"{%[a-z]}%d%s\", $reference, $number, $unit);\n\t\tsscanf($base, \"{%[a-z]}%f%s\", $reference, $number, $unit);\n\t\t//echo \"ref=$reference number=$number unit=$unit<br/>\";\n\t\tswitch ($reference) {\n\t\t\tcase \"yearend\":\n\t\t\t\t$baseTimeStamp = mktime(0, 0, 0, 12, 31, date(\"Y\")+1);\n\t\t\t\tbreak;\n\t\t\t// v3.5 If you want to get any date that matches today's day part.\n\t\t\t// But this probably doesn't happen here.\n\t\t\tcase \"day\":\n\t\t\t\t$built = date('d'); //$db->SQLDate('d');\n\t\t\t\t// You don't want to do anything else with this\n\t\t\t\treturn $built;\n\t\t\t\tbreak;\n\t\t\tcase \"now\":\n\t\t\tdefault:\n\t\t\t\t// In case DateTime is too experimental\n\t\t\t\t//$baseTimeStamp = new DateTime();\n\t\t\t\t// Sometimes you will have passed a triggerDate, which is used instead of now\n\t\t\t\tif ($this->timeStamp) {\n\t\t\t\t\t$baseTimeStamp = $this->timeStamp;\n\t\t\t\t} else {\n\t\t\t\t\t$baseTimeStamp = time();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch ($unit) {\n\t\t\tcase \"h\":\n\t\t\t\t// In case date_add is too experimental\n\t\t\t\t//$built = date('Y-m-d', date_add($baseTimeStamp, new DateInterval(\"P$numberD\")));\n\t\t\t\t$built = date('Y-m-d', $baseTimeStamp + ($number * 3600)); // seconds in an hour\n\t\t\t\tbreak;\n\t\t\tcase \"d\":\n\t\t\t\t//$built = date('Y-m-d', date_add($baseTimeStamp, new DateInterval(\"P$numberD\")));\n\t\t\t\t$built = date('Y-m-d', $baseTimeStamp + ($number * 86400)); // seconds in a day\n\t\t\t\tbreak;\n\t\t\tcase \"w\":\n\t\t\t\t$built = date('Y-m-d', $baseTimeStamp + ($number * 604800)); // seconds in a week - on average\n\t\t\t\tbreak;\n\t\t\tcase \"m\":\n\t\t\t\t//$built = date('Y-m-d', date_add($baseTimeStamp, new DateInterval(\"P$numberM\")));\n\t\t\t\t$built = date('Y-m-d', $baseTimeStamp + ($number * 2629744)); // seconds in a month - on average\n\t\t\t\tbreak;\n\t\t\tcase \"y\":\n\t\t\t\t//$built = date('Y-m-d', date_add($baseTimeStamp, new DateInterval(\"P$numberM\")));\n\t\t\t\t$built = date('Y-m-d', $baseTimeStamp + ($number * 31556926)); // seconds in a year - on average\n\t\t\t\tbreak;\n\t\t\tcase \"f\": // delivery frequency unit for emus. It is the number of days.\n\t\t\t\t// The trouble is that we don't know the delivery frequency until we read the account record.\n\t\t\t\t// But I think I should be able to make a query that includes it...\n\t\t\t\tif (isset($this->deliveryFrequency)) {\n\t\t\t\t\t$built = date('Y-m-d', $baseTimeStamp + ($number * intval($this->deliveryFrequency) * 86400)); // multiples of the f days\n\t\t\t\t} else {\n\t\t\t\t\t$built = $expr; // leave the calculation until later\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$built = date('Y-m-d', $baseTimeStamp);\n\t\t}\n\t\t//echo \"becomes=$built<br/>\";\n\t\treturn $built;\n\t}", "function get_specified_age($age_str, $dob)\n {\n $today = new DateTime();\n $age = $dob->diff($today);\n\n $age_d = $dob->diffInDays();\n $age_y = $dob->age;\n $age_m = ($age->format('%y') * 12) + $age->format('%m');\n\n $patient_age = null;\n if (substr($age_str, -1) == 'd') {\n $patient_age = $age_d;\n } elseif (substr($age_str, -1) == 'm') {\n $patient_age = $age_m;\n } elseif (substr($age_str, -1) == 'y') {\n $patient_age = $age_y;\n }\n return $patient_age;\n }", "private function interval($date) { \n $datenow = new DateTime(\"now\");\n if ($date == null){\n return '?';\n } else {\n $date = new DateTime($date);\n }\n \n $interval = date_diff($datenow, $date);\n \n switch ($interval->y) {\n case 0:\n if ($interval->m == 0) {\n $result = 'Presque 1 mois';\n }\n else {\n $result = $interval->m.' mois';\n }\n break;\n \n case 1:\n if ($interval->m == 0) {\n $result = $interval->y.' an';\n }\n else {\n $result = ''.$interval->y.' an et '.$interval->m.' mois';\n }\n break;\n \n Default:\n if ($interval->m == 0) {\n $result = ''.$interval->y.' ans';\n }\n else {\n $result = ''.$interval->y.' ans et '.$interval->m.' mois';\n }\n }\n \n return $result;\n }", "protected function validateInterval(string $interval): self\n {\n $validator = Validator::make(\n [\n 'interval' => $interval,\n ],\n [\n 'interval' => [\n 'required',\n 'date_format:Y-m-d H:i:s',\n ],\n ]\n );\n\n if ($validator->fails()) {\n throw new ValidationException(\n ValidationException::VALIDATION_FAILED,\n $validator->errors()->toArray()\n );\n }\n\n return $this;\n }", "private function relativeDateToTimestamp($str)\n {\n $date = new DateTime();\n\n // In case of update date, replace it by the regular relative date first word\n $str = str_replace($this->i8n('relative-date-alt-prefixes'), $this->i8n('local-time-relative')[0], $str);\n\n $str = $this->removeRelativeDateSuffixes($str);\n\n $search = $this->i8n('local-time-relative');\n\n $replace = [\n '-',\n 'minute',\n 'hour',\n 'day',\n 'month',\n 'year',\n ''\n ];\n $date->modify(str_replace($search, $replace, $str));\n return $date->getTimestamp();\n }", "protected function parse($str) {\n return $this->fixture->parse(new StringInputSource($str));\n }", "public function parse($str)\r\n\t{\r\n\t\t$str = preg_replace('/[\\r\\n|\\r]/', \"\\n\", $str);\r\n\t\t$len = strlen($str);\r\n\t\t$tag_open = false;\r\n\t\t$tag_text = '';\r\n\t\t$tag = '';\r\n\t\t\r\n\t\t// set the document as the current tag.\r\n\t\t$this->current_tag = $this;\r\n\r\n\t\tfor($i=0; $i<$len; ++$i)\r\n\t\t{\r\n\t\t\tif($str[$i] === '[')\r\n\t\t\t{\r\n\t\t\t\tif($tag_open)\r\n\t\t\t\t\t$tag_text .= '[' . $tag;\r\n\t\t\t\t\r\n\t\t\t\t$tag_open = true;\r\n\t\t\t\t$tag = '';\r\n\t\t\t}\r\n\t\t\telse if($str[$i] === ']' && $tag_open)\r\n\t\t\t{\r\n\t\t\t\tif($tag !== '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$bits = preg_split('/([ =])/', trim($tag), 2, PREG_SPLIT_DELIM_CAPTURE);\r\n\t\t\t\t\t$tag_attrs = (isset($bits[2]) ? $bits[1] . $bits[2] : '');\r\n\t\t\t\t\t$tag_closing = ($bits[0][0] === '/');\r\n\t\t\t\t\t$tag_name = ($bits[0][0] === '/' ? substr($bits[0], 1) : $bits[0]);\r\n\r\n\t\t\t\t\tif(isset($this->bbcodes[$tag_name]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->tag_text($tag_text);\r\n\t\t\t\t\t\t$tag_text = '';\r\n\r\n\t\t\t\t\t\tif($tag_closing)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!$this->tag_close($tag_name))\r\n\t\t\t\t\t\t\t\t$tag_text = \"[{$tag}]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(!$this->tag_open($tag_name, $this->parse_attribs($tag_attrs)))\r\n\t\t\t\t\t\t\t\t$tag_text = \"[{$tag}]\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tag_text .= \"[{$tag}]\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$tag_text .= '[]';\r\n\t\t\t\t\r\n\t\t\t\t$tag_open = false;\r\n\t\t\t\t$tag = '';\r\n\t\t\t}\r\n\t\t\telse if($tag_open)\r\n\t\t\t\t$tag .= $str[$i];\r\n\t\t\telse\r\n\t\t\t\t$tag_text .= $str[$i];\r\n\t\t}\r\n\t\t\r\n\t\t$this->tag_text($tag_text);\r\n\r\n\t\tif($this->throw_errors && !$this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\tthrow new SBBCodeParser_MissingEndTagException(\"Missing closing tag for tag [{$this->current_tag->tag()}]\");\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public static function get_hour_from_string($str){\n\t \n\t\t// hour can be : *:10 (at 10mn past each hour)\n\t\tif (strpos($str,\"*:\") === 0){\n\t\t\tif (is_numeric(substr($str,2))){\n\t\t\t\treturn $str;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (($timestamp = strtotime($str)) === false) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// error_log(date(\"H:i\",$timestamp));\n\t\treturn $timestamp;\n\t}", "public function calcLastRan($string)\n {\n $this->debug = \"\";\n $this->lastRan = 0;\n $this->year = NULL;\n $this->month = NULL;\n $this->day = NULL;\n $this->hour = NULL;\n $this->minute = NULL;\n $this->hours_arr = array();\n $this->minutes_arr = array();\n $this->months_arr = array();\n\n // Double spaces to single space\n $string = preg_replace('/[\\s]{2,}/', ' ', $string);\n\n $this->bits = array_slice(@explode(' ', $string), 0, 5);\n \n if (preg_match('/[^-,\\/* \\\\d]/', implode(' ', $this->bits)) !== 0)\n {\n return false;\n }\n\n // Put the current time into an array\n $t = strftime(\"%M,%H,%d,%m,%w,%Y\", time());\n $this->now = explode(\",\", $t);\n $this->year = $this->now[5];\n\n $arMonths = $this->_getMonthsArray();\n\n do \n {\n $this->month = array_pop($arMonths);\n } \n while ($this->month > $this->now[3]);\n\n if ($this->month === NULL)\n {\n $this->year = $this->year - 1;\n $arMonths = $this->_getMonthsArray();\n $this->_prevMonth($arMonths);\n }\n elseif ($this->month == $this->now[3])\n {\n $arDays = $this->_getDaysArray($this->month, $this->year);\n\n do\n {\n $this->day = array_pop($arDays);\n }\n while ($this->day > $this->now[2]);\n\n if ($this->day === NULL)\n {\n $this->_prevMonth($arMonths);\n }\n elseif ($this->day == $this->now[2])\n {\n $arHours = $this->_getHoursArray();\n\n do\n {\n $this->hour = array_pop($arHours);\n }\n while ($this->hour > $this->now[1]);\n\n if ($this->hour === NULL)\n {\n $this->_prevDay($arDays, $arMonths);\n }\n elseif ($this->hour < $this->now[1])\n {\n $this->minute = $this->_getLastMinute();\n }\n else\n {\n $arMinutes = $this->_getMinutesArray();\n\n do\n {\n $this->minute = array_pop($arMinutes);\n }\n while ($this->minute > $this->now[0]);\n\n if ($this->minute === NULL)\n {\n $this->_prevHour($arHours, $arDays, $arMonths);\n }\n }\n }\n else\n {\n $this->hour = $this->_getLastHour();\n $this->minute = $this->_getLastMinute();\n }\n }\n else\n {\n $this->day = $this->_getLastDay($this->month, $this->year);\n if ($this->day === NULL)\n {\n // No scheduled date within this month. So we will try the previous month in the month array\n $this->_prevMonth($arMonths);\n }\n else\n {\n $this->hour = $this->_getLastHour();\n $this->minute = $this->_getLastMinute();\n }\n }\n\n // If the last due is beyond 1970\n if ($this->minute === NULL)\n {\n return false;\n }\n else\n {\n $this->lastRan = mktime($this->hour, $this->minute, 0, $this->month, $this->day, $this->year);\n\n return true;\n }\n }", "public function parse($string) {\n\t$Numerals = str_split($string);\n\t$LastIndex = -1;\n\t$CurrentIndex = -1;\n\t$Magnitude = 0;\n\t$RomanNumerals = array_keys($this->NumeralMapping);\n\t$NumeralValues = array_values($this->NumeralMapping);\n\t$NumeralMapping = array_reverse($this->NumeralMapping);\n\n\t$Numerals = array_reverse($Numerals);\n\tforeach($Numerals as $Value) {\n\t\tif(isset($NumeralMapping[$Value])===true) {\n\t\t\t$Idx = -1;\n\t\t\tforeach($RomanNumerals as $Index => $Numeral) {\n\t\t\t\tif($Value == $Numeral) {\n\t\t\t\t\t$Idx = $Index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$CurrentIndex = $Idx;\n\t\t} else {\n\t\t\treturn \"Recieved value is NOT a valid String.\";\n\t\t}\n\t if($CurrentIndex < $LastIndex) {\n\t $Magnitude = $Magnitude - $NumeralValues[$CurrentIndex];\n\t } else {\n\t $Magnitude = $Magnitude + $NumeralValues[$CurrentIndex];\n\t }\n \t$LastIndex = $CurrentIndex;\n\t}\n\treturn $Magnitude;\n }", "function compare_date ( $str, $val )\n\t{\n\t\t//$aVal = split( \"[.]\", $val );\n\t\t$aVal = explode( \".\", $val );\n\t\t$sOperator = $aVal[ 0 ];\n\t\t$field = $aVal[ 1 ];\n\t\tif ( isset($_POST[$field]))\n\t\t{\n\t\t\t$field = $_POST[$field];\n\t\t}\n\n\t\tif ( !$this->valid_date( $field ) ) return FALSE;\n\t\tif ( !$this->valid_date( $str ) ) return FALSE;\n\n\t\t/* Avoid using strtotime because it reads the Unix timestamp which has maximum valid value is 19 Jan 2038 03:14:07 UTC\n\t\t$nStr = strtotime( $str );\n\t\t$nField = strtotime( $field );\n\t\t*/\n\n\t\t$aStr = explode( '-', $str );\n\t\tif ( strlen( $aStr[ 1 ] ) == 1 ) $aStr[ 1 ] = \"0\" . $aStr[ 1 ];\n\t\tif ( strlen( $aStr[ 2 ] ) == 1 ) $aStr[ 2 ] = \"0\" . $aStr[ 2 ];\n\t\t$sStr = $aStr[ 0 ] . $aStr[ 1 ] . $aStr[ 2 ];\n\t\t$nStr = ( int ) $sStr;\n\n\t\t$aField = explode( '-', $field );\n\t\tif ( strlen( $aField[ 1 ] ) == 1 ) $aField[ 1 ] = \"0\" . $aField[ 1 ];\n\t\tif ( strlen( $aField[ 2 ] ) == 1 ) $aField[ 2 ] = \"0\" . $aField[ 2 ];\n\t\t$sField = $aField[ 0 ] . $aField[ 1 ] . $aField[ 2 ];\n\t\t$nField = ( int ) $sField;\n\n\t\t$nRet = FALSE;\n\t\tswitch ( $sOperator )\n\t\t{\n\t\t\tcase \"gt\": // greater than\n\t\t\t\tif ( $nStr > $nField ) $nRet = TRUE;\n\t\t\t\tbreak;\n\t\t\tcase \"ge\": // greater equal\n\t\t\t\tif ( $nStr >= $nField ) $nRet = TRUE;\n\t\t\t\tbreak;\n\t\t\tcase \"lt\": // less than\n\t\t\t\tif ( $nStr < $nField ) $nRet = TRUE;\n\t\t\t\tbreak;\n\t\t\tcase \"le\": // less equal\n\t\t\t\tif ( $nStr <= $nField ) $nRet = TRUE;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$bRet = FALSE;\n\t\t}\n\t\treturn $nRet;\n\t}", "function datetime_mysql2unix($str) {\n\tlist($date, $time) = explode(' ', $str);\n\tlist($year, $month, $day) = explode('-', $date);\n\tlist($hour, $minute, $second) = explode(':', $time);\n\n\t$timestamp = mktime((int)$hour, (int)$minute, (int)$second, (int)$month, (int)$day, (int)$year);\n\n\treturn $timestamp;\n}", "function parse($data) {\n $output=[];\n $val=0;\n foreach(str_split($data) as $value){\n switch($value){\n case 'i': $val++;break;\n case 'd': $val--; break;\n case 's': $val **= 2; break;\n case 'o': $output[] = $val; break;\n }\n }\n return $output;\n}", "function read_date($str){\n date_default_timezone_set(\"America/Mexico_City\");\n if($str)\n return date('d/m/Y', strtotime($str));\n else\n return null;\n }", "public function testParseThrowsExceptionIfIntervalIsNotValid()\n {\n $this->setExpectedException('InvalidArgumentException');\n \n (new Interval())->parse('foo');\n \n return;\n }", "function dateParse($date)\n{\n // DD/MM/YYYY => YYYY/MM/DD\n $dateArray = explode('/', $date);\n $dateArray = array_reverse($dateArray);\n $dateArray = implode(\"-\", $dateArray);\n return $dateArray;\n}", "private static function convertYearString($string) {\n\n $date = DateTime::createFromFormat('!Y', $string);\n\n return [$date, 'Y', []];\n // return $date\n\n }", "private static function convertSlashDateString($string) {\n\n $date = DateTime::createFromFormat('!m/d/Y at H:i', $string, new DateTimeZone(self::$tz_mal));\n \n return [$date, 'Y-m-d\\TH:iO', []];\n // return $date->format('Y-m-d\\TH:iO');\n\n }", "function intervalo($inicio, $fim){\n\t $dataInicio = strtotime($inicio);\n\t $dataFim = strtotime($fim);\n\t $intervalo = ($dataFim-$dataInicio) - 86400;\n\t return date('d', $intervalo);\n\t }", "public static function strToDateTime($data) {\r\n $match = [];\r\n preg_match(\"/[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}/\", $data, $match);\r\n return \\DateTime::createFromFormat('Y-m-d', $match[0]);\r\n }", "public static function getBetween($start, $end, $str) { \r\n \r\n $a = strpos($str,$start);\r\n if ($a === FALSE) return FALSE;\r\n $z = strpos($str,$end, $a+strlen($start)+1);\r\n if ($z === FALSE) return FALSE;\r\n\r\n $str = substr($str,$a + strlen($start), $z - ($a + strlen($start)) );\r\n\r\n return $str;\r\n\r\n }", "private function _getDateTimeArray($string = '', $delim = '.')\n {\n $arr = [\n null,\n null,\n null,\n ];\n\n if (! empty($string)) {\n $arr = preg_split('/\\\\'.$delim.'/', $string);\n }\n\n return $arr;\n }", "function cond_parse_http_date($date) {\n /* Unfortunately there is no strptime in PHP <5, so we must do this\n * manually. */\n $H = $M = $S = 0;\n $Y = $m = $d = 0;\n\n $ma = array();\n global $cond_wkday_re, $cond_weekday_re, $cond_month_re, $cond_month_map,\n $cond_date1_re, $cond_date2_re, $cond_date3_re, $cond_time_re;\n if (preg_match(\"/^$cond_wkday_re, $cond_date1_re $cond_time_re GMT\\$/\", $date, $ma)) {\n /* RFC 1123 */\n $d = $ma[2];\n $m = $cond_month_map[$ma[3]];\n $Y = $ma[4];\n $H = $ma[5];\n $M = $ma[6];\n $S = $ma[7];\n } else if (preg_match(\"/^$cond_weekday_re, $cond_date2_re $cond_time_re GMT\\$/\", $date, $ma)) {\n /* RFC 850 */\n $d = $ma[2];\n $m = $cond_month_map[$ma[3]];\n $Y = $ma[4] + ($ma[4] < 50 ? 2000 : 1900); /* XXX */\n $H = $ma[5];\n $M = $ma[6];\n $S = $ma[7];\n } else if (preg_match(\"/^$cond_wkday_re $cond_date3_re $cond_time_re (\\\\d{4})\\$/\", $date, $ma)) {\n /* asctime(3) */\n $d = preg_replace('/ /', '', $ma[3]);\n $m = $cond_month_map[$ma[2]];\n $Y = $ma[7];\n $H = $ma[4];\n $M = $ma[5];\n $S = $ma[6];\n } else\n return null;\n\n return gmmktime($H, $M, $S, $m, $d, $Y);\n}", "protected function parse_period($years = NULL) {\n if ( is_array($years) && isset($years['start_date']) && isset($years['end_date'])) {\n $period['start'] = date::display($years['start_date'], 'Y-m-d h:i:s', FALSE);\n $period['end'] = date::display($years['end_date'], 'Y-m-d h:i:s', FALSE);\n }\n elseif ( ! is_null($years)) {\n list($start, $end) = str_split($years, 2);\n $period['start'] = sprintf('20%02d-07-01', $start);\n $period['end'] = sprintf('20%02d-06-31', $end);\n }\n elseif (date::month() > 6) {\n $period['start'] = sprintf('20%02d-07-01', substr(date::year(), 2, 2));\n $period['end'] = sprintf('20%02d-06-31', substr(date::year() + 1, 2, 2));\n }\n else {\n $period['start'] = sprintf('20%02d-07-01', substr(date::year() - 1, 2, 2));\n $period['end'] = sprintf('20%02d-06-31', substr(date::year(), 2, 2));\n }\n return $period;\n }" ]
[ "0.7160323", "0.6333131", "0.610835", "0.58759373", "0.5774029", "0.5624654", "0.5617821", "0.5576805", "0.55641437", "0.55607474", "0.54102474", "0.54000235", "0.5394489", "0.5369161", "0.53623754", "0.53607357", "0.5338079", "0.53123313", "0.5293987", "0.5249213", "0.5226775", "0.5219975", "0.52159476", "0.52115273", "0.5172396", "0.5167134", "0.5151504", "0.5123086", "0.5105656", "0.50954884", "0.50490624", "0.50370455", "0.500813", "0.49829412", "0.49817872", "0.49486148", "0.49157277", "0.491201", "0.49066675", "0.4885858", "0.48822153", "0.48733264", "0.48717192", "0.48548883", "0.48501027", "0.48298812", "0.48244083", "0.47995606", "0.47821563", "0.47812486", "0.47778347", "0.47750568", "0.47722536", "0.47632572", "0.47296637", "0.47104242", "0.4701922", "0.4700344", "0.46988064", "0.4694174", "0.46898556", "0.46824652", "0.4680643", "0.4680388", "0.4663666", "0.46578175", "0.46547532", "0.46472982", "0.46387726", "0.46310622", "0.46300983", "0.46282583", "0.462559", "0.4618807", "0.46111977", "0.4603879", "0.46006852", "0.45992127", "0.45983636", "0.45920223", "0.4584604", "0.45805675", "0.45777822", "0.45651194", "0.45649272", "0.45601046", "0.45522463", "0.45499206", "0.45468354", "0.45438433", "0.45418864", "0.4540266", "0.45279452", "0.4518186", "0.45112908", "0.4505195", "0.4498536", "0.44964743", "0.44846398", "0.44788158" ]
0.6233119
2
Many label can belong to one link.
public function links(): BelongsToMany { return $this->belongsToMany(Link::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLink($label, $link) \n {\n $xmlObject = new XMLObject( XMLObject_Menu::NODE_ITEM );\n $xmlObject->addElement( XMLObject_Menu::ITEM_TYPE, XMLObject_Menu::ITEM_TYPE_LINK);\n $xmlObject->addElement(XMLObject_Menu::ITEM_TYPE_LINK_LABEL, $label);\n $xmlObject->addElement(XMLObject_Menu::ITEM_TYPE_LINK_LINK, $link);\n \n $this->addXmlObject( $xmlObject );\n \n }", "protected function checkLink()\n\t{\n\t\tif(empty($this->link) && empty($this->label))\n\t\t{\n\t\t\t$split = preg_split(\"/[^A-Za-z0-9]/\", $this->title, 2, PREG_SPLIT_NO_EMPTY);\n\t\t\t$this->label = $split[0];\n\t\t}\n\n\t\tif(empty($this->link) && !empty($this->label))\n\t\t{\n\t\t\t$split = preg_split(\"/[^A-Za-z0-9]/\", $this->label, 2, PREG_SPLIT_NO_EMPTY);\n\t\t\t$this->label = $split[0];\n\t\t}\n\n\t\t$this->link = (empty($this->link)) ? \"\" : $this->link;\n\t\t$this->label = (empty($this->label)) ? \"\" : $this->label;\n\t\t$this->label = strtolower($this->label);\n\n\t\treturn $this;\n\t}", "function link_label_Update($label, $linkURI, $projectUUID, $db){\n\t $db = $this->startDB();\n\t $where = array();\n\t $where[] = \"linkedURI = '$linkURI' \";\n\t $where[] = \"fk_project_uuid = '$projectUUID' \";\n\t $data = array(\"linkedLabel\" => $label);\n\t $db->update(\"linked_data\", $data, $where);\n}", "function makeLink($label, $link, $ATagParams = ''){\n\t\tif(is_array($this->conf['typolink.']))\n\t\t\t$myConf = $this->conf['typolink.'];\n\t\t$myConf['parameter'] = $link;\n\t\tif($ATagParams) {\n\t\t\t$myConf['ATagParams'] = $ATagParams;\n\t\t}\n\t\treturn $this->cObj->typoLink($label, $myConf);\n }", "protected function isLink() {}", "public function makeLinkButton() {}", "public function label()\n {\n return $this->belongsTo(Label::class);\n }", "function link($label, $url = '/', $options = array()) {\n\t\t//\tIf no title specified, we use the label\n\t\tif (!isset($options['title'])) {\n\t\t\t$options['title'] = $this->attribute($label);\n\t\t}\n\n\t\t// If an icon is specified, we prepend it\n\t\tif (!empty($options['icon'])) {\n\t\t\t$label = $this->Fastcode->icon($options['icon']).$label;\n\t\t\t$options['escape'] = false;\n\t\t\tunset($options['icon']);\n\t\t}\n\n\t\t// If a wrapper is set, we wrap the label inside it\n\t\tif (!empty($options['wrap'])) {\n\t\t\t$label = $this->Html->tag($options['wrap'], $label);\n\t\t\t$options['escape'] = false;\n\t\t\tunset($options['wrap']);\n\t\t}\n\n\t\t// We return the link\n\t\treturn $this->Html->link($label, $url, $options);\n\t}", "public function setLink($link);", "public function labels(): BelongsToMany\n {\n return $this->belongsToMany(Label::class);\n }", "public function label(){\n return $this->belongsTo('App\\Models\\Label');\n }", "abstract function add_label();", "protected function setRelatedEntity(array $label): void\n {\n $this->label = new Label($label);\n }", "public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }", "public function getTabLabel() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }", "function add_submenu_item($label, $link, $group = 'a', $onclick = false, $selected = NULL) {\n\tglobal $CONFIG;\n\n\tif (!isset($CONFIG->submenu)) {\n\t\t$CONFIG->submenu = array();\n\t}\n\tif (!isset($CONFIG->submenu[$group])) {\n\t\t$CONFIG->submenu[$group] = array();\n\t}\n\n\t$item = new stdClass;\n\t$item->value = $link;\n\t$item->name = $label;\n\t$item->onclick = $onclick;\n\t$item->selected = $selected;\n\t$CONFIG->submenu[$group][] = $item;\n}", "public function link() : Link;", "public function link();", "public function testAddRelatedLabel()\n {\n $label = 'Twitter main account';\n $this->intent->addRelated('twitter', $label);\n\n $related = self::getProperty($this->intent, 'related');\n $related = array_values($related);\n $related = reset($related);\n $this->assertEquals($label, $related, 'Failed to set a related screen_name label');\n }", "public function setLabel($label);", "public function setLabel($label);", "public function setLabel($label);", "public function setLabel($label);", "public function link()\n {\n return $this->belongsTo('App\\Models\\MenuLink');\n }", "public function link()\n {\n return $this->belongsTo(Link::class);\n }", "function setLinks($link) \n {\n $this->links = $link;\n }", "public function hasLabel($label)\n {\n }", "public static function linkButton($label = '', $link = '', $misc = '')\n {\n global $config;\n /* if page has onlybody param then add this param in all link. the param hide header and footer. */\n if(strpos($link, 'onlybody=') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')\n {\n $onlybody = $config->requestType == 'PATH_INFO' ? \"?onlybody=yes\" : \"&onlybody=yes\";\n $link .= $onlybody;\n }\n return \" <input type='button' value='$label' class='button-c' $misc onclick='location.href=\\\"$link\\\"' /> \";\n }", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function addLink(string $name, array $attributes);", "public function labels()\n {\n return $this->morphToMany(\\VentureDrake\\LaravelCrm\\Models\\Label::class, config('laravel-crm.db_table_prefix').'labelable');\n }", "function getLabelField() \n {\n return \"navbarlink_textKey\";\n }", "public function getPrimaryLabelUrl(): string\n {\n if (is_array($this->documents)) {\n foreach ($this->documents as $document) {\n if ($document['type'] === 'label') {\n return $document['link'];\n }\n }\n }\n\n // If new type of documents is not declared, use old url\n return $this->label['label_printer'];\n }", "public function model()\n {\n return Link::class;\n }", "public function getLabel() {}", "public function getLabel() {}", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function getLink();", "public function getLink();", "function next_posts_link($label = \\null, $max_page = 0)\n {\n }", "public function setLabel($newLabel);", "public function add($label);", "public function testAddLabel() {\n\n foreach ($this->testCases['Label'] as $key => $testCase) {\n $label = new Label();\n $label->setLabelName($testCase['label_name']);\n $label->setLabelComment($testCase['label_comment']);\n $label->setLabelStatus($testCase['label_status']);\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('addLabel')\n ->will($this->returnValue($label));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->addLabel($testCase['label_name'], $testCase['label_comment']);\n $this->assertTrue($result instanceof Label);\n $this->assertEquals($label, $result);\n }\n }", "abstract public function getLabel();", "function getLinkTarget() {return $this->_linktarget;}", "public function isLabel(){\n return $this->label;\n }", "abstract public function links(): JsonApiParser\\Collections\\Links;", "public function addLabel(Label $label): void\n {\n if (is_null($this->labels)) {\n $this->labels = collect();\n }\n $this->labels->put($label->Text, $label);\n }", "public function nextLink($label = '&gt;', $itemClass = 'page-item', $linkClass = 'page-link')\n {\n $html = '<li class=\"' . $itemClass . '\">';\n $html.= '<a class=\"' . $linkClass . '\" href=\"';\n $html.= $this->url . $this->nextPage . '\"';\n $html.= ($this->currentPage == $this->totalPages) ? ' style=\"cursor:default;\"' : '';\n $html.= '>';\n $html.= $label;\n $html.= '</a>'; \n $html.= '</li>';\n \n return $html;\n }", "static function classLink($className, $label = null)\n {\n $classDefinitions = $GLOBALS['PHPDocMD_classDefinitions'];\n $linkTemplate = $GLOBALS['PHPDocMD_linkTemplate'];\n\n $returnedClasses = [];\n\n foreach (explode('|', $className) as $oneClass) {\n $oneClass = trim($oneClass, '\\\\ ');\n\n if (!$label) {\n $label = $oneClass;\n }\n\n if (!isset($classDefinitions[$oneClass])) {\n $returnedClasses[] = $oneClass;\n } else {\n $link = str_replace('\\\\', '-', $oneClass);\n $link = strtr($linkTemplate, ['%c' => $link]);\n\n $returnedClasses[] = sprintf(\"[%s](%s)\", $label, $link);\n }\n }\n\n // remove the trailing '.md' from the link as with this suffix the content of the link is interpreted as\n // raw and not formatted in Markdown ( Rainer Stötter )\n\n foreach( $returnedClasses as & $item ) {\n\n\t $item = str_replace( '.md', '', $item );\n\n }\n\n\n\n return implode('|', $returnedClasses);\n }", "public function setLabelURL($labelURL)\n {\n $this->labelURL = $labelURL;\n return $this;\n }", "function ciniki_links_linkAdd(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'name'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Name'), \n 'category'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Category'), \n 'url'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'URL'), \n 'description'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Description'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Notes'), \n 'categories'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Categories'), \n 'tags'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Tags'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'links', 'private', 'checkAccess');\n $rc = ciniki_links_checkAccess($ciniki, $args['tnid'], 'ciniki.links.linkAdd');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $modules = $rc['modules'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.links');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Add the object\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.links.link', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $link_id = $rc['id'];\n\n //\n // Add the categories if enabled and specified\n //\n if( ($modules['ciniki.links']['flags']&0x01) > 0 && isset($args['categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.links', 'tag', $args['tnid'],\n 'ciniki_link_tags', 'ciniki_link_history',\n 'link_id', $link_id, 10, $args['categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.links');\n return $rc;\n }\n }\n\n //\n // Add the tags if enabled and specified\n //\n if( ($modules['ciniki.links']['flags']&0x02) > 0 && isset($args['tags']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.links', 'tag', $args['tnid'],\n 'ciniki_link_tags', 'ciniki_link_history',\n 'link_id', $link_id, 40, $args['tags']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.links');\n return $rc;\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.links');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'links');\n\n $ciniki['syncqueue'][] = array('push'=>'ciniki.links.link',\n 'args'=>array('id'=>$link_id));\n\n return array('stat'=>'ok', 'id'=>$link_id);\n}", "public function isLink() {\n foreach ($this->fields as $field) {\n if ($field->isLinkIndex()) {\n return true;\n }\n }\n\n return false;\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "abstract public function isLink($target);", "public function setLabel();", "public function setLink($link){\n\t\t$this->link = $link;\n\t}", "public abstract function label();", "public function get_label(){ return $this->label; }", "public function addLabel($text){\n $name=\"label\".$this->labelID;\n $this->labelID++;\n $this->items[$name]['type']=\"label\";\n $this->items[$name]['text']=$text;\n }", "function format_link($p_label, $p_action, $p_arg = array(), $p_class = '', $p_style = '', $p_prop = ''){\n\treturn $t_link = '<a class=\"' . $p_class . '\" style=\"' . $p_style . '\" href=\"' . format_href($p_action, $p_arg) . '\" ' . $p_prop . '>' . $p_label . '</a>';\n}", "public function label()\n {\n return $this->hasMany('App\\ChurchAddressLabel');\n }", "public function setLabel($label) {\n $this->label = $label;\n }", "function is_linked_category($category) {\r\n switch($category) {\r\n case 99999:\r\n case 99998:\r\n return true;\r\n }\r\n return false;\r\n }", "public static function getLabels()\n {\n return [\n 'singular' => 'Website',\n 'multiple' => 'Websites'\n ];\n }", "protected function addLinks()\n {\n }", "public function hasLabels(){\n return $this->_has(2);\n }", "function verificarLink($link){\n //se n tiver, adicionar. Caso contrário retorna\n //$da = new DataAccess();\n //$da->getLink();\n \n }", "function wp_link_category_checklist($link_id = 0)\n {\n }", "public function label() { }", "public function setLabel(Label $label) {\n\t\t$this->label = $label;\n\t}", "function Link($id,$title,$url,$description,$category_id,$on_homepage)\n\t{\n\t\tparent::Resource($id,RESOURCE_LINK);\n\t\t$this->title = $title;\n\t\t$this->url = $url;\n\t\t$this->description = $description;\t\n\t\t$this->category_id = $category_id;\n\t\t$this->on_homepage = $on_homepage;\n\t}", "protected function clickViewsOperationLink($label, $unique_href_part) {\n /** @var \\Behat\\Mink\\Element\\NodeElement[] $links */\n $links = $this->xpath('//a[normalize-space(text())=:label]', [':label' => $label]);\n foreach ($links as $link_index => $link) {\n $position = strpos($link->getOuterHtml(), $unique_href_part);\n if ($position !== FALSE) {\n $this->assertTrue(TRUE, \"Link to $label containing $unique_href_part found.\");\n $link->click();\n return;\n }\n }\n\n $this->fail(\"Link to $label containing $unique_href_part found.\");\n }", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public function linksProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\LinkedArticle()]]];\n }", "public function getLinkNamesAttribute()\n {\n $links = [];\n foreach ($this->oppositePivot as $key => $link) {\n if ($link->pivot->link_type == EnvironmentLink::AUTOMATIC) {\n $link_type = trans('environments.link_auto');\n } else {\n $link_type = trans('environments.link_manual');\n }\n $links[] = ($key+1) . '. ' . $link->name. ' - '. $link_type;\n }\n\n if (count($links)) {\n return implode(\"<br />\", $links);\n }\n\n return trans('app.none');\n }", "public function getLink() {}", "public function setLabel($label){\n\t\t$this->label = $label;\n\t}", "public function setLinks($value)\n {\n return $this->setProperty(\"Links\", $value, true);\n }", "public function setLabel() {\n }", "function link($o=null)\n\t{\n\t\tif ($o == null) {\n\t\t\t$o = $this;\n\t\t}\n\n\t\t$c = get_class($o);\n\t\t$c = str_replace('\\\\', '/', $c);\n\t\t$c = basename($c);\n\t\t$c = strtolower($c);\n\n\t\treturn sprintf('%s:%d', $c, intval($o['id']));\n\t}" ]
[ "0.63609874", "0.6034632", "0.5867335", "0.5760373", "0.56567895", "0.56378937", "0.5617383", "0.5591548", "0.5575558", "0.55439556", "0.5353796", "0.53521585", "0.5309956", "0.5294868", "0.52706605", "0.5267611", "0.5252272", "0.5250128", "0.524921", "0.5215688", "0.5215688", "0.5215688", "0.5215688", "0.5205957", "0.52008516", "0.5173311", "0.5171296", "0.5127484", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.51193964", "0.5105727", "0.50965416", "0.50942487", "0.50594753", "0.50471306", "0.5011545", "0.5011545", "0.5006456", "0.500512", "0.50046617", "0.50046617", "0.50030965", "0.4995763", "0.4995763", "0.4992249", "0.4991821", "0.49823052", "0.49740452", "0.49730152", "0.49639344", "0.49567622", "0.49563524", "0.4947308", "0.4931529", "0.49248892", "0.49227005", "0.49102524", "0.49067667", "0.4898322", "0.4898322", "0.48944774", "0.489354", "0.48755807", "0.4869083", "0.48686033", "0.48479173", "0.4844197", "0.48305717", "0.4828013", "0.48266", "0.48249114", "0.48213926", "0.48057893", "0.48029023", "0.4802411", "0.47975183", "0.47953692", "0.47949767", "0.4786714", "0.47861618", "0.47825837", "0.47821233", "0.47809675", "0.47738975", "0.47738826", "0.47732356", "0.47723886" ]
0.51351666
27
Handle an incoming request.
public function handle($request, Closure $next) { if (!($token = $request->header('Token')) || strpos($token, '.') === false) { return response()->json([ 'code' => 403, 'message' => '请先登录', ]); } list($uid, $token) = explode('.', $request->token); $user = User::where('id', $uid)->where('token', $token)->first(); if (!$user) { return response()->json([ 'code' => 403, 'message' => '请先登录', ]); } //被禁用做判断 if ($user->status == User::STATUS_DISABLED) { return response()->json([ 'code' => 401, 'message' => '您已被禁用!', ]); } //未激活 if (empty($user->pid)) { return response()->json([ 'code' => 401, 'message' => '账号未激活!', ]); } $request->user = $user; return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Run the database seeds.
public function run() { DB::table("voitures")->insert([ "nom"=>"Skoda", "description"=>"1,6L", "date"=>"2005/12/08", "model"=>"fabia", "numero"=>007, "created_at"=>now() ]); DB::table("voitures")->insert([ "nom"=>"mercedes", "description"=>"3L", "date"=>"2020/12/08", "model"=>"A", "numero"=>012, "created_at"=>now() ]); DB::table("voitures")->insert([ "nom"=>"audi", "description"=>"2,2L", "date"=>"2010/12/08", "model"=>"RS5", "numero"=>006, "created_at"=>now() ]); DB::table("voitures")->insert([ "nom"=>"vw", "description"=>"1,8L", "date"=>"2002/12/08", "model"=>"golf", "numero"=>002, "created_at"=>now() ]); DB::table("voitures")->insert([ "nom"=>"bmw", "description"=>"2,6L", "date"=>"2006/12/08", "model"=>"M5", "numero"=>017, "created_at"=>now() ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Perform an http call. This method is used by the resource specific classes. Please use the $payments property to perform operations on payments.
public function performHttpCall($httpMethod, $apiMethod, $httpBody = null) { $url = $this->apiEndpoint . '/' . self::API_VERSION . '/' . $apiMethod; return $this->performHttpCallToFullUrl($httpMethod, $url, $httpBody); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function call()\n\t{\n\t\tcall_user_func_array(array($this->client, 'request'), func_get_args());\n\n\t\treturn $this->client->getResponse();\n\t}", "protected function _execute($params = array())\n {\n if(!in_array($params['method'], $this->_supportedMethods)){\n throw new Services_FullContact_Exception_NotImplemented(__CLASS__ .\n \" does not support the [\" . $params['method'] . \"] method\");\n }\n\n $params['apiKey'] = urlencode($this->_apiKey);\n\n $fullUrl = $this->_baseUri . $this->_version . $this->_resourceUri .\n '?' . http_build_query($params);\n\n //open connection\n $connection = curl_init($fullUrl);\n curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($connection, CURLOPT_USERAGENT, self::USER_AGENT);\n\n //execute request\n $this->response_json = curl_exec($connection);\n $this->response_code = curl_getinfo($connection, CURLINFO_HTTP_CODE);\n $this->response_obj = json_decode($this->response_json);\n\n if ('403' == $this->response_code) {\n throw new Services_FullContact_Exception_NoCredit($this->response_obj->message);\n }\n\n return $this->response_obj;\n }", "public function call()\r\n\t{\r\n\t\t// get the request XML from the DOM document\r\n\t\t$request_xml = $this->__toString();\r\n\t\t\r\n\t\t// get the API function name\r\n\t\t$function_name = get_class($this);\r\n\t\tif (substr($function_name, -4) == 'Mass')\r\n\t\t{\r\n\t\t\t$function_name = substr($function_name, 0, -4);\r\n\t\t}\r\n\t\t$function_name = substr($function_name, strrpos($function_name, '_') + 1);\r\n\t\t\r\n\t\t// make the API call\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// instantiate the SOAP client and make the API call\r\n\t\t\t$client = new SoapClient($this->props['remote_host'].'/external/api/api.wsdl', \r\n\t\t\t\tarray('location' => $this->props['remote_host'].'/external/api/api.php'));\r\n\t\t\t$result = $client->$function_name($this->props['api_version'], $this->props['auth_key'], $request_xml);\r\n\t\t} // end try\r\n\t\t// there was an error trying to make the API call\r\n\t\tcatch (SoapFault $fault)\r\n\t\t{\r\n\t\t\tthrow new Services_WorkXpress_API_Exception(\"SOAP Fault: (faultcode: {$fault->faultcode}; faultstring: {$fault->faultstring})\");\r\n\t\t} // end catch SoapFault\r\n\t\t\r\n\t\t// create a response object\r\n\t\t$class_name = str_replace('Request', 'Response', get_class($this));\r\n\t\tif (substr($class_name, -4) == 'Mass')\r\n\t\t{\r\n\t\t\t$class_name = substr($class_name, 0, -4);\r\n\t\t}\r\n\t\t$response = new $class_name($result);\r\n\t\t\r\n\t\treturn $response;\r\n\t}", "public function execute_http()\n {\n }", "public function amazonCall()\n {\n $sOperation = $this->_getOperationName();\n $allowedOperations = array('processorderreference', 'getorderreferencedetails', 'setorderreferencedetails', 'confirmorderreference', 'cancelorderreference', 'closeorderreference', 'closeauthorization', 'authorize', 'processauthorization', 'getauthorizationdetails', 'getauthorizationdetails', 'setcapturestate', 'capture', 'getcapturedetails', 'savecapture', 'refund', 'updaterefund', 'getrefunddetails', 'setorderattributes', 'processamazonlogin');\n\n if ($this->_verifySecretKey() !== true) {\n return;\n }\n\n if ($sOperation !== false && in_array(strtolower($sOperation), $allowedOperations)) {\n $oResult = $this->_getContainer()->getClient()->{$sOperation}(\n $order = $this->_getOrder(),\n $params = $this->_getParams()\n );\n\n $this->_oLogger->info(\n 'Execute specific amazon call',\n array(\n 'operation' => $sOperation,\n 'oxid' => $order ? $order->getId() : null,\n 'params' => $params\n )\n );\n\n $this->_addToMessages('<pre>'.print_r($oResult, true).'</pre>');\n return;\n }\n\n $this->setViewData(array(\n 'sError' => 'Please specify operation you want to call (&operation=) '\n .'and use &oxid= parameter to specify order ID or use &aParams[\\'key\\']=value'\n ));\n }", "public function execute(){\n try {\n $request = $this->getRestClient();\n $raw_response = $request->request();\n } catch (Zend_Http_Client_Exception $e) {\n Mage::helper('unbxd_recommendation')->log(Zend_Log::ERR,\n sprintf($this->getUrl() .\" failed because HTTP error: %s\", $e->getMessage()));\n return Mage::getModel('unbxd_recommendation/api_response')\n ->setErrorMessage(Unbxd_Recommendation_Model_Api_Response::SERVER_ERR);\n }\n return Mage::getModel(\"unbxd_recommendation/api_response\")\n ->setJsonResponse($this->isJsonResponse())\n ->setResponse($raw_response, $this->getUrl());\n }", "public function call($httpVerb = 'POST', $method, $args = array()) {\n return $this->_raw_request($httpVerb, $method, $args);\n }", "public function call( $params = array(), $method = 'POST' ) {\n\n\t\t$params['apiKey'] = $this->api_key;\n\t\t$this->base_url = $this->get_base_url();\n\n\t\tswitch ( $method ) {\n\t\t\tcase 'GET':\n\t\t\t\t$response = $this->send( 'GET', $this->base_url . '&' . http_build_query( $params ) );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$response = $this->send( 'POST', $this->base_url, $params );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $response;\n\t}", "function request($httpMethod, $service, $apiMethod, array $parameters = array(), array $options = array());", "public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }", "function http($url, $method = 'GET', $postfields = NULL, $headers = array()) {\n\t\t$ci = curl_init();\n\t\t/* Curl settings */\n\t\tcurl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n\t\tcurl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, array_merge(array('Expect:'),$headers));\n\t\tcurl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n\n\t\tswitch ($method) {\n\t\tcase 'POST':\n\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\t\tif (!empty($postfields)) {\n\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tif (!empty($postfields)) {\n\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t}\n\t\t}\n\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ($ci);\n\t\treturn $response;\n\t}", "public function r2__statamic_api_call()\n {\n // Figure out which class and method to use.\n // Default to POST, fall back to GET.\n $class = array_get($_POST, 'class', array_get($_GET, 'class'));\n $method = array_get($_POST, 'method', array_get($_GET, 'method'));\n // Unset the class and method so that the implosion of the rest of the\n // data results in the necessary args.\n unset($_POST['class'], $_POST['method'], $_GET['class'], $_GET['method']);\n\n $args = !empty($_POST) ? $_POST : $_GET;\n\n $response = call_user_func_array(array($class, $method), $args);\n\n if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&\n strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'\n ) {\n die(json_encode($response));\n }\n return $response;\n }", "public function Request() {\r\n\r\n\t\t$res = $this->client->RequestPayment(array(\r\n\t\t\t\"MerchantID\" => $this->MerchantID,\r\n\t\t\t\"Password\" => $this->Password,\r\n\t\t\t\"Price\" => $this->Price,\r\n\t\t\t\"ReturnPath\" => $this->ReturnPath,\r\n\t\t\t\"ResNumber\" => $this->ResNumber,\r\n\t\t\t\"Description\" => $this->Description,\r\n\t\t\t\"Paymenter\" => $this->Paymenter,\r\n\t\t\t\"Email\" => $this->Email,\r\n\t\t\t\"Mobile\" => $this->Mobile\r\n\t\t));\r\n\r\n\t\t$PayPath = $res->RequestPaymentResult->PaymentPath;\r\n\t\t$Status = $res->RequestPaymentResult->ResultStatus;\r\n\r\n\t\tif($Status == 'Succeed') {\r\n\t\t\t//header(\"Location: $PayPath\");\r\n\t\t\techo \"<meta http-equiv='Refresh' content='0;URL=$PayPath'>\";\r\n\t\t} else {\r\n\t\t\treturn $Status; \r\n\t\t}\r\n\r\n\t}", "protected function callService ()\n\t{\n\t\t$this->protocol->callService( $this->data ) ;\n\t}", "protected function _performRequest(\n\t\t$path = '/',\n\t\t$queryString = '',\n\t\t$httpVerb = Zend_Http_Client::GET,\n\t\t$headers = [],\n\t\t$rawData = null\n\t) {\n\t // Clean path\n\t\tif (strpos($path, '/') !== 0) {\n\t\t\t$path = '/' . $path;\n\t\t}\n\n\t\t// Clean headers\n\t\tif (is_null($headers)) {\n\t\t $headers = [];\n\t\t}\n\n\t\t// Ensure cUrl will also work correctly:\n\t\t// - disable Content-Type if required\n\t\t// - disable Expect: 100 Continue\n\t\tif (!isset($headers[\"Content-Type\"])) {\n\t\t\t$headers[\"Content-Type\"] = '';\n\t\t}\n\t\t//$headers[\"Expect\"] = '';\n\n\t\t// Add version header\n\t\t$headers['x-ms-version'] = $this->_apiVersion;\n\n\t\t// URL encoding\n\t\t$path = self::urlencode($path);\n\t\t$queryString = self::urlencode($queryString);\n\n\t\t// Generate URL and sign request\n\t\t$requestUrl = $this->getBaseUrl() . $path . $queryString;\n\t\t$requestHeaders = $headers;\n\n\t\t// Prepare request\n\t\t$this->_httpClientChannel->resetParameters(true);\n\t\t$this->_httpClientChannel->setUri($requestUrl);\n\t\t$this->_httpClientChannel->setHeaders($requestHeaders);\n\t\t$this->_httpClientChannel->setRawData($rawData);\n\n\t\t// Execute request\n\t\t$response = $this->_retryPolicy->execute(\n\t\t [$this->_httpClientChannel, 'request'],\n\t\t [$httpVerb]\n\t\t);\n\n\t\t// Store request id\n\t\t$this->_lastRequestId = $response->getHeader('x-ms-request-id');\n\n\t\treturn $response;\n\t}", "public function actionApi() {\n Yii::import('application.extensions.Payments.*');\n\n $way = Yii::app()->request->getParam('way');\n if ($way == '99bill') {\n $type = Yii::app()->request->getParam('callback');\n $func = $type . 'Callback';\n $payment = new PaymentsKuaiqian();\n $result = $payment->$func();\n if ($result['result'] == 1) {//成功\n $SmsHandler = new SMS();\n $SmsHandler->sendPaymentMsg($result['orderId']);\n }\n if ($type == 'async' || Yii::app()->user->isGuest) {\n $url = 'http://' . $_SERVER['HTTP_HOST'] . '/order/payments/completed/id/' . $result['orderId'];\n echo \"<result>{$result['result']}</result><redirecturl>$url</redirecturl>\";\n exit();\n } else {\n $this->redirect('/order/payments/completed/id/' . $result['orderId']);\n }\n }\n }", "public function execute():HTTP_Request2_Response\n {\n switch ($this->accessMethod) {\n case 'create':\n $response = $this->callPost();\n break;\n case 'get':\n $response = $this->callGet();\n break;\n case 'getall':\n $response = $this->callGetAll();\n break;\n case 'update':\n $response = $this->callUpdate();\n break;\n case 'delete':\n $response = $this->callDelete();\n break;\n case 'summarize':\n $response = $this->callSummary();\n break;\n case 'summarizeall':\n $response = $this->callSummaryAll();\n break;\n default:\n throw new VuforiaAccessAPIException(\"UserError: INVALID VUFORIAACCESS OPERATION!\\n\n Got $this->accessMethod instead of post, get, getAll, update, delete, summarize, summarizeAll!\", 251);\n }\n return $response;\n }", "abstract function do_api_request();", "private function _send_request( $url_segs, $params = array(), $http_method = 'get', $stripe_key_secret ) {\r\n\t\t$key = $stripe_key_secret;\r\n\t\t\t\r\n\t\t// Initializ and configure the request\r\n\t\t$req = curl_init( 'https://api.stripe.com/v1/'.$url_segs );\r\n\t\tcurl_setopt( $req, CURLOPT_SSL_VERIFYPEER, FALSE );\r\n\t\tcurl_setopt( $req, CURLOPT_HTTPAUTH, CURLAUTH_ANY );\r\n\t\tcurl_setopt( $req, CURLOPT_USERPWD, $key.':' );\r\n\t\tcurl_setopt( $req, CURLOPT_RETURNTRANSFER, TRUE );\r\n\t\t\r\n\t\t// Are we using POST? Adjust the request properly\r\n\t\tif( $http_method == STRIPE_METHOD_POST ) {\r\n\t\t\tcurl_setopt( $req, CURLOPT_POST, TRUE );\r\n\t\t\tcurl_setopt( $req, CURLOPT_POSTFIELDS, http_build_query( $params, NULL, '&' ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $http_method == STRIPE_METHOD_DELETE ) {\r\n\t\t\tcurl_setopt( $req, CURLOPT_CUSTOMREQUEST, \"DELETE\" );\r\n\t\t\tcurl_setopt( $req, CURLOPT_POSTFIELDS, http_build_query( $params, NULL, '&' ) );\r\n\t\t}\r\n\t\t\r\n\t\t// Get the response, clean the request and return the data\r\n\t\t$response = curl_exec( $req );\r\n\t\tcurl_close( $req );\r\n\t\treturn $response;\r\n\t}", "public function pay(): JsonResponse;", "public function execute(){\n\n $body = '{\"payer_id\":\"' . $this->payer_id . '\"}';\n $client = new Client();\n try{\n $paymentInfo = $client->request('POST', $this->execute_url, ['headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $body\n ]);\n }\n catch (\\Exception $ex) {\n $error = json_encode($ex->getMessage());\n return($error);\n }\n $this->parsePaymentBody($paymentInfo);\n return $this->paymentBody;\n\n }", "public function execute () {\n $input = [\n 'active' => [0,1]\n ];\n $categories = $this->_api_client->get('/category', $input);\n\n // set returned value to the view\n $this->set('categories', $categories);\n\n // get products using the API\n $input = [\n 'active' => [0,1]\n ];\n $products = $this->_api_client->get('/product', $input);\n\n // set returned value to the view\n $this->set('products', $products);\n }", "public function doAction($methodName, $payload, $httpHeaders)\n {\n $this->setHttpHeader($httpHeaders);\n self::$soapClient->__setSoapHeaders($this->getAuthHeader());\n $response = self::$soapClient->$methodName($payload);\n\n return json_encode($response);\n }", "function request($host_url, $id, $entity, $auth)\n {\n $url = \"$host_url/v1/checkouts/$id/payment?entityId=$entity\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Authorization:Bearer $auth\"));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // this should be set to true in production\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $responseData = curl_exec($ch);\n if (curl_errno($ch)) {\n return curl_error($ch);\n }\n curl_close($ch);\n return $responseData;\n }", "public function call($method, $url, $data = array())\n\t{\n\t\treturn $this->http->$method($url, $data);\n\t}", "public function serviceRequest()\n {\n API::post('ivr/serviceRequest', array(\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }", "protected function doHttpGetMethod(Http $http, array $queryFields)\n\t{\n\n //LECTURE/READ ONLY MODE (lecture)\n\n // Validation de la query string.\n //ID is discriminator (permet to select one and only one line on my listing; ex gender(boy, girl))\n if(array_key_exists('id', $queryFields) == true)\n {\n if(ctype_digit($queryFields['id']) == true)\n {\n\t\t\t\t// Récupération des informations sur nursery request.\n $nurseryRequest = NurseryRequestModel::readNurseryRequestById($queryFields['id']);\n\n //Fetch Kid information\n $kidPerson = new PersonModel();\n $mumPerson = new PersonModel();\n $dadPerson = new PersonModel();\n\n if(!empty($nurseryRequest->getKidId())){\n $kid = KidModel::readKidById($nurseryRequest->getKidId());\n //Fetch Person info based on kid id\n $kidPerson = PersonModel::readPersonById($kid->getInfoKidId());\n $family = FamilyModel::readFamilyById($kid->getFamilyId());\n $mumPerson = PersonModel::readPersonById($family->getMotherId());\n $dadPerson = PersonModel::readPersonById($family->getFatherId());\n\n }\n \n\n $infoMessage = null;\n if(array_key_exists('statusAction', $queryFields) == true){\n if($queryFields['statusAction'] == 'created'){\n $infoMessage=\"Votre demande a bien été créée\";\n }else{\n $infoMessage=\"Votre demande a bien été modifiée\";\n }\n\n }\n //TO DO AK TRY CATCH EXCEPTION IN ORDER TO SET AN ERROR MSG\n return\n [\n 'errorMessage' => null,\n 'infoMessage' => $infoMessage,\n 'nurseryRequest' => $nurseryRequest,\n 'kidPerson' => $kidPerson,\n 'mumPerson' => $mumPerson,\n 'dadPerson' => $dadPerson,\n ];\n \n }\n }\n\n //DISPLAY AN EMPTY CREATION FORM\n $nurseryRequest = new NurseryRequestModel();\n $kidPerson = new PersonModel();\n $mumPerson = new PersonModel();\n $dadPerson = new PersonModel();\n\n return\n [\n 'errorMessage' => null,\n 'nurseryRequest' => $nurseryRequest,\n 'mumPerson' => $mumPerson,\n 'dadPerson' => $dadPerson,\n 'kidPerson' => $kidPerson,\n ];\n\n }", "public function send()\n\t{\n\t\t$url \t\t= $this->getURL();\t\t\n\t\t$data \t\t= $this->getData();\n\t\t$method \t= $this->getMethod();\n\t\t\t\t\n\t\t$ch = curl_init();\n\t\t$options = $this->_options;\n\t\tcurl_setopt_array($ch, array(\n\t\t\tCURLOPT_USERAGENT \t => $options->useragent,\n\t\t\tCURLOPT_CONNECTTIMEOUT => $options->connection_timeout,\n\t\t\tCURLOPT_TIMEOUT\t\t => $options->timeout,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLINFO_HEADER_OUT\t => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => $options->ssl,\n\t\t\tCURLOPT_HEADER\t\t => false\n\t\t));\n\t \n $headers = array();\n //if data is string then \n //set the authorization header\n //A Hack to make the linked-in work wihtout affecting\n //other services\n if ( is_string($this->_data) ) {\n $headers[] = $this->_internal_request->to_header();\n $headers[] = \"Content-Type: text/plain\";\n }\n \n if ( !empty($headers) )\n curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);\n \n\t\tswitch ($method) \n\t\t{\n\t\t\tcase KHttpRequest::POST :\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\n\t\t\tcase KHttpRequest::PUT\t: \n\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\t\n\t\t\tcase KHttpRequest::DELETE:\n\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t}\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\t\n\t\t$response = curl_exec($ch);\n\t\t\n\t\treturn new ComConnectOauthResponse($response, curl_getinfo($ch));\n\t}", "protected function buildRequest($call, $method = Varien_Http_Client::GET, $postData = false, $headers = false)\n {\n\n // Grab a new instance of HTTP Client\n $http = new Varien_Http_Client();\n\n if(Mage::getStoreConfig(self::API_ENVIRONMENT_XML_PATH) == Smartbox_Smartboxparcels_Model_System_Config_Environment::SMARTBOX_PRODUCTION){\n $http->setUri(Mage::getStoreConfig(self::API_PRODUCTION_XML_PATH) . $call);\n $api_key = array(\n 'X-Api-Key' => Mage::getStoreConfig(self::API_KEY_XML_PATH),\n 'X-Api-User'=> Mage::getStoreConfig(self::API_USERNAME_XML_PATH),\n 'X-Api-Passwd'=> Mage::getStoreConfig(self::API_PASSWORD_XML_PATH)\n );\n $http->setHeaders($api_key);\n }\n else{\n $http->setUri(Mage::getStoreConfig(self::API_STAGING_XML_PATH) . $call);\n $api_key = array(\n 'X-Api-Key' => Mage::getStoreConfig(self::API_KEY_XML_PATH),\n 'X-Api-User'=> Mage::getStoreConfig(self::API_USERNAME_XML_PATH),\n 'X-Api-Passwd'=> Mage::getStoreConfig(self::API_PASSWORD_XML_PATH)\n );\n $http->setHeaders($api_key);\n }\n\n // Set the method in, defaults to GET\n $http->setMethod($method);\n\n // Do we need to add in any post data?\n if($method == Varien_Http_Client::POST) {\n if (is_array($postData) && !empty($postData)) {\n\n // Add in our post data\n $http->setParameterPost($postData);\n\n } else if (is_string($postData)) {\n\n // Try and decode the string\n try {\n\n // Attempt to decode the JSON\n $decode = Mage::helper('core')->jsonDecode($postData, Zend_Json::TYPE_ARRAY);\n\n // Verify it decoded into an array\n if ($decode && is_array($decode)) {\n\n // Include the post data as the raw data body\n $http->setRawData($postData, 'application/json')->request(Varien_Http_Client::POST);\n }\n\n } catch (Zend_Json_Exception $e) {\n $this->_log($e);\n return false;\n }\n\n }\n }\n\n // attempting to add any headers into the request\n if($headers && is_array($headers) && !empty($headers)) {\n\n // Add in our headers\n $http->setHeaders($headers);\n }\n\n // Return the HTTP body\n return $http;\n }", "public function request_api($http_method, $uri, $params = array()){\n\t\t\n\t\t// prepare request url\n\t\t$request_url = $this->api_url.'/'.$uri;\n\t\t// send request\n\t\treturn $this->_request( $http_method, $request_url, $params );\n\t}", "function invokeService($params) {\n if (isset($params['service'])) {\n if (isset($params['request'])) {\n $request = json_decode($params['request']);\n }\n header('Content-type: application/json');\n switch ($params['service']) {\n case \"getAllVendors\": \n echo json_encode((object) array('vendors' => getAllVendors()));\n break;\n }\n exit;\n } \n }", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "private function getPayment() {\r\n\r\n\t\t\t$refreshed_token = new Token($this->id, $this->secret, null);\r\n\r\n\t\t\t// Get bill id from URI\r\n\t\t\t$sections = explode(\"/\", $_SERVER['REQUEST_URI']);\r\n\t\t\t$bill_id = $sections[1];\r\n\r\n\t\t\t$payments = $this->user->getPayments($bill_id);\r\n\r\n\t\t\tif($payments) {\r\n\r\n\t\t\t\techo json_encode([\r\n\t\t\t\t\t'code' => 200,\r\n\t\t\t\t\t'message' => 'OK',\r\n\t\t\t\t\t'payments' => $payments,\r\n\t\t\t\t\t'token' => $refreshed_token->getTokenString()\r\n\t\t\t\t]);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\techo json_encode([\r\n\t\t\t\t\t'code' => 404,\r\n\t\t\t\t\t'message' => 'Not found',\r\n\t\t\t\t\t'payments' => '',\r\n\t\t\t\t\t'token' => $refreshed_token->getTokenString()\r\n\t\t\t\t]);\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "public function run()\n\t\t{\n\t\t\tswitch ($_GET['act']) {\n\t\t\t\tcase 'create':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->create();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lists':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->lists();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'listsDetails':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->listsDetails();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'get':\n\t\t\t\t\t//Obtener una Remision\n\t\t\t\t\t$this->getRemision();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'getFolio':\n\t\t\t\t\t$this->getFolio();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\techo $this->json_encode(array('error'=>SERVICIO_INEXISTENTE,'data'=>NULL,'mensaje'=>'Este servicio no está disponible'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//CARGAR VISTA DE SERVICIO INEXISTENTE\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function doRequest() {\n $this->request = $this->prepareRequest();\n \n $url = $this->conf->getEndPoint($this->orderType);\n $request = new WebServiceSoap\\SveaDoRequest($url);\n\n $svea_req = $request->GetAddresses($this->request);\n\n $response = new \\SveaResponse($svea_req,\"\");\n return $response->response;\n }", "protected function _request($http_method, $request_url, $params = array()){\n\t\t$request_url = str_replace( '{username}', $this->username, $request_url );\n\n\t\t// convert params as to query string\n\t\tif( $http_method == 'GET' ){\n\t\t\tif( !empty($params) ){\n\t\t\t\t$query_string = http_build_query($params);\n\t\t\t\t$request_url .= '?' . $query_string;\n\t\t\t\t$params = NULL;\n\t\t\t}\n\t\t}\n\n\t\t// save last request data and clean previous response data\n\t\t$this->request_data = array(\n\t\t\t'http_method' => $http_method,\n\t\t\t'url' => $request_url,\n\t\t\t'params' => $params,\n\t\t);\n\t\t$this->response_data = array();\n\t\t\n\t\t// prepare access token header\n\t\t$access_token_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $http_method, $request_url, $params);\n\t\t$access_token_req->sign_request($this->signature_method, $this->consumer, $this->token);\n\t\t\n\t\t// curl lib require header opt be set as array, so prepare it:\n\t\t$curl_opts = array( 'httpheader' => array( $access_token_req->to_header() ) );\n\t\t$this->request_data['header'] = $curl_opts['httpheader'];\n\t\t\n\t\t// send request with curl\n\t\t$result = $this->curl($request_url, $params, $curl_opts, $http_method);\n\t\t\n\t\t$this->response_data = $result;\n\t\t\n\t\treturn $result;\n\t}", "public function execute(){\n $paymentId = $_GET['paymentId'];\n $payment = Payment::get($paymentId, $this->_apiContext);\n $payerId = $_GET['PayerID'];\n\n // Execute payment with payer ID\n $execution = new PaymentExecution();\n $execution->setPayerId($payerId);\n \n $transaction = new Transaction();\n $amount = new Amount();\n\n $details = new Details();\n $details->setShipping(0)\n ->setTax(0)\n ->setSubtotal(Cart::subtotal());\n\n $amount->setCurrency('BRL');\n $amount->setTotal(Cart::total());\n $amount->setDetails($details);\n\n $transaction->setAmount($amount);\n\n $execution->addTransaction($transaction);\n\n try{\n // Execute payment\n $result = $payment->execute($execution, $this->_apiContext);\n \n try{\n\n $payment = Payment::get($paymentId, $this->_apiContext);\n }catch(Exception $ex){\n\n die($ex);\n }\n }catch(PayPalConnectionException $ex){\n\n echo $ex->getCode();\n echo $ex->getData();\n die($ex);\n }catch(Exception $ex){\n\n die($ex);\n }\n\n Session::flash('status', 'Pagamento realizado');\n Session::put('token-paypal', $_GET['token']);\n return redirect('/paypal/transaction/complete');\n }", "public function __invoke(Request $request, $id)\n {\n $data = array(\"url\" => \"http://localhost:8000/students/loans/\".$id, \"amount\" => 1,\n \"transref\" => $id.time(), \"terminalId\" => \"STUDENTLOAN_EFS\" );\n $json = json_encode($data);\n $ch = curl_init(\"https://naira.com/webapi/stanbicpay.php\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $response = curl_exec($ch);\n curl_close($ch);\n echo $response;\n }", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "public function call()\n {\n $env = $this->application->environment();\n if (isset($env['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n // Header commonly used by Backbone.js and others\n $env['light.method_override.original_method'] = $env['REQUEST_METHOD'];\n $env['REQUEST_METHOD'] = strtoupper($env['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } elseif (isset($env['REQUEST_METHOD']) && $env['REQUEST_METHOD'] === 'POST') {\n // HTML Form Override\n $req = new \\Light\\Http\\Request($env);\n $method = $req->post($this->configs['key']);\n if ($method) {\n $env['light.method_override.original_method'] = $env['REQUEST_METHOD'];\n $env['REQUEST_METHOD'] = strtoupper($method);\n }\n }\n $this->next->call();\n }", "public function request()\n {\n $request = new GuzzleHttp\\Psr7\\Request('GET', 'ProductsSimple');\n\n return $request->withUri($request->getUri()->withQuery(http_build_query([\n 'startRow' => $this->skip ? $this->skip + 1 : null,\n 'pageRows' => $this->take,\n 'updatedAfter' => $this->updatedAfter ? $this->updatedAfter->format('Y-m-d\\TH:i:s') : null\n ])));\n }", "protected function _execute(array $params)\n\t{\n\t\tif (isset($params['headers']))\n\t\t{\n\t\t\t// Save the headers in $_SERVER\n\t\t\tif (NULL !== ($headers = json_decode($params['headers'], true)))\n\t\t\t{\n\t\t\t\tforeach ($headers as $name => $value)\n\t\t\t\t{\n\t\t\t\t\t$_SERVER['HTTP_'. strtoupper($name)] = (string) $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove the headers before execute the request.\n\t\t\tunset($params['headers']);\n\t\t}\n\n\t\tif (isset($params['method']))\n\t\t{\n\t\t\t// Use the specified method.\n\t\t\t$method = strtoupper($params['method']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$method = 'GET';\n\t\t}\n\n\t\tif (isset($params['get']))\n\t\t{\n\t\t\t// Overload the global GET data.\n\t\t\tparse_str($params['get'], $_GET);\n\t\t}\n\n\t\tif (isset($params['post']))\n\t\t{\n\t\t\t// Overload the global POST data.\n\t\t\tparse_str($params['post'], $_POST);\n\t\t}\n\n\t\tprint Request::factory($params['resource'])\n\t\t\t\t->method($method)\n\t\t\t\t->execute();\n\t}", "public function makeCall() {\n try {\n $request_params = \\Request::all();\n $file_name = str_replace('+', '0', $request_params['To']) . '.xml';\n $data = file_get_contents(\"https://s3.eu-central-1.amazonaws.com/barq-live/call_xmls/\" . $file_name);\n print($data);\n } catch (\\Illuminate\\Database\\QueryException $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n } catch (\\Exception $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n }\n }", "public function send()\n {\n $queryString = $this->buildQueryString();\n\n $headers = array(\n 'method' => 'POST',\n 'content' => $this->buildQueryString(),\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\" .\n \"Content-Length: \" . strlen($queryString) . \"\\r\\n\\r\\n\"\n );\n\n $request = file_get_contents(\n $this->getPaypalUrl(),\n false,\n stream_context_create(array('http' => $headers))\n );\n\n return new Response($request);\n }", "function call($method, $parameters)\n\t {\n\t\tob_start();\n\t\t$curl_request = curl_init();\n\n\t\tcurl_setopt($curl_request, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($curl_request, CURLOPT_POST, 1);\n\t\tcurl_setopt($curl_request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n\t\tcurl_setopt($curl_request, CURLOPT_HEADER, 1);\n\t\tcurl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl_request, CURLOPT_FOLLOWLOCATION, 0);\n\n\t\t$jsonEncodedData = json_encode($parameters);\n\n\t\t$post = array(\n\t\t \"method\" => $method,\n\t\t \"input_type\" => \"JSON\",\n\t\t \"response_type\" => \"JSON\",\n\t\t \"rest_data\" => $jsonEncodedData\n\t\t);\n\n\t\tcurl_setopt($curl_request, CURLOPT_POSTFIELDS, $post);\n\t\t$result = curl_exec($curl_request);\n\t\tcurl_close($curl_request);\n\t\t$result = explode(\"\\r\\n\\r\\n\", $result, 2);\n\t\t$response = json_decode($result[1]);\n\t\tob_end_flush();\n\n\t\treturn $response;\n\t }", "protected function send()\n {\n $this->addAuthorization();\n\n $response = $this->client->post(\n $this->apiUrl,\n array(\n 'json' => array(\n 'query' => $this->getQuery(),\n 'variables' => $this->variables,\n ),\n 'headers' => $this->headers,\n )\n );\n\n $responseBody = json_decode($response->getBody(), true);\n if ($responseBody === null) {\n throw new \\RuntimeException('Invalid api call: '.json_encode($this->getQuery()));\n }\n\n $this->body = $responseBody;\n if (isset($responseBody['errors'])) {\n $this->errors = $responseBody['errors'];\n } else {\n $this->response = $responseBody['data'];\n }\n }", "public function doRequests();", "private function callApi(){\n $endpoint = sprintf( self::$ENDPOINT, $this->category );\n\n // call URL and get contents\n $content = file_get_contents($endpoint);\n\n // Check if Backend API has failed to return a successul response\n if($content===FALSE){\n throw new Exception(\"Backend service failed to return a response. Possibly throttling our request.\");\n }\n\n // Parse JSON response\n $response = json_decode($content, true);\n\n // Return just the quote\n $quote = $response['contents']['quotes'][0];\n $quote['requested_category'] = $this->category;\n if(!$quote['id']){\n $quote['id'] = substr( md5($str), 0, 32); // just a unique id if missing\n }\n\n return $quote;\n }", "public static function invoke() {\n\t\tswitch ($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'POST': \n\t\t\t\tstatic::post();\n\t\t\t\tbreak;\n\t\t\tcase 'PUT':\n\t\t\t\tstatic::put();\n\t\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\tstatic::delete();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstatic::get();\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function execute()\n {\n // executes a cURL session for the request, and sets the result variable\n $result = Request::get($this->getRequestURL())->send();\n // return the json result\n return $result->raw_body;\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function byOperation()\n {\n try {\n $donos = CNAB::listAllDonos();\n $data = [];\n\n foreach($donos as $key => $value) {\n $lojas = CNAB::findByDono($value->donoLoja);\n\n $data[$key]['dono'] = $value->donoLoja;\n $data[$key]['lojas'] = $lojas;\n\n $valorSaldo = 0.0;\n foreach($lojas as $l) {\n if ($l->natureza == 'Saída') {\n $valorSaldo -= floatval($l->valor);\n } else {\n $valorSaldo += floatval($l->valor);\n }\n }\n\n $data[$key]['saldoTotal'] = $valorSaldo;\n }\n\n return response()->json($data, 200);\n } catch(\\Exception $e) {\n return response()->json([\n 'status' => 'error',\n 'message' => $e->getMessage()\n ], 400);\n }\n }", "public function api()\n {\n $postData = $this->request->post;\n $getData = $this->request->get;\n\n $action = explode('/', $getData['route']);\n $action = array_pop($action);\n\n $data = [\n 'post' => $postData,\n 'get' => $getData\n ];\n\n $verb = strtolower($_SERVER['REQUEST_METHOD']);\n\n $api = new Api($data, $verb, $this);\n $result = $api->{$action}();\n\n $this->sendResponse($result);\n }", "protected function http(){\n\n if( empty($this->HTTPClient) ){\n\n //init stack\n $stack = HandlerStack::create();\n\n if ( $this->token ){\n\n //setup to send the token with each request\n\n $this->addHeader(Headers::AUTHORIZATION, ( \"TOKEN \" . $this->token->getValue() ) );\n\n }\n else{\n\n //setup client to send signed requests\n\n $signer = new Signer(Settings::PROVIDER);\n $middleware = new Middleware($signer, $this->cfg->getKey(), $this->cfg->getSecret());\n\n $stack->push($middleware);\n\n }\n\n //enable debug\n if( $logger = $this->cfg->getLogger() )\n $this->pushRequestLogger($logger, $stack);\n\n //create the client\n $this->HTTPClient = new HTTPClient([\n 'headers' => &$this->headers,\n 'timeout' => $this->cfg->getRequestTimeout(),\n 'handler' => $stack\n ]);\n\n return $this->HTTPClient;\n\n }\n\n return $this->HTTPClient;\n\n }", "public function service(BLW_HTTP_Request $request, BLW_HTTP_Response $response);", "public function executeRequest() {\n if($this->method == \"get_range\") {\n \treturn $this->getRange();\n }\n else {\n \t$this->response->setStatusCode(405, \"Method Not Found\");\n\t\t\t\t\treturn $this->response;\n }\n }", "private function _call($path, $params, $post = true) \n {\n $ch = $this->ch;\n $endpoint = $this->endpoint;\n $api_key = $this->api_key;\n \n $params = http_build_query($params);\n\n curl_setopt($ch, CURLOPT_POST, $post);\n curl_setopt($ch, CURLOPT_URL, \"{$endpoint}{$path}?api_key={$api_key}\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);\n\n $response = curl_exec($ch);\n $info = curl_getinfo($ch);\n\n if (curl_error($ch)) {\n return (curl_error($ch));\n }\n return $response;\n }", "public function perform()\n\t\t{\n##\t\t\t$data_string = json_encode($data);\n\t\t\t$ch = curl_init($this->endpoint);\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request_type);\n\n\t\t\tif ($this->payload != NULL)\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $this->payload);\n\t\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n\t\t\t#curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json'));\n\t\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);\n\t\t\t\n\t\t\t$this->result = curl_exec($ch);\n\t\t\t\n\t\t\tif ($ret = json_decode($this->result,true))\n\t\t\t\treturn $ret;\n\t\t\telse\n\t\t\t\tdie(\"ERROR: $this->result\");;\n\t\t\treturn json_decode($this->result,true);\n\t\t}", "function http($url, $method, $postfields = NULL, $headers = array()) {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n $this->postdata = $postfields;\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n if (isset($this->access_token) && $this->access_token)\n $headers[] = \"Authorization: OAuth2 \" . $this->access_token;\n if (!empty($this->remote_ip)) {\n if (defined('SAE_ACCESSKEY')) {\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\n } else {\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\n }\n } else {\n if (!defined('SAE_ACCESSKEY')) {\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\n }\n }\n curl_setopt($ci, CURLOPT_URL, $url);\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n $this->url = $url;\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n echo \"=====headers======\\r\\n\";\n print_r($headers);\n echo '=====request info=====' . \"\\r\\n\";\n print_r(curl_getinfo($ci));\n echo '=====response=====' . \"\\r\\n\";\n print_r($response);\n }\n curl_close($ci);\n return $response;\n }", "protected function doMethod(\\HttpRequest $objRequest, \\HttpResponse $objResponse) {\r\n\t}", "public function run()\n\t\t{\n\t\t\tswitch ($_GET['act']) {\n\t\t\t\tcase 'create':\n\t\t\t\t\t//Crear\n\t\t\t\t\tif(BaseCtrl::isAdmin())\n\t\t\t\t\t\t$this->create();\n\t\t\t\t\telse{\n\t\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\t\techo $this->json_encode(array('error'=>NO_PERMITIDO,'data'=>NULL,'mensaje'=>'No tienes permisos suficientes'));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//CARGAR VISTA DE NO PERMITIDO\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'lists':\n\t\t\t\t\t//Listar \n\t\t\t\t\t$this->lists();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'listsDetails':\n\t\t\t\t\t//Crear \n\t\t\t\t\t$this->listsDetails();\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'get':\n\t\t\t\t\t//Obtener una Recepcion\n\t\t\t\t\t$this->getRecepcion();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'getFolio':\n\t\t\t\t\t$this->getFolio();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($this->api) {\n\t\t\t\t\t\techo $this->json_encode(array('error'=>SERVICIO_INEXISTENTE,'data'=>NULL,'mensaje'=>'Este recepcion no está disponible'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//CARGAR VISTA DE SERVICIO INEXISTENTE\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function request($path, array $parameters = array(), $httpMethod = 'GET', ApiInterface $api);", "private function dispatch(): void {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"{$this->apiUrl}/{$this->endpoint}\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => \"CURL_HTTP_VERSION_1_1\",\n CURLOPT_CUSTOMREQUEST => $this->method\n ));\n\n $this->response = curl_exec($curl); \n curl_close($curl);\n }", "private function suivi_crm(){\t\n\t\t\t\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t\n\t\t\t$result=suivi_crm();\n\t\t\t$this->response($this->json($result), 200);\n\t\t\t$this->response('',204);\t\n\t\t}", "public static function doGet(Array $params)\n {\n $request = new self();\n\n $params = array_merge(array('url' => '', 'data' => array(), 'requestMethod' => 'GET', 'tryNum' => 1), $params);\n $url = $params['url'];\n $tryNum = $params['tryNum'];\n $data = http_build_query($params['data']);\n\n $curl_options = array(\n CURLOPT_VERBOSE => 0,\n CURLOPT_HEADER => 0,\n CURLOPT_FOLLOWLOCATION => 1,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_SSLVERSION => 3,\n CURLOPT_SSL_VERIFYPEER => 0,\n CURLOPT_SSL_VERIFYHOST => 0,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_HTTPHEADER => array(\"Content-Type: application/x-www-form-urlencoded\", \"Accept: text/plain\"),\n );\n\n if (!in_array($params['requestMethod'], array('GET', 'POST')))\n {\n $curl_options[CURLOPT_CUSTOMREQUEST] = $params['requestMethod'];\n }\n\n if (is_debugmode('verbose')) {\n $verboseFile = fopen('php://temp', 'r+');\n $curl_options[CURLOPT_VERBOSE] = 1;\n $curl_options[CURLOPT_STDERR] = $verboseFile;\n }\n\n if ($data)\n {\n if ($params['requestMethod'] == 'POST')\n {\n $curl_options[CURLOPT_POST] = 1;\n $curl_options[CURLOPT_POSTFIELDS] = $data;\n } else {\n $url .= '?' . $data;\n }\n }\n $curl_options[CURLOPT_URL] = $url;\n\n $ch = curl_init();\n curl_setopt_array($ch, $curl_options);\n\n do\n {\n $result = curl_exec($ch);\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $tryNum--;\n } while ($http_code >= 500 && $tryNum > 0);\n $effective_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n curl_close($ch);\n\n if ($params['requestMethod'] == 'POST')\n {\n $effective_url .= '?' . $data;\n }\n\n $request->_setAnswer(array(\n 'result' => $result,\n 'http_code' => $http_code,\n 'effective_url' => $effective_url,\n 'request_method' => $params['requestMethod'],\n ));\n\n if (is_debugmode('request')) {\n $request->debug(array(\n 'Mode' => 'Request'\n ));\n }\n if (is_debugmode('verbose')) {\n rewind($verboseFile);\n $request->_setAnswer(array(\n 'verbose_info' => fread($verboseFile, 8192),\n ));\n\n $request->debug(array(\n 'Mode' => 'Verbose request'\n ));\n }\n return $request;\n }", "public function getPaymentAction()\n\t{\n\t\t$this->_ajaxValidation();\n\t\t$response['content']=$this->_getPaymentHtml();\n\t\t$this->getResponse()->setBody(json_encode($response));\n\t}", "function apiCall ( $http_method, $url, $params=array(), $response_format=null, $request_format=null ) {\n\n if ( empty($response_format) )\n {\n $response_format = $this->guessFormatFromUrl($url);\n }\n\n $ssl_auth = 0;\n if(defined('SYNDICATIONAPICLIENT_SSL_AUTH'))\n $ssl_auth = SYNDICATIONAPICLIENT_SSL_AUTH;\n if(isset($params['ssl_auth'])) {\n $ssl_auth = $params['ssl_auth'];\n unset($params['ssl_auth']);\n }\n\n /*\n foreach ( $params as $p=>$param )\n {\n if ( empty($param) && $param!==0 && $param!=='0' )\n {\n unset( $params[$p] );\n }\n }\n */\n /// ascending order is default, descending order is speicified by a '-' sign\n /// if 'order' param is set, reinterpret that as part of sort param\n if ( !empty($params['sort']) && !empty($params['order']) )\n {\n // clean up sort, strip off leading '-'\n if ( $params['sort']{0} != '-' )\n {\n $params['sort'] = substr( $params['sort'], 1 );\n }\n if ( strtolower(substr($params['order'],4)) == 'desc' )\n {\n $params['sort'] = '-'.$params['sort'];\n }\n }\n\n $http_params = '';\n\n /// our request format type\n $request_headers = array();\n switch( $request_format )\n {\n case 'html':\n $http_params = http_build_query($params,'','&');\n $request_headers[] = 'Content-Type: text/html;charset=UTF-8';\n break;\n case 'xml':\n $http_params = http_build_query($params,'','&');\n $request_headers[] = 'Content-Type: text/xml;charset=UTF-8';\n break;\n case 'json':\n $http_params = json_encode($params);\n $request_headers[] = 'Content-Type: application/json;charset=UTF-8';\n break;\n default:\n @$http_params = http_build_query($params,'','&');\n $request_headers[] = 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8';\n break;\n }\n\n $request_headers[] = 'Date: '.gmdate('D, d M Y H:i:s', time()).' GMT';\n\n /// ask for a specific format type of response\n if ( !empty($response_format) )\n {\n switch( $response_format )\n {\n case 'html':\n $request_headers[] = 'Accept: text/html;charset=UTF-8';\n break;\n case 'json':\n $request_headers[] = 'Accept: application/json;charset=UTF-8';\n break;\n case 'js':\n $request_headers[] = 'Accept: application/javascript;charset=UTF-8';\n break;\n case 'text':\n $request_headers[] = 'Accept: text/plain;charset=UTF-8';\n break;\n case 'image':\n $request_headers[] = 'Accept: image/*;';\n break;\n }\n }\n\n /// content-length required for apiKeyGen\n switch ( strtolower($http_method) )\n {\n case 'post':\n case 'put':\n case 'delete':\n $request_headers[] = 'Content-Length: '.strlen($http_params);\n break;\n case 'get':\n default:\n $request_headers[] = 'Content-Length: 0';\n break;\n }\n\n $apiKey = $this->apiGenerateKey( $http_method, $url, $http_params, $request_headers );\n $request_headers[] = \"Authorization: syndication_api_key {$apiKey}\";\n\n $curl = $this->apiBuildCurlRequest( $http_method, $url, $http_params, $request_headers, $response_format );\n\n /// do some temp memory writing bs to capture curl's output to grab actual request string\n curl_setopt($curl, CURLOPT_VERBOSE, true);\n $verbose = fopen('php://temp', 'rw+');\n curl_setopt($curl, CURLOPT_STDERR, $verbose);\n\n if($ssl_auth == 1) {\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $content = curl_exec($curl);\n rewind($verbose);\n $verbose_log = stream_get_contents($verbose);\n $http = curl_getinfo($curl);\n $http['verbose_log'] = $verbose_log;\n\n if ($content === false)\n {\n curl_close($curl);\n throw new Exception('Syndication: No Response: '. $http['http_code'], $http['http_code'] );\n return null;\n }\n curl_close($curl);\n\n if ( empty($response_format) )\n {\n $response_format = $this->guessFormatFromResponse($http);\n }\n\n $api_response = array(\n 'http' => $http,\n 'content' => $content,\n 'format' => $response_format\n );\n /// test result content-type for JSON / HTML / IMG\n /// json needs to be decoded\n /// html stay as text\n /// images need to be: base64_encoded string or image resource\n if ( $response_format=='image' )\n {\n // as GD handle ?\n // $api_response['content'] = imagecreatefromstring($content);\n } else if ( $response_format=='text' ) {\n // nuthin\n } else if ( $response_format=='html' ) {\n // any html cleaning ?\n } else if ( $response_format=='js' ) {\n // any xss cleaning ?\n } else if ( $response_format=='json' ) {\n try {\n $decoded = json_decode($content,true);\n if ( $decoded === null )\n {\n /// bad json should return empty, or return raw unencoded values?\n } else if ( isset($decoded['results']) ) {\n if ( empty($decoded['results']) || count($decoded['results'])==1 && empty($decoded['results'][0]) )\n {\n $decoded['results'] = array();\n }\n }\n $api_response['content'] = $decoded;\n } catch ( Exception $e ) {\n /// bad json should return empty, or return raw unencoded values?\n }\n }\n return $api_response;\n }", "protected function sendViaGet(): self\n {\n $this->response = $this->callApi('GET', $this->getUrl(), $this->body());\n\n return $this->parseResponse();\n }", "function executeRequest() {\n\n\t\t// curl general\n\t\t$curl_options = [\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => true,\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->_requestType\n\t\t];\n\n\t\t// set to post\n\t\tif($this->_requestType == 'POST') {\n\t\t\t$curl_options[CURLOPT_POST] = true;\n\t\t}\n\n\t\t// build url and append query params\n\t\t$url = $this->url($this->_url);\n\t\t$this->_params[$this->_oauth2->getAccessTokenName()] = $this->_oauth2->getAccessToken();\n\t\tif(count($this->_params) > 0) {\n\t\t\t$url->setQuery($this->_params);\n\t\t}\n\t\t$curl_options[CURLOPT_URL] = $url->val();\n\n\t\t// check request headers\n\t\tif(count($this->_headers) > 0) {\n\t\t\t$header = [];\n\t\t\tforeach ($this->_headers as $key => $parsed_urlvalue) {\n\t\t\t\t$header[] = \"$key: $parsed_urlvalue\";\n\t\t\t}\n\t\t\t$curl_options[CURLOPT_HTTPHEADER] = $header;\n\t\t}\n\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $curl_options);\n\n\t\t// https handling\n\t\tif($this->_certificateFile != '') {\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, $this->_certificateFile);\n\t\t} else {\n\t\t\t// bypass ssl verification\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t}\n\n\t\t// execute the curl request\n\t\t$result = curl_exec($ch);\n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n\t\tif($curl_error = curl_error($ch)) {\n\t\t\tthrow new OAuth2Exception($curl_error);\n\t\t} else {\n\t\t\t$json_decode = $this->jsonDecode($result, true);\n\t\t}\n\t\tcurl_close($ch);\n\n\t\treturn [\n\t\t\t'result' => (null === $json_decode) ? $result : $json_decode,\n\t\t\t'code' => $http_code,\n\t\t\t'content_type' => $content_type\n\t\t];\n\t}", "protected function _execute(){\n\t\t\t$this->_getUrl();\n\n\t\t\t$c = curl_init($this->_url);\n\t\t\tob_start();\n\t\t\tif(!empty($this->_postFields)) {\n\t\t\t\tcurl_setopt($c, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($c, CURLOPT_POSTFIELDS, json_encode($this->_postFields));\n\t\t\t}\n\n\t\t\tcurl_exec($c);\n\t\t\tcurl_close($c);\n\t\t\t$this->_result = trim(ob_get_contents());\n\t\t\tob_end_clean();\n\t\t}", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n if (version_compare(phpversion(), '5.4.0', '<')) {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\r\n } else {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);\r\n }\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, TRUE);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if ( isset($this->access_token) && $this->access_token )\r\n $headers[] = \"Authorization: OAuth2 \".$this->access_token;\r\n\r\n if ( !empty($this->remote_ip) ) {\r\n if ( defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\r\n } else {\r\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\r\n }\r\n } else {\r\n if ( !defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n curl_setopt($ci, CURLOPT_URL, $url );\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo \"=====headers======\\r\\n\";\r\n print_r($headers);\r\n\r\n echo '=====request info====='.\"\\r\\n\";\r\n print_r( curl_getinfo($ci) );\r\n\r\n echo '=====response====='.\"\\r\\n\";\r\n print_r( $response );\r\n }\r\n curl_close ($ci);\r\n return $response;\r\n }", "protected function doRequest($url, $headers, $method, $data) {\n return drupal_http_request($url, array('headers' => $headers, 'method' => $method, 'data' => $data));\n }", "public function Execute ()\n {\n $client = $this->GetServiceWrapper()->GetServiceObject();\n $client_options = $this->GetClientOptions();\n $client->setOptions($client_options);\n\n $this->setRouter($this->GetServiceWrapper()->GetRouteStack() );\n\n $request = $client->getRequest();\n $request->setMethod(static::REQUEST_METHOD);\n $request->getUri()->setPath($this->GetRoute());\n\n $this->mServiceResponse = $client->dispatch($request)->GetBody();\n\n $this->mResult = $this->GetResultPrototype();\n\n if (empty($this->mServiceResponse))\n {\n if (true === $this->mThrowEmptyModelExceptions)\n {\n throw new Interrupt\\ModelNotFoundFailure(get_class($this), get_class($this->GetServiceWrapper()->GetPrototype()), $stmt->queryString);\n }\n }\n else\n {\n $this->ProcessResponse();\n }\n\n return $this->mResult;\n }", "public function execute($httpMethod, $url, array $parameters = []);", "public function sendTo_WO_get() {\n $quotation_id = $_GET['quotation_id'];\n $branch_name = $_GET['branch_name'];\n $response = $this->QuotationForEnquiry_model->sendTo_WO($quotation_id,$branch_name);\n return $this->response($response);\n }", "public function __invoke(Request $request)\n {\n if ($request->header('x-callback-token') !== config('services.xendit.callback_token')) {\n abort(400, \"Invalid callback token.\");\n }\n\n $order = Order::firstWhere('xendit_invoice_id', $request->post('id'));\n\n if (\n $order &&\n $request->post('status') === 'PAID' &&\n $request->post('paid_at')\n ) {\n $order->update([\n 'paid_at' => new Carbon($request->post('paid_at'))\n ]);\n }\n\n if (\n $order &&\n $request->post('status') === 'EXPIRED' &&\n $request->post('expiry_date')\n ) {\n $order->update([\n 'expiry_date' => new Carbon($request->post('expiry_date'))\n ]);\n }\n\n return response()->json($request->post());\n }", "public function call($url, $body = [] , $method = \"GET\")\n {\n $shop = User::first();\n return $shop->api()->rest($method, $url, $body);\n }", "public function doSend($parameters = array(), $httpMethod = 'POST') {\n $this->updateHistory();\n $currentOptions = array();\n\n // Makes sure to convert object format to json so the library can decode it into a stdClass\n if ($this->options['format'] === 'object') {\n $currentOptions['format'] = 'json';\n }\n\n $currentOptions = $currentOptions + $this->options;\n\n //Set curl options\n $curlOptions = $this->setCurlOptions($parameters, $currentOptions, $httpMethod);\n\n //Initialize the curl\n $curl = curl_init();\n\n //Assign the curl options\n curl_setopt_array( $curl, $curlOptions );\n\n if ( ($response = curl_exec( $curl )) === false ) {\n $this->error_handler( 'cURL Error: ' . curl_error( $curl ), curl_errno( $curl ) );\n }\n\n //Validate repository issue is posted or not\n $this->validateResponse($response);\n\n //Handle curl errors\n $headers = curl_getinfo( $curl );\n $errorNumber = curl_errno( $curl );\n $errorMessage = curl_error( $curl );\n\n //Close the curl\n curl_close( $curl );\n\n $this->content_type = $headers['content_type'];\n $this->http_code = $headers['http_code'];\n\n //Make custom error message based on OAuth Api Exception class\n if ( ! array_key_exists($headers['http_code'], AuthApiException::$acceptableCodes ) ) {\n $custom_message = \"\";\n if ( array_key_exists($headers['http_code'], $currentOptions['custom_errors'] ) ) {\n $custom_message = $currentOptions['custom_errors'][$headers['http_code']];\n } else {\n $custom_message = null;\n }\n\n return $custom_message;\n }\n\n if ( ! empty( $errorNumber ) ) {\n $this->error_handler( 'error ' . $errorNumber );\n }\n\n return $response;\n }", "public function execute($data)\n {\n //Initialize the logger\n $this->logger->info($this->httpConfig->getMethod() . ' ' . $this->httpConfig->getUrl());\n\n //Initialize Curl Options\n $ch = curl_init($this->httpConfig->getUrl());\n $options = $this->httpConfig->getCurlOptions();\n if (empty($options[CURLOPT_HTTPHEADER])) {\n unset($options[CURLOPT_HTTPHEADER]);\n }\n curl_setopt_array($ch, $options);\n curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl());\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders());\n\n //Determine Curl Options based on Method\n switch ($this->httpConfig->getMethod()) {\n case 'POST':\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n break;\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n break;\n }\n\n //Default Option if Method not of given types in switch case\n if ($this->httpConfig->getMethod() != null) {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod());\n }\n\n $this->responseHeaders = [];\n $this->skippedHttpStatusLine = false;\n curl_setopt($ch, CURLOPT_HEADERFUNCTION, [$this, 'parseResponseHeaders']);\n\n //Execute Curl Request\n $result = curl_exec($ch);\n //Retrieve Response Status\n $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n //Retry if Certificate Exception\n if (curl_errno($ch) == 60) {\n $this->logger->info(\"Invalid or no certificate authority found - Retrying using bundled CA certs file\");\n curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');\n $result = curl_exec($ch);\n //Retrieve Response Status\n $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n }\n\n //Throw Exception if Retries and Certificates doenst work\n if (curl_errno($ch)) {\n $ex = new PayPalConnectionException(\n $this->httpConfig->getUrl(),\n curl_error($ch),\n curl_errno($ch)\n );\n curl_close($ch);\n throw $ex;\n }\n\n // Get Request and Response Headers\n $requestHeaders = curl_getinfo($ch, CURLINFO_HEADER_OUT);\n $this->logger->debug(\"Request Headers \\t: \" . str_replace(\"\\r\\n\", \", \", $requestHeaders));\n $this->logger->debug(($data && $data != '' ? \"Request Data\\t\\t: \" . $data : \"No Request Payload\") . \"\\n\" . str_repeat('-', 128) . \"\\n\");\n $this->logger->info(\"Response Status \\t: \" . $httpStatus);\n $this->logger->debug(\"Response Headers\\t: \" . $this->implodeArray($this->responseHeaders));\n\n //Close the curl request\n curl_close($ch);\n\n //More Exceptions based on HttpStatus Code\n if ($httpStatus < 200 || $httpStatus >= 300) {\n $ex = new PayPalConnectionException(\n $this->httpConfig->getUrl(),\n \"Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}.\",\n $httpStatus\n );\n $ex->setData($result);\n $this->logger->error(\"Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. \" . $result);\n $this->logger->debug(\"\\n\\n\" . str_repeat('=', 128) . \"\\n\");\n throw $ex;\n }\n\n $this->logger->debug(($result && $result != '' ? \"Response Data \\t: \" . $result : \"No Response Body\") . \"\\n\\n\" . str_repeat('=', 128) . \"\\n\");\n\n //Return result object\n return $result;\n }", "public function get() {\n try {\n\n /**\n * Set up request method\n */\n $this->method = 'GET';\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function request()\n {\n }", "public function request()\n {\n }", "public function execute(){\n return $this->payment(); \n }", "function acapi_call($method, $resource, $args, $params = array(), $body = array(), $options = array()) {\n $default_options = array(\n 'display' => TRUE,\n );\n $options = array_merge($default_options, $options);\n\n $debug = drush_get_option('debug', FALSE);\n $verbose = drush_get_option('verbose', FALSE);\n $simulate = drush_get_option('simulate', FALSE);\n $format = acapi_get_option('format');\n\n // Build the API call URL.\n $url = acapi_get_option('endpoint');\n $url .= acapi_dt($resource, $args);\n $url .= '.json';\n\n foreach ($params as $k => $v) {\n if (is_array($v)) {\n unset($params[$k]);\n foreach ($v as $key => $val) {\n $params[\"$k-$key\"] = \"$k%5B%5D=\" . urlencode($val);\n }\n }\n else {\n $params[$k] = \"$k=\" . urlencode($v);\n }\n }\n\n $url .= '?' . implode('&', $params);\n\n $creds = acapi_get_creds();\n if (!$creds) {\n return FALSE;\n }\n\n // Build the body.\n $json_body = json_encode($body);\n\n $display = \"curl -X $method '$url'\";\n if ($debug) {\n $display .= \" ($creds)\";\n }\n if ($debug || $verbose || $simulate) {\n drush_print($display, 0, STDERR);\n if (!empty($body)) {\n drush_print(\" $json_body\", 0, STDERR);\n }\n }\n\n if ($simulate) {\n return;\n }\n\n $headers = array();\n $ch = curl_init($url);\n // Basic request settings\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n curl_setopt($ch, CURLOPT_USERAGENT, basename(__FILE__));\n if (!empty($options['result_stream'])) {\n curl_setopt($ch, CURLOPT_FILE, $options['result_stream']);\n }\n else {\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n }\n // User authentication\n curl_setopt($ch, CURLOPT_HTTPAUTH, TRUE);\n curl_setopt($ch, CURLOPT_USERPWD, $creds);\n // SSL\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, preg_match('@^https:@', acapi_get_option('endpoint')));\n curl_setopt($ch, CURLOPT_CAINFO, acapi_get_option('cainfo'));\n // Redirects\n if (!empty($options['redirect'])) {\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_MAXREDIRS, $options['redirect']+1);\n }\n /* Body\n We need to set a Content-Length header even on empty POST requests, or the webserver\n will throw a 411 Length Required.\n */\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_body);\n $headers[] = 'Content-Type: application/json;charset=utf-8';\n $headers[] = 'Content-Length: ' . strlen($json_body);\n // Headers\n if (!empty($headers)) {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n // Debugging\n curl_setopt($ch, CURLOPT_VERBOSE, $debug);\n // Go\n $content = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n return drush_set_error('ACAPI_CURL_ERROR', dt('Error accessing @url: @err', array('@url' => $url, '@err' => curl_error($ch))));\n }\n\n $result = json_decode($content);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if (!empty($format)) {\n drush_print(drush_format($result, NULL, $format));\n }\n else if ($options['display']) {\n if (is_array($result)) {\n foreach ($result as $item) {\n if (! is_scalar($item)) {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($item)));\n }\n else {\n drush_print($item);\n }\n }\n }\n else {\n if ($method == 'POST') {\n // All POST actions return a task. Display something helpful.\n drush_log(dt('Task @taskid started.', array('@taskid' => $result->id)), 'ok');\n }\n else {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($result)));\n }\n }\n }\n\n if ($status != 200) {\n return drush_set_error('ACAPI_HTTP_STATUS_' . $status, dt('API status code @status', array('@status' => $status)));\n }\n\n return array($status, $result);\n}", "public function request()\n {\n return new GuzzleHttp\\Psr7\\Request('GET', 'Persons/'.$this->id);\n }", "public function HTTPRequest(){\n\t}", "public function request($http_method = 'GET', $url, $endpoint = \"\", $header = array(), $query = array(), $sendJSON = false)\n {\n if (strtoupper($http_method) == \"POST\") {\n //header('Content-Type: application/json');\n return $this->post($url, $endpoint, $header, $query, $sendJSON);\n } else if (strtoupper($http_method) == \"PUT\") {\n //header('Content-Type: application/json');\n return $this->put($url, $endpoint, $header, $query, $sendJSON);\n } else if (strtoupper($http_method) == \"GET\") {\n //header('Content-Type: application/json');\n return $this->get($url, $endpoint, $header, $query);\n } else if (strtoupper($http_method) == \"DELETE\") {\n //header('Content-Type: application/json');\n return $this->delete($url, $endpoint, $header, $query);\n } else {\n throw new \\Exception(\"Only GET and POST methods are supported.\");\n }\n }", "public function process()\n {\n \t$client = $this->client->getClient();\n\n \ttry {\n $response = $client->get($this->buildUrl());\n return new ResponseJson((string)$response->getBody(), true);\n } catch (RequestException $e) {\n return new ResponseJson((string)$e->getResponse()->getBody(), false);\n }\n }", "public function __call($name, $request)\n\t{\n\t\tif(is_object($this->soap))\n\t\t{\n\t\t\tswitch($name)\n\t\t\t{\n\t\t\t\tcase \"ProcessTransaction\":\n\t\t\t\tcase \"AddABAccount\":\n\t\t\t\tcase \"UpdateABAccount\":\n\t\t\t\tcase \"UpdateABSchedule\":\n\t\t\t\t\t$r[\"TRANSACTION\"] = $request[0];\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"ProcessVaultTransaction\":\n\t\t\t\tcase \"UpdateTransaction\":\n\t\t\t\tcase \"ProcessAccount\":\n\t\t\t\tcase \"ProcessCustomer\":\n\t\t\t\tcase \"ProcessCustomerAndAccount\":\n\t\t\t\t\t$r[\"TRANSACTION_VAULT\"] = $request[0];\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n $r = $request[0];\n\t\t\t\t\t//throw new Exception('Method Choice Error - '.$name.' is not a valid Gateway method name.');\n\t\t\t\t\t//return FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Remove bool items\n\t\t\t$r = $this->soap_request($r);\n\t\t\t// No further formatting is offered for soap responses, as the soap response object is uber-powerful.\n\t\t\t$response = $this->soap->$name($r);\n\t\t\t\n\t\t\t//if($response->ProcessTransactionResult->TRANSACTIONRESPONSE->RESPONSE_CODE == 3)\n\t\t\t//{\n\t\t\t//\tthrow new Exception('Request Error - '.$response->ProcessTransactionResult->TRANSACTIONRESPONSE->RESPONSE_REASON_TEXT);\n\t\t\t//}\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch($name)\n\t\t\t{\n\t\t\t\tcase \"ProcessTransaction\":\n\t\t\t\tcase \"AddABAccount\":\n\t\t\t\tcase \"UpdateABAccount\":\n\t\t\t\tcase \"UpdateABSchedule\":\n\t\t\t\t\t$xml = '<TRANSACTION xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://gateway.securenet.com/API/Contracts\">';\n\t\t\t\t\t$xml .= $this->xmlize($request[0]);\n\t\t\t\t\t$xml .= '</TRANSACTION>';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"ProcessVaultTransaction\":\n\t\t\t\tcase \"UpdateTransaction\":\n\t\t\t\tcase \"ProcessAccount\":\n\t\t\t\tcase \"ProcessCustomer\":\n\t\t\t\tcase \"ProcessCustomerAndAccount\":\n\t\t\t\t\t$xml = '<TRANSACTION_VAULT xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://gateway.securenet.com/API/Contracts\">';\n\t\t\t\t\t$xml .= $this->xmlize($request[0]);\n\t\t\t\t\t$xml .= '</TRANSACTION_VAULT>';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception('Method Choice Error - '.$name.' is not a valid Gateway method name.');\n\t\t\t\t\treturn FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $this->send($xml,$name);\n\t\t}\n\t}", "public function request();", "public function post() {\n\t\tcall_user_func_array(array($this, 'get'), func_get_args());\n\t}", "public function pay_bill_get(){\r\n if (!$this->pronet_model->pay_bill(1, '882332411098', '4999999999999999', '4521','12','2022')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function execute()\n {\n $response = [\n 'status' => 'failure',\n 'message' => ''\n ];\n\n $params = $this->getRequest()->getParams();\n\n $result = $this->_resultJsonFactory->create();\n\n if (!key_exists('vat_id', $params)) {\n $response['message'] = \"vat id invalid\";\n return $result->setData($response);\n }\n\n if (!$this->_isValidVatId($params['vat_id'])) {\n $response['message'] = \"vat id invalid\";\n return $result->setData($response);\n }\n\n $this->_checkoutSession->setRatepayVatId($params['vat_id']);\n\n $response['status'] = \"success\";\n $response['message'] = \"vat id saved\";\n return $result->setData($response);\n }", "protected function shopGetRequest($data)\n {\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling shopGet'\n );\n }\n\n $resourcePath = '/shop/get';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n if (in_array('multipart/form-data', ['application/json', 'application/xml'])) {\n $multipart = true;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('access_token');\n if ($apiKey !== null) {\n $queryParams['access_token'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('nonce');\n if ($apiKey !== null) {\n $queryParams['nonce'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('timestamp');\n if ($apiKey !== null) {\n $queryParams['timestamp'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n\t\t//print_r($postfields);exit;\r\n\t\t$this->http_info = array();\r\n\t\t$ci = curl_init();\r\n\t\t/* Curl settings */\r\n\t\t\r\n\t\tcurl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 3);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, 3);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);\t\t\r\n\t\tcurl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n\t\tcurl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n\t\tcurl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n\t\tcurl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t\tswitch ($method) {\r\n\t\t\tcase 'POST':\r\n\t\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\r\n\t\t\t\tif (!empty($postfields)) {\r\n\t\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t\t\t\t$this->postdata = $postfields;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'DELETE':\r\n\t\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n\t\t\t\tif (!empty($postfields)) {\r\n\t\t\t\t\t$url = \"{$url}?{$postfields}\";\r\n\t\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t$headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n\t\tcurl_setopt($ci, CURLOPT_URL, $url );\r\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n\t\tcurl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n\t\t$response = curl_exec($ci);\r\n\t\t\r\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n\t\t$this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n\t\t$this->url = $url;\r\n\r\n\t\tif ($this->debug) {\r\n\t\t\techo \"=====post data======\\r\\n\";\r\n\t\t\tvar_dump($postfields);\r\n\r\n\t\t\techo '=====info====='.\"\\r\\n\";\r\n\t\t\tprint_r( curl_getinfo($ci) );\r\n\r\n\t\t\techo '=====$response====='.\"\\r\\n\";\r\n\t\t\tprint_r( $response );\r\n\t\t}\r\n\t\tcurl_close ($ci);\r\n\t\treturn $response;\r\n\t}", "function callMethod() {\n $params = array();\n return $this->callServer(\"callMethod\", $params);\n }", "public function execute()\n {\n $nbpapi = \"http://api.nbp.pl/api/exchangerates/rates/a/rub/?format=json\";\n\n // get posdata from request\n $postdata = $this->getRequest()->getPostValue();\n\n // make sure that interessing data is float\n if (!isset($postdata[\"amount\"]) || empty($postdata[\"amount\"])) {\n $postdata[\"amount\"] = 0;\n }\n $postamount=floatval($postdata[\"amount\"]);\n\n // request to nbp api \n $this->_curl->get($nbpapi);\n \n // response will contain the output in form of JSON string\n // then change to assoc array\n $exchangerate = $this->_jsonHelper->jsonDecode($this->_curl->getBody());\n \n // how many pln we have\n $amount = $postamount * $exchangerate[\"rates\"][0][\"mid\"];\n \n // create JSON, which will be used to show resposne\n $result = $this->_resultJsonFactory->create();\n\n // set data to json\n $result->setData([\"success\"=>true,\"exchange_rate\"=>$exchangerate[\"rates\"][0][\"mid\"],\"amount\"=>$amount]);\n \n // return result to show json\n return $result;\n }", "public function __invoke()\n {\n return response()->json([\n 'version' => $this->electrum->getVersion(),\n 'balance' => $this->electrum->getBalance(),\n 'is_sync' => $this->electrum->isSynchronized(),\n 'ticker' => json_decode(file_get_contents('https://blockchain.info/ticker')),\n ]);\n }", "public function __invoke(Request $request)\n {\n $billable = $this->billable();\n\n $quantity = Spark::chargesPerSeat(request('billableType')) ? Spark::seatCount(request('billableType'), $billable) : 1;\n\n $subtotal = $request->total * $quantity;\n\n $anonymousBillable = $billable->newInstance()->forceFill([\n 'billing_country' => $request->country,\n 'billing_postal_code' => $request->postal_code,\n 'vat_id' => $request->vat_number,\n ]);\n\n $taxRates = $anonymousBillable->taxRates();\n\n if (! $taxRates) {\n return response()->json([\n 'tax' => 0,\n 'total' => $this->formatAmount($subtotal, $request->currency),\n ]);\n }\n\n $exclusiveTaxAmount = 0;\n $totalTaxAmount = 0;\n\n foreach ($taxRates as $taxRatesId) {\n $stripeTaxRate = $billable->stripe()->taxRates->retrieve($taxRatesId);\n\n if (! $stripeTaxRate->inclusive) {\n $exclusiveTaxAmount += ceil($subtotal * ($stripeTaxRate->percentage / 100));\n }\n\n $totalTaxAmount += ceil($subtotal * ($stripeTaxRate->percentage / 100));\n }\n\n return response()->json([\n 'tax' => $totalTaxAmount ? $this->formatAmount($totalTaxAmount, $request->currency) : null,\n 'total' => $this->formatAmount($subtotal + $exclusiveTaxAmount, $request->currency),\n ]);\n }", "protected function call($method, $uri, $data = null, $params = array()) {\n if(0 !== strpos(strtolower($uri), 'http') && $this->base_url) {\n $uri = rtrim($this->base_url.\"/\".ltrim($uri, \"/\"), \"/\");\n }\n \n //encode data if any\n if($data !== null) {\n if(!$data = @json_encode($data)) {\n $data = http_build_query($data);\n }\n }\n\n //build query string parameters if specified\n $queryParams = array_merge($this->queryParams, $params);\n $q = (!empty($queryParams)) ? http_build_query($queryParams) : null;\n \n $uri .= $q;\n\n //build curl object\n $ch = curl_init($uri);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n //set http request method\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n \n //send encoded data if exists\n if(null !== $data) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n }\n \n //execute, store query data, and return response\n $startTime = microtime(true);\n $content = curl_exec($ch);\n $this->last_uri = $uri;\n $this->query_time = (microtime(true)-$startTime) * 1000;\n $this->last_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $this->last_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n $this->last_result = $content;\n \n //return result, json_decoding if possible\n return ($data = @json_decode($content)) ? $data : $content;\n }" ]
[ "0.5780877", "0.5774779", "0.56342703", "0.56289405", "0.5618166", "0.5605177", "0.5529252", "0.5525648", "0.5495777", "0.5403811", "0.5384855", "0.537615", "0.5351213", "0.53257835", "0.5315351", "0.5288467", "0.52875537", "0.52776575", "0.5268778", "0.5267158", "0.52540416", "0.52446276", "0.52385885", "0.5237066", "0.52014697", "0.5190704", "0.51898956", "0.5184013", "0.51787126", "0.5178547", "0.5157155", "0.5134269", "0.5133082", "0.51244885", "0.51220083", "0.511894", "0.51045406", "0.5103914", "0.5101483", "0.50932384", "0.5090546", "0.50780785", "0.5077242", "0.50665903", "0.50658333", "0.50631416", "0.50610745", "0.5057365", "0.5052632", "0.5047862", "0.5047018", "0.5045814", "0.5044124", "0.5037866", "0.50359684", "0.50326204", "0.50264436", "0.5011752", "0.5000027", "0.49983686", "0.49932766", "0.49879295", "0.49846974", "0.49846682", "0.4980634", "0.4980096", "0.49733248", "0.49639156", "0.4954697", "0.49544144", "0.4944284", "0.49356967", "0.49354404", "0.49295124", "0.49284762", "0.4927859", "0.49244812", "0.4923516", "0.49206948", "0.49197897", "0.49137726", "0.49137726", "0.49071634", "0.49016124", "0.48998678", "0.4897771", "0.48971045", "0.48946947", "0.4890923", "0.4884982", "0.48839694", "0.48814186", "0.48807928", "0.48783386", "0.4876797", "0.48763597", "0.48762712", "0.48709267", "0.4865622", "0.4863611", "0.4861187" ]
0.0
-1
Perform an http call to a full url. This method is used by the resource specific classes.
public function performHttpCallToFullUrl($httpMethod, $url, $httpBody = null) { if (empty($this->apiKey)) { throw new ApiException('You have not set an API key. Please use setApiKey() to set the API key.'); } $headers = [ 'Accept' => 'application/json', // 'Authorization' => "Bearer {$this->apiKey}", ]; $request = new Request($httpMethod, $url, $headers, $httpBody); try { $response = $this->httpClient->send($request, ['http_errors' => false]); } catch (GuzzleException $e) { throw ApiException::createFromGuzzleException($e); } if (!$response) { throw new ApiException('Did not receive API response.'); } return $this->parseResponseBody($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function request($url);", "public function Get( $sUrl );", "public function get($url);", "function http($url, $method = 'GET', $postfields = NULL, $headers = array()) {\n\t\t$ci = curl_init();\n\t\t/* Curl settings */\n\t\tcurl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n\t\tcurl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, array_merge(array('Expect:'),$headers));\n\t\tcurl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n\n\t\tswitch ($method) {\n\t\tcase 'POST':\n\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\t\tif (!empty($postfields)) {\n\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tif (!empty($postfields)) {\n\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t}\n\t\t}\n\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ($ci);\n\t\treturn $response;\n\t}", "function request($url = '', $format='xml', $params=null, $method = \"GET\", $data = null, $headers = null) {\n\t\t$query_string_params = array();\n\t\t\t\t\n\t\t// add additional parameters if necessary\n\t\tif (!is_null($params) && is_array($params)) {\n\t\t\t$query_string_params = $params;\n\t\t}\n\t\t\n\n\t\t// set proper format request\n\t\tif ($this->format_as_extension) { $this->baseURL .= '.' . $format; }\n\t\telse { $query_string_params['format'] = $format; }\n\n\t\t// add the url as parameter, oembed-style\n\t\t$query_string_params['url'] = $url;\t\t\n\t\t\n\t\t$this->setQueryString($query_string_params);\t\t\n\n\t\treturn parent::request('', $method, $data, $headers);\n\t}", "private function callStatus() {\n try {\n $this->status = $this->client->request('GET', $this->url->full_url, [\n 'allow_redirects' => false\n ]);\n } catch (\\Exception $ex) {\n $this->status = $ex->getResponse();\n }\n }", "function call_url($url)\n\t{\n\t\t$ch = curl_init ($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n\t\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $out;\n\t}", "public function doAPI($url)\n {\n return $url;\n }", "public function get($url, $params);", "public function fetch($url);", "private function fetchResource() {\n\t\t$ch = curl_init();\n\t\tif ((php_sapi_name() != 'cli')) {\n\t\t\tcurl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (compatible; ' . TITLE . '/' . HOST . ')');\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 30s\n\t\t$this->content = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$this->httpCode = $info['http_code'];\n\t\t$this->contentType = $info['content_type'];\n\t\t\n\t\tif (((int) $this->httpCode) >= 400) {\n\t\t\tthrow new Exception('STATUS CODE: ' . $this->httpCode);\n\t\t}\n\t}", "public static function Get($url)\r\n {\r\n return self::doRequest('GET', $url);\r\n }", "public abstract function getURL();", "public abstract function getApiUrl($url);", "public function sendRequest($sUrl);", "public function requestFullUrl()\n {\n $url = $this->request->fullUrl();\n\n return $this->make($url);\n }", "public function get($url, $query = array(), $headers = array());", "function http($url, $post_data = null) {\n\t\t$ch = curl_init ();\n\t\tif (defined ( \"CURL_CA_BUNDLE_PATH\" ))\n\t\t\tcurl_setopt ( $ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH );\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\t//////////////////////////////////////////////////\n\t\t///// Set to 1 to verify Hots SSL Cert ///////\n\t\t//////////////////////////////////////////////////\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );\n\t\tif (isset ( $post_data )) {\n\t\t\tcurl_setopt ( $ch, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );\n\t\t}\n\t\t$response = curl_exec ( $ch );\n\t\t$this->http_status = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ( $ch );\n\t\tif(empty($response)) {\n\t\t\treturn 'WP-API might be down or unresponsive. Please go to http://flocks.biz and check if the main website is working. Send us an email to [email protected] in case you have more doubts.';\n\t\t}\n\t\tif(preg_match(\"/request\\-token/i\",$response) || preg_match(\"/access\\-token/i\",$response)) {\n\t\t\t//echo \"<br/><br/>\".preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response)).\"<br/><br/>\";\n\t\t\treturn preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response));\n\t\t} else {\n\t\t\t//echo \"<br/><br/>\".$response.\"<br/><br/>\";\n\t\t\treturn $response;\n\t\t}\n\t}", "public function call($method, $url, $data = array())\n\t{\n\t\treturn $this->http->$method($url, $data);\n\t}", "public function request(string $url): self\n {\n $url = 'http://' . $this->host . ':' . $this->port . '/' . $url;\n\n $data = $this->getData();\n\n $options = array(\n 'http' => array(\n 'method' => $this->method,\n 'user_agent' => $this->userAgent,\n 'follow_location' => 1,\n 'protocol_version' => 1.1,\n 'timeout' => $this->timeout,\n 'header' => '',\n )\n );\n\n $this->addHeader(\"X-HTTP-Method-Override: \" . strtoupper($this->method));\n $this->addHeader(\"Content-Type: application/json\");\n $this->addHeader(\"Accept: application/json\");\n switch (strtoupper($this->method)) {\n case 'GET':\n break;\n case 'POST';\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"COPY\":\n break;\n case \"DELETE\":\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"PUT\":\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"HEAD\":\n break;\n }\n if (!empty($this->username) && !empty($this->password)) {\n $this->addHeader(\"Authorization: Basic \" . base64_encode($this->username . \":\" . $this->password));\n }\n foreach ($this->getHeaders() as $header) {\n $options['http']['header'] .= $header . \"\\r\\n\";\n }\n\n $context = stream_context_create($options);\n $response = @file_get_contents($url, false, $context);\n\n foreach ($http_response_header as $line) {\n $this->getHeader(NULL, $line);\n }\n\n if ($response == false) {\n $this->error = array('code' => http_response_code(), 'text' => '');\n } else {\n $this->response = $response;\n }\n\n $this->url = $url;\n\n return $this;\n }", "function http_get($url, ?array $options = null, ?array &$info = null) {}", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n if (version_compare(phpversion(), '5.4.0', '<')) {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\r\n } else {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);\r\n }\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, TRUE);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if ( isset($this->access_token) && $this->access_token )\r\n $headers[] = \"Authorization: OAuth2 \".$this->access_token;\r\n\r\n if ( !empty($this->remote_ip) ) {\r\n if ( defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\r\n } else {\r\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\r\n }\r\n } else {\r\n if ( !defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n curl_setopt($ci, CURLOPT_URL, $url );\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo \"=====headers======\\r\\n\";\r\n print_r($headers);\r\n\r\n echo '=====request info====='.\"\\r\\n\";\r\n print_r( curl_getinfo($ci) );\r\n\r\n echo '=====response====='.\"\\r\\n\";\r\n print_r( $response );\r\n }\r\n curl_close ($ci);\r\n return $response;\r\n }", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "public function doCall($url) {\n $ch = curl_init();\n $timeout = 5;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_USERPWD, \"{$this->http_auth_username}:{$this->http_auth_pass}\");\n\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0');\n $data = curl_exec($ch);\n $errno = curl_errno($ch);\n $error = curl_error($ch);\n\n curl_close($ch);\n return $data;\n }", "public function request(&$model) {\n\n if (!isset($model->request['uri']['host'])) {\n $model->request['uri']['host'] = 'www.google.com';\n }\n\n if (!isset($model->request['uri']['scheme'])) {\n $model->request['uri']['scheme'] = 'https';\n }\n\n $model->request['uri']['path'] = 'analytics/feeds/' . $model->request['uri']['path'];\n\n $response = parent::request($model);\n\n return $response;\n\n }", "public function getURL();", "public function getURL();", "public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}", "public function _get($url = null, $parameters = []);", "protected function Request($url)\n {\n $guzzle = new Client;\n\n return $guzzle->get($url, ['http_errors' => false]);\n }", "public function get($uri);", "public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }", "public function requestUri() {}", "abstract public function getUrl();", "abstract public function get_url_read();", "function http($url, $method, $postfields = NULL, $headers = array()) {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n $this->postdata = $postfields;\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n if (isset($this->access_token) && $this->access_token)\n $headers[] = \"Authorization: OAuth2 \" . $this->access_token;\n if (!empty($this->remote_ip)) {\n if (defined('SAE_ACCESSKEY')) {\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\n } else {\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\n }\n } else {\n if (!defined('SAE_ACCESSKEY')) {\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\n }\n }\n curl_setopt($ci, CURLOPT_URL, $url);\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n $this->url = $url;\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n echo \"=====headers======\\r\\n\";\n print_r($headers);\n echo '=====request info=====' . \"\\r\\n\";\n print_r(curl_getinfo($ci));\n echo '=====response=====' . \"\\r\\n\";\n print_r($response);\n }\n curl_close($ci);\n return $response;\n }", "public function execute_http()\n {\n }", "public function getURL ();", "public function makeRequest( $url, $method = 'GET', $headers = null );", "function get($url, $args = array()) {\n\t\t$defaults = array('method' => 'GET');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "public function api_connect($url);", "public function call($url, $params) {\n $req = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, \"GET\", $url, $params);\n $req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, $this->access_token);\n error_log(\"executing OAuth call: \".$req->to_url());\n $result = @file_get_contents($req->to_url());\n\n list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3);\n if($status_code >= 400)\n throw new Exception(\"Error \".$status_code.\" returned when attempting call $url\");\n return $result;\n }", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "function _request_url($method, $params = null, $format = 'xml') {\n\t\treturn 'http://ws.audioscrobbler.com/1.0/'.$this->_type.'/'.$this->_encode($this->name).'/'.$method.'.'.$format;\n\n\t}", "function httpGET($url = '/', $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n ($headers = trim($headers)) === '' or $headers .= \"\\r\\n\";\n\n // Note: in HTTP/1.1 Connection defaults to Keep Alive which will keep\n // the connection hanging unless you send 'Connection: close'. Its output\n // also changes due to chunked transfer encoding.\n $headers = \"GET $url HTTP/1.0\\r\\n\".\n $headers.\"\\r\\n\";\n\n $this->write($headers);\n return $this->readAll();\n }", "function callUrl($url) {\n\t\tif (preg_match('/http:\\/\\/([^\\/]+)(.*)/i', $url, $regs)) {\n\t\t\t$host = $regs[1];\n\t\t\t$path = $regs[2];\n\t\t\t\n\t\t\t$fp=fsockopen($host,80);\n\t\t\t$header = \"GET \".$path.\" HTTP/1.1\\r\\n\";\n\t\t\t$header .= \"Host: \".$host.\"\\r\\n\";\n\t\t\t$header .= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\tfputs($fp,$header);\n\t\t\treturn $fp;\n\t\t}\n\t\treturn false;\n\t}", "function get (string $url, array $args = []): string {\n\t$append = '';\n\tif (count($args) > 0) {\n\t\t$append .= '/'.parseUrlGet($args);\n\t}\n\n\t$curlCall = curl_init($url.$append);\n\n\tcurl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n\n\t$return = curl_exec($curlCall);\n\tcurl_close($curlCall);\n\n\treturn $return;\n}", "function get_http_api_url()\n\t{\n\t\treturn str_replace('https:', 'http:', $this->api_url);\n\t}", "abstract function do_api_request();", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "function callApi($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt ($ch, CURLOPT_URL, $url);\n\n // Get the response and close the channel.\n $response = curl_exec ( $ch );\n\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n }\n\n curl_close($ch);\n\n return $response;\n}", "function doGET (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"GET method not supported\");\n }", "public function get_url();", "abstract public function getHttpClient();", "public function curlAction()\n {\n $curl = $this->getCurlService();\n $result = $curl->get('http://www.baidu.com');\n echo $result;\n exit;\n }", "public function call()\n\t{\n\t\tcall_user_func_array(array($this->client, 'request'), func_get_args());\n\n\t\treturn $this->client->getResponse();\n\t}", "public function get ($url, $headers = null, $options = null);", "public function getUrl()\n {\n return $this->api\n . '?method='\n . $this->getMethod()\n . '&api_key='\n . $this->getApiKey()\n . '&tags='\n . $this->getTag()\n . '&per_page='\n . $this->getPerPage()\n . '&page='\n . $this->getPage()\n . '&format='\n . $this->getFormat()\n . '&photo_id='\n . $this->getPhotoId()\n . '&nojsoncallback=1';\n }", "function get_url($withProtocol=true)\n{\n return Request::GetUrl($withProtocol);\n}", "function load_url($action = '', $method = 'get', $params = array(), $expected_http_code = 200)\n\t{\n\t\t$this->http_send($this->api_url . $action, $method, $params);\n\n\t\t// handle status codes\n\t\tif(intval($expected_http_code) === $this->http_response_code):\n\t\t\tif($this->http_content_type):\n\t\t\t\treturn $this->xml_to_array($this->http_response_body);\n\t\t\telse:\n\t\t\t\treturn $this->http_response_body; /* downloads the file */\n\t\t\tendif;\n\t\telse:\n\t\t\t$this->last_error = \"Invalid status code {$this->http_response_code}\";\n\n\t\t\t// if their was an error sometimes the body contains useful info\n\t\t\treturn false;\n\t\tendif;\n\t}", "public function request($url, $params=array()){\n\t\t\n\t\t$this->_initRequest($url, $params);\n\t\t\n\t\t@curl_setopt($this->_curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\t$response = curl_exec($this->_curl);\n\t\t\n\t\t$error = curl_error($this->_curl);\n\t\tif(!empty($error))\n\t\t\tthrow new \\Exception(\"curl error: \".$error);\n\t\t\n\t\treturn $response;\t\t\n\t}", "function request($host, $path, $url_params = array()) {\r\n // Send Yelp API Call\r\n try {\r\n $curl = curl_init();\r\n if (FALSE === $curl)\r\n throw new Exception('Failed to initialize');\r\n\r\n $url = $host . $path . \"?\" . http_build_query($url_params);\r\n curl_setopt_array($curl, array(\r\n CURLOPT_URL => $url,\r\n CURLOPT_RETURNTRANSFER => true, // Capture response.\r\n CURLOPT_ENCODING => \"\", // Accept gzip/deflate/whatever.\r\n CURLOPT_MAXREDIRS => 10,\r\n CURLOPT_TIMEOUT => 30,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => \"GET\",\r\n CURLOPT_HTTPHEADER => array(\r\n \"authorization: Bearer \" . $GLOBALS['API_KEY'],\r\n \"cache-control: no-cache\",\r\n ),\r\n ));\r\n\r\n $response = curl_exec($curl);\r\n\r\n if (FALSE === $response)\r\n throw new Exception(curl_error($curl), curl_errno($curl));\r\n $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\r\n if (200 != $http_status)\r\n throw new Exception($response, $http_status);\r\n\r\n curl_close($curl);\r\n } catch(Exception $e) {\r\n trigger_error(sprintf(\r\n 'Curl failed with error #%d: %s',\r\n $e->getCode(), $e->getMessage()),\r\n E_USER_ERROR);\r\n }\r\n\r\n return $response;\r\n }", "private function GET($url,$params=false){\n return $this->Request($url,$params,HTTP_GET);\n }", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "private function http($url, $method = \"GET\", $postfields=NULL){\n $this->http_info = array();\n $handle = curl_init();\n /* Curl settings */\n curl_setopt($handle, CURLOPT_HEADER, FALSE);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);\n curl_setopt($handle, CURLOPT_HTTPHEADER, array('Expect:'));\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, $this->verifypeer);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($handle, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($handle, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($handle, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n \n if ($this->proxy_settings['behind_proxy']){\n curl_setopt($ci, CURLOPT_PROXY, $this->proxy_settings['host']);\n curl_setopt($ci, CURLOPT_PROXYPORT, $this->proxy_settings['port']);\n curl_setopt($ci, CURLOPT_PROXYUSERPWD, \"{$this->proxy_settings['user']}:{$this->proxy_settings['pass']}\");\n curl_setopt($ci, CURLOPT_PROXYTYPE, $this->proxy_settings['type']);\n curl_setopt($ci, CURLOPT_PROXYAUTH, $this->proxy_settings['auth']);\n }\n \n switch($method){\n case self::$METHOD_POST:\n curl_setopt($handle, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($handle, CURLOPT_POSTFIELDS, $postfields);\n }\n break;\n case self::$METHOD_DELETE:\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)){\n $url .= \"?\".OAuthUtil::build_http_query($postfields);\n }\n break;\n }\n curl_setopt($handle, CURLOPT_URL, $url);\n $response = curl_exec($handle);\n $this->http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($handle));\n $this->url = $url;\n curl_close($handle);\n return $response;\n }", "public function request($method, $url, array $body = [], array $headers = [], $version = '1.1');", "public function get ( $url, $params=[] )\n {\n $param_string = $this->buildParamString( $params );\n $url = $url . $param_string;\n\n $this->init( $url );\n\n $options = [\n CURLOPT_FAILONERROR => true,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_USERAGENT => 'fake'\n ];\n\n $this->setOptions( $options );\n }", "protected function callService($url, $content) {\n $postdata = [\n 'http' => [\n 'method' => 'POST',\n 'header' => 'Content-type: application/x-www-form-urlencoded',\n 'content' => http_build_query(['input' => $content])\n ]\n ];\n\n return file_get_contents($url, false, stream_context_create($postdata));\n }", "abstract protected function request($method, $uri, $options);", "function get($url, $options = array()) {\n\t\treturn $this->request($url, $options);\n\t}", "public function get($url) {\n $request = $this->getRequest($url, HttpRequest::METH_GET);\n try {\n // this could be parametrized using optional options interface\n $options = array(\n 'useragent' => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; MS-RTC LM 8)\",\n 'connecttimeout' => 120, // timeout in seconds on connect \n 'timeout' => 120, // timeout in seconds on response \n 'redirect' => 5, // stop after 5 redirects\n 'compress' => true, // allow compression or not\n 'referer' => \"https://www.google.com/#output=search&sclient=psy-ab&q=jachty&fp=1\",\n );\n $request->setOptions($options);\n $request->send();\n } catch (Exception $e) {\n throw new Exception('Loading failed with exception', $request->getResponseCode(), $e);\n }\n $code = $request->getResponseCode();\n $body = $request->getResponseBody();\n\n // make sure we did not fail\n if ($code >= 500) {\n throw new Exception('Error response code recieved: ' . $body, $code);\n } elseif ($code >= 400) {\n throw new Exception('Permanent failure' . $body, $code);\n } elseif (trim($body) == '') {\n throw new Exception('Empty response', $code);\n }\n\n return $body;\n }", "public function testCurlGoodUrl()\n {\n $curl = new CurlClass();\n \n $res = $curl->submit('http://feeds.nationalgeographic.com/ng/News/News_Main');\n $this->assertTrue($res, 'test url ktory zwraca kod 200');\n }", "public function request($url, $params = false, $method = false, $options = false, $timeout = false, $raw = false)\n\t\t{\n\t\t\tif ($method === false) {\n\t\t\t\t$method = self::GET;\n\t\t\t}\n\n\t\t\tif ($timeout === false) {\n\t\t\t\t$timeout = self::DEFAULT_TIMEOUT;\n\t\t\t}\n\n\t\t\tif ($url[0] == '/') {\n\t\t\t\t$url = substr($url, 1);\n\t\t\t}\n\t\t\t$url = $this->base_url.$url;\n\n\t\t\tif ($method == self::GET && is_array($params) && count($params) > 0) {\n\t\t\t\t\t$url = $url.(strpos($url, '?') !== false ? '&' : '?').http_build_query($params);\n\t\t\t}\n\n\t\t\t$ch = curl_init($url);\n\t\t\tif (isset($GLOBALS['config']['curl']['options'])) {\n\t\t\t\tcurl_setopt_array($ch, $GLOBALS['config']['curl']['options']);\n\t\t\t}\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t\tif (is_array($options) && count($options) > 0) {\n\t\t\t\tcurl_setopt_array($ch, $options);\n\t\t\t}\n\n\t\t\tswitch ($method) {\n\t\t\t\tcase self::GET:\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::POST:\n\t\t\t\tcase self::PUT:\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n\t\t\t\t\tif ($method == self::POST) {\n\t\t\t\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::POST_JSON:\n\t\t\t\tcase self::PUT_JSON:\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method == self::PUT_JSON ? 'PUT' : 'POST');\n\t\t\t\t\t$json_data = json_encode($params);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t\t\t\t'Content-Type: application/json',\n\t\t\t\t\t\t'Content-Length: '.strlen($json_data),\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::DELETE_JSON:\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\t\t\t$json_data = json_encode($params);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t\t\t\t'Content-Type: application/json',\n\t\t\t\t\t\t'Content-Length: '.strlen($json_data),\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::DELETE:\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new HTTPClientException('Unknown method: '.$method, -1);\n\t\t\t}\n\n\t\t\t$response = curl_exec($ch);\n\t\t\t$info = curl_getinfo($ch);\n\n\t\t\tcurl_close($ch);\n\n\t\t\tif ($info['http_code'] < 200 || $info['http_code'] > 299) {\n\t\t\t\tthrow new HTTPClientException(__METHOD__.': Failed: ['.$info['http_code'].'] '.substr($response, 0, 150), $info['http_code'], $response);\n\t\t\t}\n\n\t\t\t// If we've not been told to return the raw response, and the response\n\t\t\t// was not a 204 which has no content, decode the response if we\n\t\t\t// understand the format.\n\t\t\tif (!$raw && $info['http_code'] != 204) {\n\t\t\t\tswitch ($info['content_type']) {\n\t\t\t\t\tcase 'application/json':\n\t\t\t\t\t\t// Decode the JSON response.\n\t\t\t\t\t\t$decoded = json_decode($response, true);\n\t\t\t\t\t\tif (!is_array($decoded)) {\n\t\t\t\t\t\t\tthrow new HTTPClientException('Failed to decode response: '.$response, $info['http_code'], $response);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$response = $decoded;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}", "function make_call($url)\n {\n echo \"API Call:<br /><textarea id='orig' rows='4' cols='150'>$url</textarea><br />\";\n $ch = curl_init();\n $timeout = 20;\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n\n $data = curl_exec($ch);\n\n if (curl_errno($ch)) {\n print curl_error($ch);\n } else {\n curl_close($ch);\n }\n echo htmlentities($data) . \"<br />\";\n return $data;\n }", "private function setUrl()\n {\n curl_setopt($this->curl, CURLOPT_URL, $this->server);\n }", "function FetchURL($url, $options = array())\n\t{\n\t\t$timeout = 20;\n\t\tif (isset($options['timeout'])) { $timeout = $options['timeout']; }\n\n\t\t$curl_handler = curl_init();\n\n\t\tif (!empty($options['get_fields']))\n\t\t{\n\t\t\t$url_parameters = array();\n\t\t\tforeach($options['get_fields'] as $field => $value)\n\t\t\t{ $url_parameters[] = urlencode($field) . '=' . urlencode($value); }\n\n\t\t\t$url .= '?' . join('&', $url_parameters);\n\t\t}\n\n\t\tcurl_setopt($curl_handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl_handler, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t//curl_setopt($curl_handler, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\n\t\tif (!empty($options['post_array']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_POSTFIELDS, $options['post_array']);\n\t\t}\n\n\t\tif (!empty($options['auth_string']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_USERPWD, $auth_string);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t}\n\t\t\n\t\tif (!empty($options['follow']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_FOLLOWLOCATION, true);\n\t\t}\n\n\t\tif (!empty($options['headers'])) { curl_setopt($curl_handler, CURLOPT_HTTPHEADER, $headers); }\n\n\t\t$response = curl_exec($curl_handler);\n\t\tself::$status = curl_getinfo($curl_handler, CURLINFO_HTTP_CODE);\n\t\tcurl_close($curl_handler);\n\n\t\treturn $response;\n\t}", "protected function _doGet($in_url, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'GET', null, null, $in_additional_curl_options);\r\n }", "public function request(Url $url)\n\t{\n\t\tif(!$url->issetParam('url'))\n\t\t{\n\t\t\tthrow new Exception('Required parameter url missing');\n\t\t}\n\n\t\t$format = $url->addParam('format', 'json');\n\t\t$request = new GetRequest($url, array(\n\t\t\t'User-Agent' => __CLASS__ . ' ' . Base::VERSION,\n\t\t\t'Accept' => 'application/json'\n\t\t));\n\t\t$response = $this->http->request($request);\n\n\t\tif($response->getStatusCode() >= 200 && $response->getStatusCode() < 300)\n\t\t{\n\t\t\t$source = function(array $data){\n\n\t\t\t\t$type = isset($data['type']) ? strtolower($data['type']) : null;\n\t\t\t\t\n\t\t\t\tif(in_array($type, array('link', 'photo', 'rich', 'video')))\n\t\t\t\t{\n\t\t\t\t\t$class = 'PSX\\\\Oembed\\\\Type\\\\' . ucfirst($type);\n\n\t\t\t\t\tif(class_exists($class))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new $class();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('Class \"' . $class . '\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new InvalidDataException('Invalid type');\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\treturn $this->importer->import($source, $response, null, ReaderInterface::JSON);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Invalid response code ' . $response->getStatusCode());\n\t\t}\n\t}", "function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}", "public function __call( $service, array $arguments = array( )) {\n\n\t\tarray_unshift( $arguments, $service );\n\n\t\treturn call_user_func_array( array( $this, 'url' ), $arguments );\n\t}", "private function do_get_request($ch,$url,$params=array()){ \n if(is_array($params) && count($params)>0){\n $url.='?';\n foreach($params as $key=>$val){\n $url.='&'.$key.'='.urlencode($val);\n }\n }\n $ch=curl_init();\n $timeout=5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n $result=curl_exec($ch);\n return $result;\n }", "abstract protected function getMethodUrl(): string;", "function Get( $url )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Get( $url )\\n\";\r\n\t\t$this->responseHeaders = $this->responseBody = \"\";\r\n\t\t$uri = $this->makeUri( $url );\r\n\t\t\r\n\t\tif( $this->sendCommand( \"GET $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "function http_request($method, $url = null, $body = null, ?array $options = null, ?array &$info = null) {}", "private function sendGetRequest($url)\n {\n // Send the request and process the response\n $guzzleResponse = $this->client->request('GET', $url);\n $this->lastResponse = new SmartwaiverResponse($guzzleResponse);\n }", "protected function prepareUrl()\n {\n return 'http://'.$this->_host.'/service/v'.$this->_apiVersion.'/rest.php';\n }", "public function sendGet()\n\t{\n\t\t$ch = curl_init(\"http://localhost/rest/index.php/book\");\n\t\t//a true, obtendremos una respuesta de la url, en otro caso, \n\t\t//true si es correcto, false si no lo es\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t//establecemos el verbo http que queremos utilizar para la petición\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t//obtenemos la respuesta\n\t\t$response = curl_exec($ch);\n\t\t// Se cierra el recurso CURL y se liberan los recursos del sistema\n\t\tcurl_close($ch);\n\t\tif(!$response) {\n\t\t return false;\n\t\t}else{\n\t\t\tvar_dump($response);\n\t\t}\n\t}", "protected function use_http_get() {\n return false;\n }", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "private function request($url)\n {\n try {\n $res = $this->client->request('GET', $url);\n return $res->getBody();\n } catch (ConnectException $e) {\n $this->infos['messages'][] = \"Could not connect to the Jira's API's server\";\n $this->infos['errorBoolean'] = true ;\n } catch(ClientException $e){\n $this->infos['status'] = $e->getResponse()->getStatusCode();\n $this->infos['messages'][] = $e->getResponse()->getReasonPhrase();\n $this->infos['errorBoolean'] = true ;\n }\n }", "public function fetch($protected_resource_url, $extra_parameters = [], $http_method = null, $http_headers = []) {}", "protected function doRequest($url, $headers, $method, $data) {\n return drupal_http_request($url, array('headers' => $headers, 'method' => $method, 'data' => $data));\n }", "public function doRequests();", "public function execGET($url, $params = []){\n\t\t#Parse URL params\n\t\t$url = $this->parseURL($url, $params);\n\t\t#Initialize a CURL session. \n\t\t$ch = curl_init();\n\t\t#Set body (empty on GET)\n\t\t$curlBody = json_encode([]);\n\t\t#Set curl headers\n\t\t$curlHeaders = [\n\t\t\t'User-Agent: ' . $this->getRandAgent(), #Set the user agent with a random-selected real one\n\t\t];\n\t\t#Set CURL options\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders); #Set headers\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); #Retrieve output instead of displaying it\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30); #Set timeout to 30 seconds\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); #Disable SSL host verification\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); #Disable SSL peer verification\n\t\tcurl_setopt($ch, CURLOPT_URL, $url); #Set URL\n\t\t#Return raw CURL request output\n\t\treturn curl_exec($ch);\n\t}", "function request( $url, array $params = array() ) {\n\t\t$params['headers']['GData-Version'] = self::API_VERSION;\n\n\t\treturn parent::request( $url, $params );\n\t}", "function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}", "public static function apiRequest($url){\n $handle = curl_init();\n curl_setopt($handle, CURLOPT_URL, $url);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, $url);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);\n\n $output = curl_exec($handle);\n $status = curl_getinfo($handle,CURLINFO_HTTP_CODE);\n curl_close($handle);\n\n if($status != 200){\n return json_encode(\"RESOURCE NOT FOUND\");\n }\n\n return $output;\n\n }", "public function url(): string;", "function fetch_url ($url, $post_options = []) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION\t,0);\n curl_setopt($ch, CURLOPT_HEADER\t\t\t,0); // DO NOT RETURN HTTP HEADERS\n curl_setopt($ch, CURLOPT_RETURNTRANSFER\t,1); // RETURN THE CONTENTS OF THE CALL\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_TIMEOUT, 9);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 3);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 9);\n curl_setopt($ch, CURLOPT_ENCODING, '');\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "function fetchUrl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n $retData = curl_exec($ch);\n curl_close($ch); \n \n return $retData;\n}" ]
[ "0.67685413", "0.65394646", "0.6446492", "0.623216", "0.6227948", "0.6178594", "0.60286164", "0.6003858", "0.5998558", "0.59466594", "0.58705056", "0.5802706", "0.5799671", "0.5791279", "0.57867134", "0.5760186", "0.5751905", "0.57426035", "0.5688738", "0.5674012", "0.56730926", "0.56501263", "0.563199", "0.56278133", "0.5620515", "0.5602489", "0.5602489", "0.5598974", "0.559685", "0.5591996", "0.55888635", "0.55874705", "0.55823857", "0.5581287", "0.55762124", "0.5565876", "0.55421376", "0.5534706", "0.5521858", "0.55189425", "0.5496393", "0.5495071", "0.5488262", "0.5487339", "0.5483815", "0.5482901", "0.54822236", "0.5480406", "0.5478899", "0.5474254", "0.5468903", "0.5467723", "0.54667634", "0.54629815", "0.54591054", "0.5458083", "0.5456908", "0.5456638", "0.5454186", "0.5448971", "0.5446722", "0.54405564", "0.54376787", "0.54254687", "0.54221004", "0.5415957", "0.5413991", "0.54114974", "0.54109466", "0.540904", "0.5402049", "0.5398062", "0.5392058", "0.5375286", "0.5371793", "0.5369333", "0.5363233", "0.535992", "0.5351238", "0.53504026", "0.53443843", "0.5338548", "0.5338277", "0.5336448", "0.5334245", "0.5326667", "0.53260463", "0.5323826", "0.53180146", "0.53154474", "0.5312816", "0.5301196", "0.5300368", "0.5293133", "0.5285825", "0.527791", "0.52735037", "0.52666897", "0.5264352", "0.52639127", "0.5257903" ]
0.0
-1
Parse the PSR7 Response body
private function parseResponseBody(ResponseInterface $response) { $body = (string)$response->getBody(); if (empty($body)) { if ($response->getStatusCode() === self::HTTP_NO_CONTENT) { return null; } throw new ApiException('No response body found.'); } $object = @json_decode($body); if (json_last_error() !== JSON_ERROR_NONE) { throw new ApiException("Unable to decode DeepL response: '{$body}'."); } if ($response->getStatusCode() >= 400) { throw ApiException::createFromResponse($response); } return $object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function parseResponse() {\n $headers = Strings::split(substr($this->response, 0, $this->info['header_size']), \"~[\\n\\r]+~\", PREG_SPLIT_NO_EMPTY);\n $this->headers = static::parseHeaders($headers);\n $this->body = substr($this->response, $this->info['header_size']);\n $this->response = NULL;\n }", "protected function parseResponse()\n {\n // get the status code from response.\n $statusCode = $this->httpResponse->getStatusCode();\n\n // set as error, if http status code is not between 200 and 299 (inclusive).\n $this->networkError = !($statusCode >= 200 && $statusCode <= 299);\n\n // decode the response body.\n $body = $this->decodeBody();\n\n // stop when no body is present.\n if ($body) {\n // parse the response id from the body.\n $this->id = (int) array_get($body, 'id', null);\n\n // set as error when there is a an error key and it's not null.\n $this->isError = array_get($body, 'error', null) !== null;\n\n // parse the response data, from result or error.\n $this->data = collect(array_get($body, $this->isError ? 'error' : 'result', []));\n }\n\n // just return the response body.\n return $this->body;\n }", "function http_parse_response()\n\t{\n\t\tlist($headers, $body) = explode(\"\\r\\n\\r\\n\", $this->http_response, 2);\n\t\t$this->http_parse_headers($headers);\n\n\t\tif(isset($this->http_response_headers['Transfer-Encoding']) && 'chunked' == $this->http_response_headers['Transfer-Encoding']):\n \t\t$this->http_response_body = $this->http_chunked_decode($body);\n\t\telse:\n\t\t\t$this->http_response_body = $body;\n\t\tendif;\n\n\t\t$this->http_set_content_type($this->http_default_content_type);\n\t}", "protected function decodedBody()\n\t{\n\t\ttry {\n\t\t\treturn $this->response->json();\n\t\t} catch (Exception $e) {\n\t\t\tthrow new ParserException($e->getMessage(), $e->getCode());\n\t\t}\n\t}", "protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }", "abstract protected function parseResponse($response);", "abstract function parse_api_response();", "function _parseResponse($res) {\n\n\t\t// set defaults\n\t\t$response = $this->response;\n\t\t$response['raw']['response'] = $res;\n\n\t\t// parse header\n\t\tif (preg_match(\"/^(.+\\r\\n)(.*)(?<=\\r\\n)\\r\\n/Us\", $res, $match)) {\n\t\t\t\n\t\t\tlist($null, $response['raw']['status-line'], $response['raw']['header']) = $match;\n\t\t\t$response['raw']['body'] = substr($res, strlen($match[0]));\n\n\t\t\tif (preg_match(\"/(.+) ([0-9]{3}) (.+)\\r\\n/DU\", $response['raw']['status-line'], $match)) {\n\t\t\t\t$response['status']['http-version'] = $match[1];\n\t\t\t\t$response['status']['code'] = (int) $match[2];\n\t\t\t\t$response['status']['reason-phrase'] = $match[3];\n\t\t\t}\n\n\t\t\t$response['header'] = $this->_parseHeader($response['raw']['header']);\n\t\t\t$response['body'] = $response['raw']['body'];\n\n\t\t\tif (!empty($response['header'])) {\n\t\t\t\t$response['cookies'] = $this->parseCookies($response['header']);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$response['body'] = $res;\n\t\t\t$response['raw']['body'] = $res;\n\t\t}\n\n\t\tif (isset($response['header']['Transfer-Encoding']) && $response['header']['Transfer-Encoding'] == 'chunked') {\n\t\t\t$response['body'] = $this->_decodeChunkedBody($response['body']);\n\t\t}\n\n\t\tforeach ($response['raw'] as $field => $val) {\n\t\t\tif ($val === '') {\n\t\t\t\t$response['raw'][$field] = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $response;\n\t}", "function parse() {\r\n\t\t/* JSON */\r\n\t\tif (strpos ( $this->response_content_type, \"application/json\" ) !== false) {\r\n\t\t\t$this->response_parsed = json_decode($this->response_body);\r\n\t\t\t/* JSON STREAM */\r\n\t\t} elseif (strpos ( $this->response_content_type, \"json-stream\" ) !== false) {\r\n\t\t\t$stream = split ( \"\\n\", $this->response_body );\r\n\t\t\tif (count ( $stream ) < $stream [0] ['ResultLength']) {\r\n\t\t\t\t// echo \"Invalid JSON Stream. Result Length:\".count($stream);\r\n\t\t\t\t$this->client->status_code = 400;\r\n\t\t\t\t$GLOBALS ['ResultStack']->pushNew ( \"Invalid JSON Stream\", ERROR );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$jsonServer = new JSON ( JSON_LOOSE_TYPE );\r\n\t\t\t$this->response_parsed = array ();\r\n\t\t\tforeach ( $stream as $line )\r\n\t\t\t\t$this->response_parsed [] = $jsonServer->decode ( $line );\r\n\t\t\t/* DEFAULT */\r\n\t\t} else {\r\n\t\t\t$this->response_parsed = $this->response_body;\r\n\t\t}\r\n\t}", "private function parse($body)\n {\n parse_str($body, $response_array);\n $response = array();\n foreach ($response_array as $k => $v) {\n $key = str_replace('VP', '', $k);\n $response[$key] = $v;\n }\n\n return $response;\n }", "public function getParsedBody() {}", "protected function parse()\n {\n if ($this->isParsed) {\n return;\n }\n\n if ($this->response->isServerError()) {\n throw new ResponseException(\"nic.ru server error\");\n }\n\n $contentType = $this->response->getHeader(\"Content-Type\");\n\n if (!preg_match(\"/^.*text\\/plain.*$/ui\", $contentType)) {\n throw new ResponseException(\"Incorrect Content-Type of response: {$contentType}\");\n }\n\n if (!$this->response->isOk()) {\n throw new ResponseException(\"Incorrect response code: {$this->response->getStatusCode()}\");\n }\n\n $content = $this->getRawContent();\n $contentParts = explode(\"\\r\\n\\r\\n\", $content);\n\n if (empty($contentParts)) {\n throw new ResponseException(\"Incorrect response: {$content}\");\n }\n\n if (count($contentParts) == 0) {\n throw new ResponseException(\"Response header is empty!\");\n }\n\n $this->parseHeader(trim($contentParts[0]));\n $this->parseBody(trim($contentParts[1]));\n\n $this->isParsed = true;\n }", "public function parseResponse($message);", "private function parse()\n {\n if ($this->isError()) {\n // error parsing\n if (empty($this->body) || !isset($this->body['errors'])) {\n // response body isn't an error object, return a custom one\n $error = new Entity\\Error();\n $error->message = \"Error $this->http_status\";\n $error->name = \"INVALID REQUEST\";\n $error->at = \"\";\n $this->objects[] = $error;\n } else {\n // parse error\n $errors = $this->body['errors'];\n foreach ($errors as $error) {\n $this->objects[] = Entity\\Error::parse($error);\n }\n }\n } else if (isset($this->body['card'])) {\n // card parsing\n $cards = $this->body['card'];\n foreach ($cards as $card) {\n $this->objects[] = Entity\\Card::parse($card);\n }\n } else if (isset($this->body['paymentmethod'])) {\n // payment parsing\n $this->objects[] = Entity\\Payment::parse($this->body);\n if (isset($this->body['subscription_plan'])) {\n // subscription also found, payment is a subscription\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n }\n } else if (isset($this->body['vendor'])) {\n // vendor parsing\n $this->objects[] = Entity\\Vendor::parse($this->body['vendor']);\n } else if (isset($this->body['item'])) {\n // item parsing\n $this->objects[] = Entity\\Item::parse($this->body['item']);\n } else if (isset($this->body['refunded'])) {\n // refund parsing, same as payment\n $this->objects[] = Entity\\Payment::parse($this->body);\n } else if (isset($this->body['subscription_plan'])) {\n // subscription parsing\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n } else if (isset($this->body['deleted'])) {\n // nothing to return\n } else {\n throw new \\RuntimeException('Could not recognize response type');\n }\n }", "public function getParsedResponse()\n {\n return json_decode($this->response);\n }", "protected function decodeResponse($body) {\n return json_decode(mb_convert_encoding($body, 'UTF-8', 'UTF-16LE'), TRUE);\n }", "public function getParsedBody();", "protected function parseBody($body)\n {\n if ($this->isParsed) {\n return;\n }\n\n if ($this->isSuccess()) {\n $bodyLines = explode(\"\\n\", $body);\n\n $i = -1;\n foreach ($bodyLines as $line) {\n if(empty($line)) {\n continue;\n }\n\n if($line[0] == \"[\") {\n $i++;\n continue;\n }\n\n $i = $i == -1 ? 0 : $i;\n\n $lineParts = $this->parseLine($line);\n\n if (!$lineParts) {\n continue;\n }\n\n list($key, $value) = $lineParts;\n\n if(!isset($this->body[$i])) {\n $this->body[$i] = [];\n }\n\n if (!isset($this->body[$i][$key])) {\n $this->body[$i][$key] = [];\n }\n\n $this->body[$i][$key][] = $value;\n }\n } elseif ($this->getState() === 402) {\n $bodyLines = explode(\"\\n\", $body);\n\n if ($bodyLines[0] != \"[errors]\") {\n return;\n }\n\n unset($bodyLines[0]);\n\n foreach ($bodyLines as $errorLine) {\n $errorLine = trim($errorLine);\n\n if ($errorLine) {\n $this->errors[] = $errorLine;\n }\n }\n }\n }", "private function decodeResponseBody() {\n $type = $this->headers['content-type'];\n\n // Edge cases\n if (!$type)\n return $body;\n if ($this->body === null || $this->body === '')\n return $this->body;\n\n // JSON\n if (preg_match('@^application/json@', $type) === 1) {\n $decoded = json_decode($this->body, \n true, // Decode as an associative array (instead of object)\n 512, // Max stack depth for recursion\n JSON_BIGINT_AS_STRING); // Encode big ints as strings (instead of floats)\n\n if ($decoded === null) {\n // null is ambiguous in its meaning...\n $errorCode = json_last_error();\n if ($errorCode === JSON_ERROR_NONE) {\n // Really decoded a null\n return $decoded;\n }\n else {\n // Decode failed\n\n // Build JSON error message lookup\n $jsonErrors = [];\n $constants = get_defined_constants(true);\n $prefix = 'JSON_ERROR_';\n foreach ($constants['json'] as $name => $value) {\n if (strncmp($name, $prefix, strlen($prefix)) === 0)\n $jsonErrors[$value] = $name;\n }\n\n $message = $jsonErrors[$errorCode];\n if (!$message)\n $message = \"Unknown error code: $errorCode\";\n\n throw new WebEntityCodecError(\"json_decode() failed: $message\");\n }\n }\n else {\n // Decode succeeded\n return $decoded;\n }\n }\n // XML\n elseif (preg_match('@^(application|text)/xml@', $type) === 1) {\n $document = new DOMDocument();\n $document->loadXML($this->body);\n return $document;\n }\n // as-is\n else {\n return $this->body;\n }\n }", "function parse_response($response)\n {\n $data = $response->getBody();\n\n // Note we could not use Guzzle XML method becuase Endicia does not return valid XML it seems\n $sxe = new SimpleXMLElement($data);\n\n if ($sxe->status == 0) {\n $return_data = array();\n $return_data['Status'] = (string)$sxe->Status;\n $return_data['Base64LabelImage'] = (string)$sxe->Base64LabelImage;\n $return_data['TrackingNumber'] = (string)$sxe->TrackingNumber;\n $return_data['FinalPostage'] = (string)$sxe->FinalPostage;\n $return_data['TransactionID'] = (string)$sxe->TransactionID;\n $return_data['PostmarkDate'] = (string)$sxe->PostmarkDate;\n $return_data['DeliveryTimeDays'] = (string)$sxe->PostagePrice->DeliveryTimeDays;\n\t $return_data['error'] = (string)$data;\n \n\t\treturn $return_data;\n } else {\n return array('status' => 'error', 'message' => $sxe);\n }\n }", "abstract protected function parseResponse(ResponseInterface $response);", "public function parseResponse() {\r\r\n\r\r\n return true;\r\r\n }", "public function decode()\n {\n return json_decode(trim($this->body), true);\n }", "protected function decodeBody() : ?Collection\n {\n // avoid any parsing when there's not json header.\n if (!$this->isJson()) {\n return collect([]);\n }\n\n // parse the response as string.\n $body = (string) $this->httpResponse->getBody();\n\n // return the body, decoded as array.\n $this->body = collect(json_decode($body, true));\n\n // return the body value.\n return $this->body;\n }", "public function parse()\r\n\t{\r\n\t\tif(is_string($this->_raw)) {\r\n\t\t\t$response = self::toArray($this->_format, $this->_raw);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$response = $this->_raw;\r\n\t\t}\r\n\r\n\t\tif(!empty($response['error_code'])) {\r\n\t\t\tthrow new MediaMonks_Service_Hyves_Response_Exception($response['error_message'], $response['error_code']);\r\n\t\t}\r\n\t\t\r\n\t\tif(null == $this->_method && !empty($response['method'])) {\r\n\t\t\t$this->_method = $response['method'];\r\n\t\t\tunset($response['method']);\r\n\t\t}\r\n\t\t\r\n\t\t$this->_info = $response['info'];\r\n\t\tunset($response['info']);\r\n\t\t\r\n\t\t$this->_body = $response;\r\n\t\t\r\n\t\t// pagination\r\n\t\tif(!empty($this->_info['totalresults'])) {\r\n\t\t\t$this->_paginated = true;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_parsed = true;\r\n\t\treturn $this;\r\n\t}", "private function ParseResponse($Response)\n\t{\n\t\tif (!is_array($Response))\n\t\t{\n\t\t\t// $this -> SetError(self::ERROR_INVALID_RESPONSE, 'Invalid response from Premium, cannot parse');\n\t\t\treturn false;\n\t\t}\n\n\t\t$this -> SetError(self::ERROR_NONE, '');\n\n\t\t$Body = false;\n\t\tif ($Response['Body'])\n\t\t{\n\t\t\t$Body = json_decode($Response['Body'], true);\n\t\t}\n\n\t\tif (!$Response['Body'])\n\t\t{\n\t\t\t$this -> SetError(self::ERROR_EMPTY_RESPONSE, 'Empty response from Premium');\n\t\t}\n\t\telseif (!$Body)\n\t\t{\n\t\t\t$ErrorMessage = 'Invalid response from Premium, cannot parse';\n\t\t\tif (is_null($Body))\n\t\t\t{\n\t\t\t\t// JSON parsing error\n\t\t\t\t$ErrorMessage = 'JSON parsing error'.(function_exists('json_last_error') ? ' #'.json_last_error() : '');\n\t\t\t}\n\n\t\t\t$this -> SetError(self::ERROR_INVALID_RESPONSE, $ErrorMessage);\n\t\t}\n\t\telseif (!empty($Body['ErrNo']))\n\t\t{\n\t\t\t$this -> SetError($Body['ErrNo'], $Body['Error']);\n\t\t}\n\n\t\treturn $Body;\n\t}", "public function getDecodedBody()\r\n\t{\r\n\t\treturn ResponseObjectBuilder::buildFromJSON($this->body);\r\n\t}", "public function getParsedBody()\n {\n if (! $this->parsedBody) {\n $parser = new BodyParser($this->getHeaderLine('Content-Type'));\n $this->parsedBody = $parser->parse($this->getBody());\n }\n return $this->parsedBody;\n }", "public function parseErrors(Response $response);", "function MesiboParseResponse($response) {\n\t$result = json_decode($response, true);\n\tif(is_null($result)) \n\t\treturn false;\n\treturn $result;\n}", "public function getParsedResponse()\n {\n return $this->parsedResponse;\n }", "function parse_response($message)\n{\n $data = _parse_message($message);\n // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space\n // between status-code and reason-phrase is required. But browsers accept\n // responses without space and reason as well.\n if (!preg_match('/^HTTP\\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {\n throw new \\InvalidArgumentException('Invalid response string: ' . $data['start-line']);\n }\n $parts = explode(' ', $data['start-line'], 3);\n\n return new Response(\n $parts[1],\n $data['headers'],\n $data['body'],\n explode('/', $parts[0])[1],\n isset($parts[2]) ? $parts[2] : null\n );\n}", "protected function fetchBody($response)\r\n {\r\n $body = substr($response, $this->info->headerSize);\r\n $body = trim($body);\r\n $jsonBody = json_decode($body, true);\r\n\r\n if (is_array($jsonBody) AND json_last_error() === JSON_ERROR_NONE) {\r\n $this->body = new SimpleJSONElement($jsonBody);\r\n } elseif (strpos($body, '?xml') !== false) {\r\n $this->body = new SimpleXMLElement($body);\r\n } elseif (strpos($body, '!DOCTYPE') !== false or strpos($body, '!doctype') !== false) {\r\n $DomDocument = new \\DOMDocument();\r\n $DomDocument->loadHTML($body);\r\n $this->body = $DomDocument;\r\n } elseif (false !== ($serializeArray = unserialize($body))) {\r\n $this->body = new SimpleSerializeElement($serializeArray);\r\n } else {\r\n parse_str($body, $queryString);\r\n\r\n if (isset($queryString[ 0 ])) {\r\n $this->body = $body;\r\n } else {\r\n $this->body = new SimpleQueryElement($queryString);\r\n }\r\n }\r\n }", "function getDecodedResponse () {\n if (function_exists('json_decode')) {\n return json_decode($this->responseBody, true);\n } else {\n return $this->responseBody;\n }\n }", "function parse_response($response){ \r\n \r\n list($response_headers,$response_body) = explode(\"\\r\\n\\r\\n\",$response,2); \r\n $response_header_lines = explode(\"\\r\\n\",$response_headers); \r\n \r\n // first line of headers is the HTTP response code \r\n $http_response_line = array_shift($response_header_lines); \r\n if (preg_match('/^HTTP\\/[0-9]\\.[0-9a-z] ([0-9]{3})/i',$http_response_line,$matches)) { \r\n $response_code = $matches[1]; \r\n }\r\n // put the rest of the headers in an array \r\n $response_header_array = array(); \r\n foreach ($response_header_lines as $header_line) { \r\n list($header,$value) = explode(': ',$header_line,2); \r\n $response_header_array[$header] = $value; \r\n } \r\n \r\n return array($response_code,$response_header_array,$response_body); \r\n}", "public function _parseResponce()\n\t\t{\n\t\t\t$pattern = \"/(link_cropped_no\\\" target=\\\"_blank\\\" href=\\\")(.{0,255})(\\\" )/i\";\n\t\t\tpreg_match_all($pattern, $this->responce, $out);\n\t\t\t$this->content = (!empty($out['2'])) ? array_splice($out['2'], false, AMOUNT_OF_RESULTS) : array();\n\t\t}", "function processResponse($strResponse) {\n\t\tlist($theHeaders, $theBody) = explode(\"\\r\\n\\r\\n\", $strResponse, 2);\n\t\treturn array('headers' => $theHeaders, 'body' => $theBody);\n\t}", "protected function _parseResponse($response) {\n\t\t$headers = substr($response, 0, strpos($response, \"\\r\\n\\r\\n\"));\n\t\t$body = substr($response, strlen($headers));\n\t\t\n\t\t//split up the headers\n\t\t$parts = preg_split(\"/\\r?\\n/\", $headers, -1, PREG_SPLIT_NO_EMPTY);\n\t\t$heads = array();\n\t\tfor ($i = 1, $total = sizeof($parts); $i < $total; $i++ ) {\n\t\t\tlist($name, $value) = explode(': ', $parts[$i]);\n\t\t\t$heads[$name] = $value;\n\t\t}\n\t\tif (array_key_exists('Set-Cookie', $heads)) {\n\t\t\t$this->setCookie($heads['Set-Cookie']);\n\t\t}\n\t\t$this->__setInfo('responseHeaders', $heads);\n\t\t\n\t\t$this->response['headers'] = $heads;\n\t\t$this->response['body'] = trim($body);\t\t\n\t}", "public function getBody($response)\n {\n return json_decode((string) $response->getBody());\n }", "public function parse($body) {\n\t\tif($this->is_post) return $this->html_post;\n\t\t//call this line when header redirect\n\t\tif($this->is_redirect) return \"\";\n\t\t//call this line when error 404\n\t\tif($this->is_error_404) return \"\";\n\t\t\n\t\t//otherwise, run parser for the body\n\t\tforeach($this->parsers as $parser)\n\t\t\t$parser($body);\t//pass reference into parser\n\t\treturn $body;\n\t}", "protected function parsePostResponse()\n\t{\n\t\t$this->validateErrorsInBody($this->decodedBody());\n\t\treturn true;\n\t}", "protected function parseGetResponse()\n\t{\n\t\t$body = $this->decodedBody();\n\n\t\t//check and throw errors\n\t\t$this->validateErrorsInBody($body);\n\n\t\t$this->setDataFromBody($body);\n\t\t$this->setMetaFromBody($body);\n\n\t\treturn true;\n\t}", "function getBodyFromResponse(Response $response = null)\n {\n return empty($response) ? [] : json_decode($response->getBody());\n }", "public function getBody() {\n\t\treturn $this->response_body;\n\t}", "private function parse_curl_response()\n {\n $this->status_code = curl_getinfo($this->curl_handle, CURLINFO_HTTP_CODE);\n #$this->http_info = array_merge($this->http_info, curl_getinfo($this->curl_handle));\n\n $header_size = curl_getinfo($this->curl_handle, CURLINFO_HEADER_SIZE);\n\n // Capture the HTTP response headers\n $this->http_response_headers = substr($this->curl_response, 0, $header_size);\n\n // Capture the HTTP response body\n $this->http_body = substr($this->curl_response, $header_size);\n\n if(!$this->do_not_exit)\n {\n $this->_check_valid_response($this->http_body);\n }\n //close connection\n curl_close($this->curl_handle);\n }", "protected static function decodeBody(\\Guzzle\\Http\\Message\\Response $pResponse)\n {\n $data = json_decode($pResponse->getBody(true));\n if (JSON_ERROR_NONE !== json_last_error()) {\n throw new Exception('Unable to parse response body into JSON');\n }\n\n if ($data === NULL) {\n $data = new stdClass;\n }\n\n return $data;\n }", "protected function parse() {}", "public function getBody()\n {\n return $this->response;\n }", "public function getParsedBody(ResponseInterface $response)\n {\n\n return json_decode($response->getBody());\n }", "private function getBodyAndHeaders($body, &$response)\n {\n $headers = array();\n\n $data = explode(\"\\n\",$body);\n\n $flag = 1;\n\n foreach ($data as $part) {\n if ($flag == 1) {\n $headers['Protocol'] = explode(' ', $part)[0];\n } else if(count($data) == $flag) {\n $response->body = trim($part);\n break;\n } else {\n $aux = explode(': ', $part);\n\n if (count($aux) >= 2) {\n $headers[$aux[0]] = trim($aux[1]);\n }\n }\n\n $flag++;\n }\n\n $response->headers = $headers;\n }", "protected function get_parsed_response( $raw_response_body ) {\n\n\t\twp_parse_str( urldecode( $raw_response_body ), $this->response_params );\n\n\t\treturn $this->response_params;\n\t}", "private function parseDefaultResponse($rawResponse)\n {\n if (isset($rawResponse->body) && $rawResponse->body != '') {\n switch ($rawResponse->type) {\n case 'application/json':\n $content = JsonHelper::decode((string) $rawResponse->body);\n break;\n case 'application/msgpack':\n case 'application/x-msgpack':\n $content = msgpack_unpack((string) $rawResponse->body);\n break;\n default:\n $this->buildExceptionFromResponse($rawResponse);\n }\n if (!isset($content)) {\n $this->buildExceptionFromResponse($rawResponse);\n }\n } else {\n $content = null;\n }\n if (!isset($content['success'])) {\n $content = [\n 'success' => true,\n 'data' => $content,\n ];\n }\n if (!isset($rawResponse->headers['content-id']) && count($this->requests) == 1) {\n $rawResponse->headers['content-id'] = $this->requests[0]->id;\n }\n if (!isset($rawResponse->headers['content-id'])) {\n throw new Exception('Invalid response!');\n }\n $content['id'] = $rawResponse->headers['content-id'];\n $meta = isset($content['meta']) ? $content['meta'] : [];\n $content['meta'] = array_merge($rawResponse->customHeaders, $meta);\n $content['meta']['statusCode'] = (int) $rawResponse->statusCode;\n $content['headers'] = $rawResponse->headers;\n if (isset($content['data'])) {\n FileHelper::processFiles($content['data'], $content['id']);\n }\n if ((int) $rawResponse->statusCode >= 400 && $content['success']) {\n $content['success'] = false;\n $content['error'] = [\n 'code' => ResponseError::ERRORCODE_HTTP_ERROR,\n 'message' => $rawResponse->statusCode,\n ];\n }\n\n return new ApiResponse($content);\n }", "public function getParsedBody()\n {\n return $this->parsedBody;\n }", "public function deserializeResponse(string $response): Response;", "public function parseResponse(Response $response)\n {\n $this->responseStatus = [\n 'code' => $response->getStatusCode(),\n 'reason' => $response->getReasonPhrase(),\n ];\n if ($response->getStatusCode() != 200) {\n throw new \\Exception('Invalid response \"' . $response->getStatusCode() . '\"'); \n }\n $response = json_decode($response->getBody(), true);\n\n if (!isset($response['status']) || !isset($response['data'])) {\n throw new \\Exception('Invalid response'); \n }\n return $response['data'];\n\n }", "protected function _parseHeader() {}", "public function body()\n {\n return (string)$this->response->getBody();\n }", "public function getRawResponse();", "protected function parseResponse($response)\n\t{\n\t\t$this->params = array();\n\t\t\n\t\tif (empty($response)) {\n\t\t\tthrow new OAuthException('Some error occurred when do http request', -1);\n\t\t}\n\t\t\n\t\t$pos = strpos($response, \"\\r\\n\\r\\n\");\n\t\t$header = substr($response, 0, $pos);\n\t\t$body = trim(substr($response, $pos + 4));\n\t\t\n\t\t$status = substr($header, 0, strpos($header, \"\\r\\n\"));\n\t\tif (preg_match('/^HTTP\\/\\d\\.\\d\\s([\\d]+)\\s(.*)$/', $status, $matches)) {\n\t\t\t$code = intval($matches[1]);\n\t\t\t$status = $matches[2];\n\t\t\tif ($code == 400 || $code == 401 || $code == 500) {\n\t\t\t\tthrow new OAuthException($body, $code);\n\t\t\t} elseif ($code == 200) {\n\t\t\t\tparse_str($body, $this->params);\n\t\t\t} else {\n\t\t\t\tthrow new OAuthException($status, $code);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new OAuthException('Invalid http response', -1);\n\t\t}\n\t}", "public function getBody(): string\n {\n return (string) $this->response->getBody();\n }", "public function testParseResponse() {\n $data = $this->dl->parseResponse($this->sampleData, \"JSON\");\n $this->assertion($data['zip'], \"37931\", \"Parsed zip should equal 37931.\");\n $this->assertion($data['conditions'], \"clear sky\", \"Parsed conditions should equal clear sky.\");\n $this->assertion($data['pressure'], \"1031\", \"Parsed pressure should equal 1031.\");\n $this->assertion($data['temperature'], \"35\", \"Parsed temperature should equal 35.\");\n $this->assertion($data['windDirection'], \"ESE\", \"Parsed wind direction should equal ESE.\");\n $this->assertion($data['windSpeed'], \"1.06\", \"Parsed wind speed should equal 1.06.\");\n $this->assertion($data['humidity'], \"80\", \"Parsed humidity should equal 80.\");\n $this->assertion($data['timestamp'], \"1518144900\", \"Parsed timestamp should equal 1518144900.\");\n }", "protected function analyzeResponse() {\n\t\tvar_dump($this->curlResponse);\n\t\t$parts = explode(\"\\r\\n\\r\\n\", $this->curlResponse);\n\n\t\t$response_body = array_pop($parts);\n\t\t$response_headers = implode('', $parts);\n\t\t$http_status_code = $this->curl->getinfo(CURLINFO_HTTP_CODE); \n\n\t\treturn array(trim($response_headers), trim($response_body), $http_status_code);\n\t}", "public function getParsedBody()\n {\n if ($this->bodyParsed) {\n return $this->bodyParsed;\n }\n\n if (!$this->body) {\n return null;\n }\n\n $mediaType = $this->getMediaType();\n $body = (string)$this->getBody();\n\n if (isset($this->bodyParsers[$mediaType]) === true) {\n $parsed = $this->bodyParsers[$mediaType]($body);\n\n if (!is_null($parsed) && !is_object($parsed) && !is_array($parsed)) {\n throw new RuntimeException('Request body media type parser return value must be an array, an object, or null');\n }\n $this->bodyParsed = $parsed;\n }\n\n return $this->bodyParsed;\n }", "protected function parse_response($response) {\n $length = strlen(PHP_INT_MAX);\n $response = preg_replace('/\"(id|in_reply_to_status_id)\":(\\d{' . $length . ',})/', '\"\\1\":\"\\2\"', $response);\n return json_decode($response, TRUE);\n }", "protected function _parse_respone($response)\n {\n $response = explode(self::RESPONSE_SEPARATOR, rtrim($response, self::RESPONSE_SEPARATOR));\n if ( is_array($response) ) {\n $this->response['status'] = $response[0];\n if ( $this->response['status'] == self::RESPONSE_OK ) {\n unset($response[0]);\n $this->response['data'] = $response;\n } else {\n $this->response['error'] = $response[1];\n }\n }\n }", "public function decode($response);", "public function parse()\n\t{\n\t\t//we don't need to hit the API everytime parse is called\n\t\tif (!$this->response)\n\t\t\t$this->response = $this->request->execute();\n\t\t\n\t\treturn $this->invokeParserMethod();\t\n\t}", "public function test_can_create_psr7_response(): void {\n\n\t\t$response = HTTP_Helper::response( array( 'key' => 'test_VALUE' ), 500 );\n\n\t\t$body = json_decode( (string) $response->getBody(), true );\n\n\t\t$this->assertInstanceOf( ResponseInterface::class, $response );\n\t\t$this->assertIsArray( $body );\n\t\t$this->assertArrayHasKey( 'key', $body );\n\t\t$this->assertEquals( 'test_VALUE', $body['key'] );\n\t\t$this->assertEquals( 500, $response->getStatusCode() );\n\t}", "function parse_response($raw_data, $data_type) {\r\n if ($data_type == 'json') {\r\n $parsed_data = json_decode($raw_data);\r\n }\r\n else if ($data_type == 'xml') {\r\n $namespace_pattern = '/([<\\/\\s])[a-z]+\\:/';\r\n $clean_data = preg_replace($namespace_pattern, '\\1', $raw_data);\r\n if ($clean_data[0] == '<') {\r\n $parsed_data = simplexml_load_string($clean_data);\r\n }\r\n else {\r\n $parsed_data = false;\r\n }\r\n }\r\n return $parsed_data;\r\n }", "protected function getBody($response)\n {\n // strip the HTTP headers:\n $sep = strpos($response, \"\\r\\n\\r\\n\");\n $headers = substr($response, 0, $sep);\n $sep = strpos($response, \"\\r\\n\\r\\n\");\n $response = substr($response, $sep + 4);\n if (stristr($headers, 'Transfer-Encoding: chunked')) {\n $response = $this->decodeChunked($response);\n }\n $response = trim($response);\n return $response;\n }", "function parseResponse($response){\n $res = array();\n $r = explode(':', $response);\n\n switch($r[0]){\n case 'd':\n if($r[1] == 'err') {\n $res['danger'] = 'Could not delete the desired element.';\n }\n elseif($r[1] == 'ok') {\n $res['success'] = 'Element permanently deleted.';\n }\n break;\n default:\n break;\n }\n return $res;\n }", "public function getParseBody()\n {\n return $this->parse_body;\n }", "public function response() {\n return json_decode($this->response);\n }", "protected function parseResponse(ResponseInterface $response)\n {\n if ($response->getStatusCode() >= 200 && $response->getStatusCode() < 300) {\n if ($location = $response->getHeaderLine('Location')) {\n return $location;\n } elseif ($response->getHeaderLine('Content-Type') === 'text/json') {\n return json_decode((string) $response->getBody(), true);\n } else {\n return $response->getBody();\n }\n } else {\n throw new RequestException(\n 'Unexpected response code',\n RequestException::$UNEXPECTED_RESPONSE_CODE,\n $response->getStatusCode()\n );\n }\n }", "function parseBody() {\r\n $count = count($this->body);\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($this->html)\r\n $content.= \"<b>\";\r\n $content .= $this->body[$i][\"key\"] . ': ';\r\n if ($this->html)\r\n $content.= \"</b>\";\r\n if ($this->html)\r\n $content .= nl2br($this->body[$i][\"value\"]) . \"\\n\";\r\n else\r\n $content .= $this->body[$i][\"value\"];\r\n if ($this->html)\r\n $content.= \"<hr noshade size=1>\\n\";\r\n else\r\n $content.= \"\\n\" . str_repeat(\"-\", 80) . \"\\n\";\r\n }\r\n\r\n $this->body = $content;\r\n }", "#[Pure]\nfunction http_parse_message($message) {}", "public function getBody(){\r\n //aqui debo invocar lo que DescargaSATSDK tiene como metodo para deserializar, buscar la manera de hacerlo,quiza un callback baste\r\n if(empty($this->body)){\r\n return $this->body;\r\n }\r\n //nota, debo de ver si la cabera de respiesta inckuye un content-type de json, si lo contiene entonces hacer la deserializacion, por sencillez lo hare asi directo\r\n //pero debo de validar\r\n if(null==$this->callbackDecoder){\r\n return json_decode($body,true);\r\n }else{\r\n $decoder=$this->callbackDecoder;\r\n return $decoder($this->body,$this->dataMapper);\r\n }\r\n }", "public function get_body()\n {\n return json_decode(file_get_contents('php://input'), TRUE);\n }", "private function parseApiResponse($response, $requestType = null){\n //combine the current response from Chikka and the message type that was requested\n var_dump($response);\n $response = json_decode($response,true);\n if($requestType){\n $response['request_type'] = $requestType;\n }\n\n return json_decode(json_encode($response));;\n }", "public function getBody()\n {\n $body = json_decode($this->body, true);\n\n dd($body);\n }", "public function parseResponseStringToObject()\n {\n /** @var TransporterInterface $transporter */\n $transporter = TransporterFactory::build();\n\n return $transporter->parseResponseStringToObject($this->response);\n }", "public static function extractBody($rawResponseString)\n {\n $responseString = self::ExtractCorrectResponse($rawResponseString);\n return parent::extractBody($responseString);\n }", "public function parse_response($resp)\n {\n if ($resp['data']==null)\n {\n return ['error'=>404, 'message'=>'Data from youtube not found'];\n }\n else\n {\n return ['error'=>0, 'data'=>$resp['data']];\n }\n }", "public function parseResponseToData()\n {\n /** @var TransporterInterface $transporter */\n $transporter = TransporterFactory::build();\n\n return $transporter->parseResponseToData($this->response);\n }", "public function processResponseData($rawResponseData);", "public function parseResponse($responseString) {\n $dom = new DOMDocument();\n $dom->preserveWhiteSpace = FALSE;\n if(@$dom->loadXML($responseString)){\n $xmlconvert = new xmlconvert();\n $objconvert = new objconvert();\n $OLS_obj = $xmlconvert->xml2obj($dom);\n $badgerfish = $objconvert->obj2json($OLS_obj);\n return parent::parseResponse($badgerfish);\n }\n else{\n throw new Exception('failed to parse response from openorder: ' . $responseString);\n }\n }", "public function parseResponse($response_object){\n $retval = null;\n if (is_object($response_object)) {\n if (!empty($response_object->data)){\n $temp_array = drupal_json_decode($response_object->data);\n $retval = (object)$temp_array;\n }\n }\n return $retval;\n }", "protected function handleBody(): array\n {\n return [\n 'message' => $this->getMessage() ? : Response::getReasonPhraseByCode($this->getStatusCode()),\n ];\n }", "public function getRawBody();", "private function process(HttpSocketResponse $response)\n\t{\n\t\t$result = array();\n\t\tif (!empty($response)) {\n\t\t\t$body = $response->body();\n\t\t\tswitch ($this->format) {\n\t\t\t\tcase 'xml':\n\t\t\t\t\t$xml = Xml::build($body);\n\t\t\t\t\t$temp = Xml::toArray($xml);\n\t\t\t\t\t$result = array('Yourls' => $temp['result']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\n\t\t\t\t\t$result = array('Yourls' => json_decode($body, true));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$result = $body;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "private function getLastResponseBodyAsArray(): array\n {\n $body = $this->client->getLastResponseBody();\n $contentType = $this->client->getLastResponseContentType();\n $returnData = null;\n\n // parse XML\n if (0 === strpos($contentType, 'application/xml')) {\n $returnData = XmlSerializer::createFromString($body)->getNormalized();\n } elseif (0 === strpos($contentType, 'application/json')) {\n $returnData = JsonSerializer::createFromString($body)->getNormalized();\n }\n\n if (!is_array($returnData)) {\n throw new SerializerException('Could not convert response body into array: '.$body);\n }\n\n return $returnData;\n }", "public function getResponseParser()\n {\n return new ResponseParser();\n }", "protected function handleResponse($response)\n {\n if($this->response_type === 'json')\n return json_decode($response->getBody(), true);\n\n return simplexml_load_string($response->getBody());\n }", "private function testResponseBody($body)\n {\n\n if ( empty($body) ) {\n\n throw (new LarastackPaystackException());\n }\n\n $bodyArray = json_decode($body, true);\n\n if ( empty($bodyArray['status']) || !$bodyArray['status'] || empty($bodyArray['data'])) {\n\n throw (new LarastackPaystackException());\n }\n\n return $bodyArray['data'];\n }", "protected function parseResponseData(HttpResponse $response)\n {\n return json_decode($response->getBody());\n }", "protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'the item code was specified more than once') !== false) ? true : $this->response['response']['error'];\n\t\t\t$this->response['response']['Level1Code'] = $this->request['Level1Code'];\n\t\t\t\n\t\t\tif (!$this->response['response']['error']) { // IF Error is False\n\t\t\t\tif (in_array($this->response['server']['http_code'], array('200', '201', '202', '204'))) {\n\t\t\t\t\t$this->log_sendlogitem($this->request['Level1Code']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->log_error($this->response['response']['Message']);\n\t\t\t}\n\t\t}", "public function getPhpResponse() {\n return \\Lib\\Format::forge($this->_response)->to_php();\n }", "protected function _decode($body) {\n\t\t$media = $this->_classes['media'];\n\n\t\tif ($media::type($this->_type)) {\n\t\t\t$decoded = $media::decode($this->_type, $body);\n\t\t\t$body = $decoded !== null ? $decoded : $body;\n\t\t}\n\t\treturn $body;\n\t}", "abstract public function processResponse($response);", "static public function parse_plain_response($s)\n {\n parse_str($s, $a);\n return $a;\n }" ]
[ "0.7628357", "0.7445503", "0.739753", "0.7324115", "0.7141992", "0.70179325", "0.70108366", "0.69146585", "0.6847607", "0.6762373", "0.6712327", "0.67110604", "0.66663504", "0.6651191", "0.6611875", "0.64947444", "0.64939845", "0.6479138", "0.6468709", "0.6403483", "0.63564783", "0.6355805", "0.6314251", "0.6306961", "0.62808275", "0.6271043", "0.62598836", "0.61710113", "0.6155329", "0.6152885", "0.6150383", "0.61358887", "0.61353403", "0.6104229", "0.60863996", "0.6067538", "0.6046411", "0.6036771", "0.60365826", "0.60234314", "0.5979233", "0.5956519", "0.5937117", "0.5923753", "0.59230816", "0.59029955", "0.5902471", "0.589754", "0.58971685", "0.58960646", "0.58914816", "0.5875314", "0.58747286", "0.585356", "0.5851613", "0.5847982", "0.58415264", "0.5841419", "0.5836352", "0.58212715", "0.58053285", "0.5780264", "0.577438", "0.5764439", "0.5759288", "0.575468", "0.57251596", "0.5721449", "0.5720684", "0.5687123", "0.56837004", "0.568037", "0.56763923", "0.56581587", "0.56334406", "0.5633059", "0.56252635", "0.5624114", "0.56238174", "0.56220925", "0.56199574", "0.5613745", "0.56104475", "0.5605337", "0.55930877", "0.5583385", "0.5579471", "0.5570704", "0.55650455", "0.5556814", "0.5546085", "0.55416256", "0.5538205", "0.5537569", "0.55336016", "0.5530017", "0.5527185", "0.55258286", "0.55208236", "0.5519586" ]
0.55900234
85
Serialization can be used for caching. Of course doing so can be dangerous but some like to live dangerously. \serialize() should be called on the collections or object you want to cache. We don't need any property that can be set by the constructor, only properties that are set by setters. Note that the API key is not serialized, so you need to set the key again after unserializing if you want to do more API calls.
public function __sleep() { return ['apiEndpoint']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n\t\tif (!$this->rootKey) {\n\t\t\t$this->rootKey = preg_replace('/Serializer$/', '', get_class($this));\n\t\t}\n\t}", "private function serializer()\n {\n $this->setSerializableOptionsArray();\n\n return new Serializer($this->serializableOptions());\n }", "function __construct() {\n $this->_cache = [];\n }", "protected function cacheKey()\n {\n return json_encode($this);\n }", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "public function setSerializer()\n {\n return new JsonApiSerializer(url('api'));\n }", "public function __construct()\n {\n $this->apiKey = '66122f8ad1adb1c075c75aba3bd503a4a559fc7f';\n }", "final public function jsonSerialize() {}", "public function getCustomSerializer($fieldKey);", "public abstract function serialize();", "protected function getCache_SerializerService()\n {\n return $this->services['cache.serializer'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('+si9XZUmcI', 0, 'MYfBg2oUlptyQ7C3Ob4WQe', (__DIR__.'/pools'), $this->get('monolog.logger.cache', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }", "public function jsonSerialize()\n {\n $this->serializeWithId($this->resolveFields(\n resolve(Request::class)\n ));\n }", "public static function getSerializer();", "public function getObjFromCache($key);", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\gooten.api.client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\gooten.api.client\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }", "public function __construct($apiKey, array $options = [])\n {\n if (empty($apiKey)) {\n throw new InvalidArgumentException(\"apiKey cannot be empty.\");\n }\n\n $hash = Murmur::hash3($apiKey);\n $this->cacheKey = sprintf(self::CACHE_KEY, $hash);\n\n if (isset($options['logger']) && $options['logger'] instanceof LoggerInterface) {\n $this->logger = $options['logger'];\n } else {\n $this->logger = new NullLogger();\n }\n\n if (isset($options['cache']) && $options['cache'] instanceof ConfigCache) {\n $this->cache = $options['cache'];\n } else {\n $this->cache = new ArrayCache();\n }\n\n if (isset($options['cache-refresh-interval']) && is_int($options['cache-refresh-interval'])) {\n $this->cacheRefreshInterval = $options['cache-refresh-interval'];\n }\n\n $this->cache->setLogger($this->logger);\n $this->fetcher = new ConfigFetcher($apiKey, $this->logger, $options);\n }", "public function _jsonSerialize();", "public function __construct() {\n\n // If we unserialize an object, prevent the magic wakeup from happening.\n ini_set('unserialize_callback_func', '');\n\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\KnetikCloud\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\KnetikCloud\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function serialize(){ }", "public function serializer() {\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Kinow\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Kinow\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __construct()\n {\n $this->users = Cache::remember('admin.users', now()->addHours(1),\n function () {\n return UserResource::collection(User::all())->toJson();\n });\n }", "public function getSerializer();", "public function __construct() {\t\t\n\t\t$this->apikey='uYXMOYkzh1bJwKLk8SFb00EiYydmLDvoqskEOtqlk4hSE9NAM9RRV08C';\n\t\t$this->apisec='9FsUJswhQX13nGdahA6YDgkfZdYd05/SPObJKD12GAP5LKq1smT0FAVuMc26PH0fvuYPVlPVECBYXvu8Aqy92Q==';\n\t\t$this->url = 'https://api.kraken.com';\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function serialize()\n {\n }", "public function serialize()\n {\n }", "abstract public function serialize();", "abstract public function serialize();", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Yext\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Yext\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Upcloud\\ApiClient\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Upcloud\\ApiClient\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __construct($api_key)\n {\n $this->_apiKey = $api_key;\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\Bytescout\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\Bytescout\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }", "public function __construct()\n \t {\n \t \t parent::__construct();\n \t \t $data = SkrillPsp_Json::getQIWIJson();\n \t \t $this->json = $this->decode($data, true);\n \t \t $this->json['id'] = $this->setId();\n \t \t $this->json['method'] = $this->method;\n \t }", "public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}", "public function __construct()\n {\n $this->apiKey = Config::i()->getSXApiKey();\n }", "public function serialize()\n {\n // TODO: Implement serialize() method.\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Ubo\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Ubo\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "private function packData()\n {\n $this->packedData = json_encode($this->CacheData, JSON_UNESCAPED_UNICODE);\n return $this;\n }", "public function serialize();", "public function serialize();", "public function serialize();", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Secuconnect\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Secuconnect\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Secuconnect\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Secuconnect\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this));\n }", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "public function __construct( $properties = array(), $setCache = false ){\n $this->setPropertiesFromArray($properties);\n // cache it\n// if( $setCache === true ) {\n// $toCache = RedisCache::cache()->_serialize($this);\n// RedisCache::cache()->set(__CLASS__ . $this->Id, $toCache, 48*60);\n// }\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }", "public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Swagger\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }" ]
[ "0.6005235", "0.57746613", "0.57644194", "0.57616085", "0.5694992", "0.5694992", "0.56934434", "0.56934434", "0.56934434", "0.56934434", "0.56934434", "0.56934434", "0.5671063", "0.5656004", "0.564121", "0.56031024", "0.5553938", "0.5542444", "0.5539753", "0.5527187", "0.5504173", "0.5486668", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485526", "0.5485284", "0.5482381", "0.547837", "0.5477177", "0.5475697", "0.547526", "0.5473227", "0.5464841", "0.5460608", "0.54571855", "0.54373574", "0.5434609", "0.5434609", "0.54284275", "0.54284275", "0.54210305", "0.54210305", "0.54187834", "0.5412936", "0.5408165", "0.5407262", "0.5404186", "0.5368191", "0.5335904", "0.5335253", "0.5332446", "0.53323007", "0.53241134", "0.53241134", "0.53241134", "0.532409", "0.532409", "0.5316233", "0.5316233", "0.531598", "0.5313462", "0.5302431", "0.5302431", "0.5302431", "0.5302431", "0.5302431", "0.5302431" ]
0.0
-1
When unserializing a collection or a resource, this class should restore itself. Note that if you use a custom GuzzleClient, this client is lost. You can't re set the Client, so you should probably not use this feature.
public function __wakeup() { $this->__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function restore() {}", "public function restore() {}", "public function restore()\n {\n }", "public function restore()\n {\n //\n }", "public function restore();", "public function __construct()\n {\n parent::__construct();\n $this->guzzleClient = new GuzzleHttp\\Client([\n 'Connection' => 'close',\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_FRESH_CONNECT => true,\n ]);\n }", "public function restore(Cliente $cliente)\n {\n $nombre = \"El cliente $cliente->nombre\";\n return $this->baseController->restore($cliente, $nombre);\n }", "public function restore()\n {\n $this->restoreEntrustUserTrait();\n $this->restoreSoftDeletes();\n }", "public function restoreOriginalService(): void;", "public function restore(){\n $this->update(['deleted_by', NULL]);\n return $this->baseRestore();\n }", "public function restored(ClientComment $clientComment)\n {\n //\n }", "protected function client() : GuzzleClient {\n return $this->client;\n }", "protected function initializeClient() : self {\n $this->client = new GuzzleClient([\n 'headers' => [\n 'Accept' => 'application/json',\n 'Accept-Encoding' => 'gzip, deflate',\n 'Cache-Control' => 'max-age=0',\n 'User-Agent' => sprintf('FreedomCore Media/%s Jackett Client', env('APP_VERSION'))\n ],\n 'timeout' => $this->timeout,\n 'allow_redirects' => [\n 'max' => $this->maxRedirects,\n ],\n 'debug' => $this->debug\n ]);\n return $this;\n }", "public function unbox()\n {\n APIHelper::deserialize(self::getResponseBody(), $this, false, false);\n }", "public function restore($document_mapper = null)\n {\n static::getStaticDocumentMapper($document_mapper)::restore($this);\n }", "public function restore()\n\t{\n\t\t$this->files = array();\n\t}", "private function initializeClient()\n {\n $this->client = new Client($this->guzzleConfig);\n\n if ($this->isInDebugMode()) {\n $this->setDebugger();\n }\n if ($this->needsAuthentication()) {\n $this->authenticate();\n }\n\n return $this->client;\n }", "public function resetClient(&$client)\n {\n //TODO\n }", "protected function _afterLoad()\n {\n foreach ($this->_items as $item) {\n $this->getResource()->unserializeFields($item);\n }\n return parent::_afterLoad();\n }", "protected function initialHttpClient()\n {\n $this->client = new Client();\n }", "private function setupGuzzleClient() {\n $config = $this->getClientConfig();\n $this->client = $this->createGuzzleClient($config);\n }", "public function __construct()\n {\n self::$clients = new Collection();\n }", "protected function initializeClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n $options = [\n 'base_uri' => static::$baseUrl,\n 'http_errors' => true,\n 'headers' => [\n 'Content-Type' => 'text/xml',\n ],\n ];\n\n return $this->client = new Client($options);\n }", "private function getClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n return new Client();\n }", "protected function tearDown()\n {\n $this->client = null;\n }", "public function tearDown()\n {\n $this->client = null;\n }", "public function restoreAfterRequest()\n {\n Facade::clearResolvedInstances();\n\n foreach ($this->backupedValuesBeforeRequest as $attri => $v) {\n// echo \"\\n $attri\\n\";\n// if (is_array($this->$attri))\n// echo 'dif:', count($this->$attri) - count($this->__oldValues[$attri]);\n $this->$attri = $v;\n }\n\n\n foreach ($this->restoreTool as $tool) {\n $tool();\n }\n\n\n if ($this->configNeedBackup ) {\n\n $config = $this->make('config');\n\n foreach ($config->changedConfig as $key => $value) {\n $config->set($key, $value);\n }\n $config->changedConfig = [];\n }\n\n $this->booted = false;\n }", "protected function tearDown()\n {\n $this->client = null;\n\n parent::tearDown();\n }", "protected function prepareSerializer()\n {\n return (new LaravelSerializer())->getBuilderInstance();\n }", "public function restore()\n {\n if ($basketData = $this->session->get(self::BASKET_CART_SESSION_KEY)) {\n static::$cart = unserialize($basketData);\n }\n }", "protected function getClient() {\n\n\t\t\tif (!$this->client) {\n\n\t\t\t\t$client = $this->createClient();\n\n\t\t\t\treturn $this->client = $client;\n\t\t\t}\n\n\t\t\treturn $this->client;\n\n\t\t}", "public function restore() {\n self::restoreAll($this->chapterID);\n }", "public function setClient(Guzzle\\Http\\Client $client) {\n $this->client = $client;\n }", "protected final function getSerializer()\n {\n return $this->serializer;\n }", "public function getClient(): Client\n {\n return new Client([\n 'http_errors' => false,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n 'handler' => $this->handlerStack,\n ]);\n }", "public function __construct() {\n\t\t\t$this->clients = new \\SplObjectStorage;\n\t\t}", "function restore()\n {\n }", "public function getClient(): Client\n {\n return $this->client;\n }", "public function getClient(): Client\n {\n return $this->client;\n }", "public function setGuzzleClient(\\GuzzleHttp\\Client $guzzleClient)\n {\n $this->guzzleClient = $guzzleClient;\n }", "public function __construct(Guzzle\\Http\\Client $client) {\n $this->setClient($client);\n }", "protected function resetOriginalReadPreference(){\n\n /** @var ReadPreference $dbReadPref */\n $dbReadPref = $this->db->__debugInfo()['readPreference'];\n if($this->originalDbReadPreference !== $dbReadPref->getMode())\n {\n $pref = (isset($this->originalDbReadPreference)\n ? $this->originalDbReadPreference\n : $this->readPreference\n );\n $dbTagsets = $dbReadPref->getTagsets();\n\n $this->db = $this->db->withOptions(array(\n 'readPreference' => new ReadPreference($pref, $dbTagsets)\n ));\n }\n\n // Reset collection object\n /** @var ReadPreference $collReadPref */\n $collReadPref = $this->getCollection()->__debugInfo()['readPreference'];\n if($this->originalCollectionReadPreference !== $collReadPref->getMode()){\n $pref = (isset($this->originalCollectionReadPreference)\n ? $this->originalCollectionReadPreference\n : $this->readPreference\n );\n $collTagsets = $collReadPref->getTagsets();\n $this->collection = $this->collection->withOptions(array(\n 'readPreference' => new ReadPreference($pref, $collTagsets)\n ));\n }\n }", "public function setUnserializer($unserializer) {\n\t\t\t$this->unserializer = $unserializer;\n\t\t\treturn $this;\n\t\t}", "public function getSerializer()\n {\n return $this->serializer;\n }", "function getClient() {\n return $this -> _client;\n }", "protected function createClientWithoutSession()\n {\n $this->client = static::createClient();\n }", "public function getClient() {\n return $this->client;\n }", "public function getClient() {\n return $this->client;\n }", "public function getClient() {\n return $this->client;\n }", "public function store(StoreClientRequest $request)\n {\n $newClient = Client::create($request->all());\n\n return new ClientResource($newClient);\n }", "public function unserialize($serialized)\n\t{\n\t\t$obj = json_decode($serialized, true);\n\t\tif ($obj && is_array($obj) && json_last_error() === JSON_ERROR_NONE)\n\t\t{\n\t\t\t$this->exchangeArray($obj['this']);\n\t\t\t$this->data = (array)$obj['data'];\n\t\t\t$this->set_response_name((string)$obj['name']);\n\t\t\t$this->merged = (array)$obj['merged'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new PheryException('Invalid data passed to unserialize');\n\t\t}\n\t\treturn $this;\n\t}", "public function __construct(GuzzleClient $client)\n {\n $this->client = $client;\n }", "public function &getClient()\n\t{\n\t\treturn $this->_client;\n\t}", "public function revert()\n {\n $this->items = $this->clone;\n $this->measure();\n\n return $this;\n }", "public function __construct()\n\t{\n\t\t$this->clients = new \\SplObjectStorage();\n\t}", "public function __construct()\n {\n $this->client = new Client();\n }", "public function restore(EntityInterface $entity) {\n $entity = $this->load($entity->id());\n }", "public function getGuzzleClient();", "public function syncOriginal()\n {\n $this->original = $this->toArray();\n\n return $this;\n }", "public function setClient(Client $client)\n {\n $this->http = $client;\n return $this;\n }", "public function getClient() {\n return $this->client;\n }", "public function getClient() {\n return $this->client;\n }", "public function getClient() {\n return $this->client;\n }", "private function getClient()\n {\n return new \\GuzzleHttp\\Client([\n 'base_uri' => $this->url,\n 'timeout' => 2.0,\n ]);\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function getClient()\n {\n return $this->client;\n }", "public function reverse() {\r\n\t\t$this->collection = array_reverse($this->collection);\r\n return $this;\r\n }", "public function save() {\n\t\t$serial = $this->getSerialized($this);\n\t\t//var_export($shallow);\n\t\t$client = $this\n\t\t->getClient();\n\n\t\t$endpoint = static::getResourcePath()\n\t\t->getPath();\n\n\t\t// var_export($shallow);\n\n\t\t$response = $client->doPut($endpoint, $serial);\n\t\t$constructedEntity = $this->makeEntityFromResponse($response);\n\n\t\treturn $constructedEntity;\n\t}", "public function setRestClient(GuzzleHTTP $restClient) : ClientContract\n {\n $this->restClient = $restClient;\n\n return $this;\n }", "protected function tearDown()\n {\n $this->clientFactory = null;\n\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->clientFactory = null;\n\n parent::tearDown();\n }", "private function getClient()\n {\n if ($this->client === null) {\n // @codeCoverageIgnoreStart\n $this->setClient(new Client());\n }\n // @codeCoverageIgnoreEnd\n\n return $this->client;\n }", "protected function getClient()\n\t{\n\t\treturn $this->client;\n\t}", "public function resetSendInvoiceByPost(): Client\n {\n $this->sendInvoiceByPost = null;\n\n /** @var Client $this */\n return $this;\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->collection);\n\t\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->httpClient = new GuzzleHttpClient();\n }", "public function reverse(): self\n {\n $collection = clone $this;\n $collection->items = array_reverse($collection->items);\n\n return $collection;\n }", "public function getSerializer();", "public function getRestClient()\n {\n if (!isset($this->restClient)) {\n $this->restClient = new Client(\n array(\n 'base_uri' => $this->restParameters['base_url']\n )\n );\n }\n return $this->restClient;\n }" ]
[ "0.610992", "0.61024016", "0.6047171", "0.5914887", "0.57480913", "0.5688731", "0.56117845", "0.5545415", "0.5528258", "0.55136377", "0.5496426", "0.54377353", "0.54104245", "0.5382459", "0.53447527", "0.53288907", "0.53188044", "0.5312337", "0.5274417", "0.52359205", "0.52283037", "0.5209631", "0.51900965", "0.51746047", "0.5162322", "0.51597834", "0.5159256", "0.5140203", "0.5130445", "0.5121695", "0.51160777", "0.51078075", "0.510465", "0.5083621", "0.50766414", "0.50752586", "0.50684434", "0.50503284", "0.50503284", "0.50208044", "0.50144094", "0.5010552", "0.5010139", "0.50100076", "0.50002897", "0.49823177", "0.4977518", "0.4977518", "0.4977518", "0.49642548", "0.4961627", "0.49598688", "0.49563542", "0.4955804", "0.49553275", "0.49539906", "0.49463487", "0.49370545", "0.49298707", "0.49252623", "0.4919734", "0.4919734", "0.49195865", "0.49073383", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.49061415", "0.4901841", "0.49011818", "0.4898186", "0.48944697", "0.48944697", "0.48872268", "0.48820174", "0.4878906", "0.48751283", "0.48712972", "0.4870299", "0.48687905", "0.48687378" ]
0.0
-1
Instance of the Response class.
public static function response(): Response { return new Response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function response() {\n return new Response;\n }", "protected function _getResponse() {\n\t\treturn new Response;\n\t}", "public function get_response_object()\n {\n }", "public function __construct()\n {\n $this->response = new Response();\n }", "public function getResponseInstance(){\n\t\treturn ControllerResponse::getInstance();\n\t}", "public function createResponse()\n {\n return new Response;\n }", "private function response() {\n if ($this->responseStatus !== 200) {\n $this->request['format'] = self::DEFAULT_RESPONSE_FORMAT;\n }\n $method = $this->request['format'] . 'Response';\n $this->response = array('status' => $this->responseStatus, 'body' => $this->$method());\n return $this;\n }", "public function getResponse()\n {\n if (is_null($this->_response)) {\n $this->_response = new Response();\n }\n return $this->_response;\n }", "public static function response()\n {\n $container = Container::instance();\n if (!$container->has('response')) {\n $container->register('response', new Response());\n }\n return $container->get('response');\n }", "public function getResponse() : Response\n {\n return $this->response;\n }", "function get_response() {\n return $this->response;\n }", "public static function getCurrentResponse() {\r\n if (self::$response == NULL) {\r\n self::$response = new self();\r\n }\r\n return self::$response;\r\n }", "protected function createHttpResponse()\n {\n return new Response();\n }", "public function getResponseObject()\n {\n return $this->response_object;\n }", "public function as_response() {\n return Net_HTTP::Response($this);\n }", "function getResponse() {\n\t\treturn $this->Response;\n\t}", "public function get_response()\n {\n return $this->response; \n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }", "public function getResponse()\n {\n return $this->get('Response');\n }" ]
[ "0.838223", "0.8106864", "0.8035493", "0.79922026", "0.77385193", "0.7668337", "0.7621716", "0.75468355", "0.7464541", "0.74318534", "0.7331933", "0.7328389", "0.7285276", "0.72633123", "0.7237784", "0.7186105", "0.7181564", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111", "0.7143111" ]
0.80876994
2
Instance of the Role class.
public static function role(): Role { return new Role; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->Role = new Role();\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Role');\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\Role');\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function model()\n {\n return Role::class;\n }", "public function getRole() {}", "public function getRole();", "public function getRole();", "public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }", "public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\Role', 'id', 'role_id');\n }", "public function role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }", "public function getRole()\n {\n return new Horde_Pear_Package_Contents_Role_HordeApplication();\n }", "public function get_role()\n {\n }", "public function getRoleModel()\n\t{\n\t\treturn $this->roleModel = new RoleModel();\n\t}", "function getRole()\n {\n return $this->role;\n }", "public function role()\n {\n return $this->hasOne('App\\Models\\UserRoles', 'role_id', 'id');\n }", "public static function getInstance()\n {\n if (self::$instance == null)\n {\n self::$instance = new RoleDAO();\n }\n \n return self::$instance;\n }", "public function getRole() \n {\n return $this->role;\n }", "public function role()\n {\n return $this->hasOne('App\\Roles','id','role');\n }", "public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}", "function factory(array $data) {\n if(parent::has($data['id'])) {\n $role = parent::get($data['id']);\n $role->_patch($data);\n return $role;\n }\n \n $role = new Role($this->client, $this->guild, $data);\n $this->set($role->id, $role);\n return $role;\n }", "public function getRole(){\n return $this->role; \n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "public function getRole()\n {\n return $this->role;\n }", "private function __construct()\n {\n $this->setData('registry', new Unus_Role_Registry());\n\n Unus_Model::getInstance()->registerTable('role')\n ->registerField('roleId', Unus_Model_Table::PRIMARY)\n ->registerField('parentId', Unus_Model_Table::ONETOONE, array('use' => 'self'))\n ->registerField('title', Unus_Model_Table::CHAR, array('max_length' => 225))\n ->registerField('level', Unus_Model_Table::INTERGER, array('max_length' => 1));\n\n\n $roles = Unus::registry('db')->_use('role')->all();\n\t\t\n foreach ($roles->fetchAll(PDO::FETCH_ASSOC) as $k => $v) {\n $this->addRole($v['roleId'], $v['title'], $v['level'], $v['parentId']);\n }\n\n\t\treturn $this;\n }", "public function getRole() {\n return $this->role;\n }", "public function getRole() {\n return($this->role);\n }", "function role() {\n isset($this->_role) || $this->_load_from_session();\n return $this->_role;\n }", "public function getRole() {\n $user = new Pas_User_Details();\n $person = $user->getPerson();\n if ($person) {\n $this->_role = $person->role;\n } \n return $this->_role;\n }", "function roleFactory()\n {\n return [\n 'factory'=>(new JbRole)\n ];\n }", "function getRole() {\n\t\treturn 1;\n\t}", "public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }", "public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }", "public function run()\n {\n $role = new Role();\n $role->type = Role::ROLE_USER;\n $role->save();\n\n $role = new Role();\n $role->type = Role::ROLE_ADMINISTRATOR;\n $role->save();\n }", "public function getSingleRole() {\n return $this->roles[0];\n }", "public function GetRecord()\n\t{\n\t\treturn new DotCoreAdminRolesRecord($this);\n\t}", "public function user_role (){\n return $this->hasOne(Role::class);// relates to role model\n }", "public function role() {\n\t\treturn $this->has_one('Role_Assignment', 'user_id');\n\t}", "public function getRole()\n {\n $res = $this->getEntity()->getRole();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getRole();\n\t\t}\n return $res;\n }", "protected static function newFactory()\n {\n return RoleFactory::new();\n }", "protected static function newFactory()\n {\n return RoleFactory::new();\n }", "public function role()\n {\n return $this->belongsTo('Role');\n }", "public function run() {\n\t\tfactory ( Role::class, 10 )->create();\n\t}", "public function __construct()\n {\n $this->repository = new EloquentRoleRepository;\n }", "public function role() {\n return $this->belongsTo(Role::class);\n }", "public function role() {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo('App\\Role');\n }", "public function role()\n {\n return $this->belongsTo(\"App\\Models\\Role\", \"role_id\", \"id\");\n }", "public function _getUserRole()\n {\n $this->selftest();\n return $this->objectUserRole;\n }", "public function __construct()\n {\n $this->roles = [\n \n [\n 'name' => 'administrator',\n 'pengguna' => [\n 'ramdan'\n ],\n 'permissions' => [\n 'anggota-create',\n 'anggota-update',\n 'anggota-delete'\n ]\n ],\n\n ];\n }", "public function role() {\n return $this->belongsTo('App\\Role');\n }", "public static function getRoleModel()\n {\n return static::getModel('Roles');\n }", "function getRole()\n\t{\n\t\tif (($role = $this->getState('__role')) !== null)\n\t\t\treturn $this->role;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function role()\n {\n return $this->belongsTo(Role::class);\n }", "public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}", "public function role() {\n return $this->belongsTo('App\\Role');\n }", "public function testCreateRole()\n {\n }", "public function testCreateRole()\n {\n }", "public function __construct()\n {\n $this->authorizeResource(Role::class, 'roles');\n }", "public function __construct(Role $role)\n {\n $this->model = $role;\n }", "public function role()\n {\n return $this->hasMany('App\\Role', 'role_user');\n }", "public function create()\n\t{\n\t\t// $roles = Role::get();\n\t}", "public function role()\n {\n return $this->belongsTo('App\\Roles', 'role_id');\n }", "public static function get() {\n\t\t\tstatic $manager = null;\n\n\t\t\tif ( $manager === null ) {\n\t\t\t\tif ( function_exists( 'wpcom_vip_add_role' ) ) {\n\t\t\t\t\t$manager = RoleManagerVIP::get_instance();\n\t\t\t\t}\n\n\t\t\t\tif ( ! function_exists( 'wpcom_vip_add_role' ) ) {\n\t\t\t\t\t$manager = RoleManagerWP::get_instance();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $manager;\n\t\t}", "public function getForm()\n {\n return new RoleForm;\n }", "public function role(): RoleAttributeValue\n {\n return $this->firstOf(AttributeType::OID_ROLE)->first();\n }", "public function getRole() : string;", "public function builder()\n {\n return $this->_role;\n }", "public function builder()\n {\n return $this->_role;\n }", "public function getRole()\n {\n return $this->hasOne(ParticulerTypes::className(), ['ID' => 'RoleID']);\n }", "public function getAuthenticatedRole();", "public function GetUserRole()\n {\n return $this->role;\n }", "public function create()\n {\n $transaction = \\Yii::$app->db->beginTransaction();\n $this->role = \\Yii::$app->authManager->createRole($this->roleName);\n $this->role->description = $this->description;\n \\Yii::$app->authManager->add($this->role);\n\n foreach ($this->permissions as $permission) {\n \\Yii::$app->authManager->addChild($this->role, $permission);\n\n }\n\n $transaction->commit();\n\n return $this;\n }", "public function getEmpty() { \n return new RoleType();\n }", "public function __construct(Role $role)\n {\n $this->_role = $role;\n parent::__construct(true);\n }", "public function role()\n {\n return $this->belongsTo(Role::class, 'role_id', 'role_id');\n }", "public function model(): string\n {\n return Role::class;\n }", "function model()\n {\n return 'Modules\\User\\Contracts\\Role';\n }", "function roleCreate(Role $role);", "public function getRole() \n {\n return $this->_fields['Role']['FieldValue'];\n }", "public function role()\n {\n return $this->belongsTo(Role::class, 'role_id');\n }" ]
[ "0.77834207", "0.71343595", "0.70198596", "0.7002539", "0.7002539", "0.7002539", "0.7002539", "0.7002539", "0.6984974", "0.69798034", "0.69798034", "0.69757116", "0.6935079", "0.6877051", "0.68580973", "0.6836532", "0.6748584", "0.67075443", "0.6705221", "0.6689035", "0.6684583", "0.6681124", "0.6662023", "0.665484", "0.66217375", "0.660492", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.65978867", "0.6588806", "0.6563554", "0.6532939", "0.65009826", "0.6492968", "0.6481327", "0.6437936", "0.6403001", "0.6403001", "0.64014107", "0.6399903", "0.63912106", "0.6383546", "0.6380201", "0.6366712", "0.63606226", "0.63606226", "0.6357859", "0.63213396", "0.6315348", "0.6281413", "0.6281413", "0.6277595", "0.62752897", "0.626909", "0.62656814", "0.62648094", "0.62636507", "0.6261474", "0.6256904", "0.6256904", "0.6256904", "0.6256904", "0.6256904", "0.6256904", "0.6256904", "0.6256904", "0.6255074", "0.62386215", "0.62294877", "0.62294877", "0.6170109", "0.6166632", "0.61628926", "0.6139518", "0.6139494", "0.6136792", "0.6119994", "0.61198235", "0.6118259", "0.6113427", "0.6113427", "0.61127913", "0.6111594", "0.61078167", "0.6106554", "0.6102284", "0.6097257", "0.60797507", "0.6069863", "0.60682017", "0.6058244", "0.6052648", "0.604951" ]
0.8271709
0
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { switch ($this->route()->getActionMethod()) { case 'store': return [ 'tel' => [ 'required', 'max:16', Rule::notIn( EntrustThrowIn::whereBetween('created_at',[date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d'), date('Y'))),date('Y-m-d H:i:s', mktime(23, 59, 59, date('m'), date('d'), date('Y')))])->where('demand',$this->demand)->pluck('tel')->toArray() ) ], 'user_id' => 'nullable', 'name' => 'nullable|max:32', 'area_id' => 'nullable|exists:media.areas,id', 'area_name' => 'nullable', 'block_id' => 'nullable|exists:media.blocks,id', 'acreage' => 'nullable', 'building_name' => 'nullable|max:32', 'remark' => 'nullable', 'source' => 'required', 'page_source' => 'nullable', 'demand' => 'required', ]; case 'survey': return [ 'id' => 'required|exists:entrust_throw_ins,id', 'status' => 'required|max:512' ]; case 'addGd': return [ 'id' => 'required|exists:entrust_throw_ins,id', 'name' => 'required|max:32', 'tel' => 'required|max:16', 'source' => 'required', 'demand' => 'required', 'position' => 'nullable', 'acreage' => 'nullable', 'price' => 'nullable', 'shopkeeper_id' => 'nullable|exists:media.users,id', 'remark' => 'nullable', 'recorder' => 'required' ]; default; return [ ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Run the database seeds.
public function run() { $officeApp = new Image; $officeApp->file_path ='img/products/Office Application/MS OFFICE 365 PERSONAL 32-BITX64 1 YEAR SUBSCRIPTION.jpg'; $officeApp->product_id='219'; $officeApp->is_front = '1'; $officeApp->save(); $officeApp = new Image; $officeApp->file_path ='img/products/Office Application/MS OFFICE HOME AND BUSINESS 2016 FPP.jpg'; $officeApp->product_id='220'; $officeApp->is_front = '1'; $officeApp->save(); $officeApp = new Image; $officeApp->file_path ='img/products/Office Application/MS OFFICE HOME AND STUDENT 2016 MEDIALESS.jpg'; $officeApp->product_id='221'; $officeApp->is_front = '1'; $officeApp->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Tests file_link field metadata storage with extension.
public function testDeferredCheck() { $settings = Settings::getAll(); // Set up the fixtures. $settings['file_link_test_middleware'] = [ 'http://file_link.drupal/latentcy-test-file1.txt' => [ 'status' => 200, 'headers' => ['Content-Type' => 'text/plain', 'Content-Length' => 27], ], 'http://file_link.drupal/latentcy-test-file2.txt' => [ 'status' => 200, 'headers' => ['Content-Type' => 'text/plain', 'Content-Length' => 27], ], ]; new Settings($settings); /** @var \Drupal\entity_test\Entity\EntityTest $entity */ $entity = EntityTest::create(['name' => 'Foo', 'type' => 'article']); $entity->get('deferred_url')->set(0, ['uri' => 'http://file_link.drupal/latentcy-test-file1.txt']); $entity->get('deferred_url')->set(1, ['uri' => 'http://file_link.drupal/latentcy-test-file2.txt']); $entity->save(); static::assertEquals(1, file_link_test_entity_save_counter($entity)); static::assertEquals(NULL, $entity->get('deferred_url')->get(0)->getFormat()); static::assertEquals(0, $entity->get('deferred_url')->get(0)->getSize()); static::assertEquals(0, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file1.txt')); static::assertEquals(0, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file2.txt')); $this->container->get('cron')->run(); static::assertEquals(1, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file1.txt')); static::assertEquals(1, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file2.txt')); static::assertEquals(2, file_link_test_entity_save_counter($entity)); $entity = EntityTest::load($entity->id()); static::assertEquals('text/plain', $entity->get('deferred_url')->get(0)->getFormat()); static::assertEquals(27, $entity->get('deferred_url')->get(0)->getSize()); // Simulate a new request by resetting the static cache on FileLinkItem. $queued = new \ReflectionProperty(FileLinkItem::class, 'queued'); $queued->setAccessible(TRUE); $queued->setValue(NULL, []); // Update the entity by updating and adding values to the the field. $entity->get('deferred_url')->set(1, ['uri' => 'http://file_link.drupal/latentcy-test-file1.txt']); $entity->get('deferred_url')->set(2, ['uri' => 'http://file_link.drupal/latentcy-test-file2.txt']); $entity->save(); static::assertEquals(3, file_link_test_entity_save_counter($entity)); $entity = EntityTest::load($entity->id()); static::assertEquals('text/plain', $entity->get('deferred_url')->get(0)->getFormat()); static::assertEquals(27, $entity->get('deferred_url')->get(0)->getSize()); static::assertEquals(NULL, $entity->get('deferred_url')->get(1)->getFormat()); static::assertEquals(0, $entity->get('deferred_url')->get(1)->getSize()); $this->container->get('cron')->run(); static::assertEquals(2, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file1.txt')); static::assertEquals(2, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file2.txt')); // Make sure the entity was only saved once more and all fields are set. static::assertEquals(4, file_link_test_entity_save_counter($entity)); static::assertEquals('text/plain', $entity->get('deferred_url')->get(0)->getFormat()); static::assertEquals(27, $entity->get('deferred_url')->get(0)->getSize()); static::assertEquals('text/plain', $entity->get('deferred_url')->get(1)->getFormat()); static::assertEquals(27, $entity->get('deferred_url')->get(1)->getSize()); static::assertEquals('text/plain', $entity->get('deferred_url')->get(2)->getFormat()); static::assertEquals(27, $entity->get('deferred_url')->get(2)->getSize()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExtensionReturnsExtension()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertSame('txt', Storage::extension(self::$temp.DS.'foo.txt'));\n }", "public function testAddFieldVisualisationFile() {\n $new_field_label = 'Testing visualisation file field';\n $new_field_name = 'testing_vis_file_field';\n $storage_type = 'dvf_file';\n\n $this->addNewFieldToPage($new_field_label, $new_field_name, $storage_type);\n }", "abstract protected function getFileExtension();", "function appendProperExt($link, $file_name){\n\tif(isset($link['type'])){\n\t\tif(stripos($link['type'], \"/mp4\") == false){\n\t\t\t$ext = \"mp4\";\n\t\t}\n\t\telse if(stripos($link['type'], \"/webm\") == false){\n\t\t\t$ext = \"webm\";\n\t\t}\n\t\telse if(stripos($link['type'], \"/x-flv\") == false){\n\t\t\t$ext = \"flv\";\n\t\t}\n\t\telse if(stripos($link['type'], \"video/3gpp\") == false){\n\t\t\t$ext = \"3gp\";\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\n\t\t$new_file = $file_name.\".\".$ext;\n\t\t\n\t\trename($file_name, $new_file);\n\t\treturn $new_file;\n\t}\n}", "public function testCheckExtensionNotAllowedDefault() {\n $this->assertFalse($this->dl->checkExtension('jpg'));\n }", "public function testAddReplenishmentFileByURL()\n {\n }", "public function testFileRefs() {}", "public function getExtendedType()\n {\n return 'file';\n }", "function fs_is_link($filename) {\n\treturn @is_link($filename);\n}", "function getTargetFileExtension() ;", "public function setExtension($ext);", "static function importMetadata() {\n\t\t\n\t\tself::$file_to_file_map = array();\n\t\t\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/image.php' );\n\t\t\n\t\techo_now( 'Importing metadata...' );\n\t\t\n\t\tself::$files_upload_path = wp_upload_dir();\n\t\t$searched_fields = array();\n\t\t\n\t\t# Add content field meta values as postmeta\n\t\t\n\t\tif( isset( drupal()->content_node_field_instance ) )\n\t\t\t$field_instance_table = 'content_node_field_instance';\n\t\telse if( isset( drupal()->field_config_instance ) )\n\t\t\t$field_instance_table = 'field_config_instance';\n\t\t\n\t\t$nid_field = 'nid';\n\t\t$vid_field = 'vid';\n\t\t\n\t\t$meta_fields = drupal()->$field_instance_table->getRecords();\n\t\t\n\t\tforeach( $meta_fields as $meta_field ) {\n\t\t\t\n\t\t\t// There are two ways of storing metadata -- simply (in the content_type_[node content type] table)\n\t\t\t// and richly (in the content_[field name] table)\n\t\t\t\n\t\t\t$table_name = 'content_' . $meta_field['field_name'];\n\t\t\t\n\t\t\tif( in_array( $meta_field['field_name'], $searched_fields ) )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t# D7 compatibility\n\t\t\tif( ! array_key_exists( 'type_name', $meta_field ) )\n\t\t\t\t$meta_field['type_name'] = $meta_field['entity_type'];\n\t\t\t\n\t\t\t# D7 compatibility\n\t\t\tif( ! isset( drupal()->$table_name ) ) {\n\t\t\t\t$table_name = 'field_revision_' . $meta_field['field_name'];\n\t\t\t}\n\t\t\t\n\t\t\t# D7 compatibility\n\t\t\tself::$files_table_name = 'files';\n\t\t\tif( ! isset( drupal()->{self::$files_table_name} ) ) {\n\t\t\t\tself::$files_table_name = 'file_managed';\n\t\t\t\t$nid_field = 'entity_id';\n\t\t\t\t$vid_field = 'revision_id';\n\t\t\t\t\n\t\t\t\tself::$files_public_path = trailingslashit( \n\t\t\t\t\t\tunserialize(\n\t\t\t\t\t\tdrupal()->variable->value->getValue(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => 'file_public_path'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n//\t\t\techo_now( 'Searching: ' . $table_name );\n\t\t\t\n\t\t\tif( isset( drupal()->$table_name ) ) {\n\t\t\t\t\n\t\t\t\t// Found a content_field_name table -- add post meta from its columns\n//\t\t\t\techo 'Table - search content table: ' . $table_name . ' for fields' . \"<br>\\n\";\n\t\t\t\t\n\t\t\t\t$meta_records = drupal()->$table_name->getRecords();\n\t\t\t\t\n\t\t\t\tforeach( $meta_records as $meta_record ) {\n\t\t\t\t\t\n\t\t\t\t\t// Import all columns beginning with field_name\n\t\t\t\t\t\n\t\t\t\t\tif( ! array_key_exists( $meta_record[$nid_field], self::$node_to_post_map ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif( $meta_record[$vid_field] != self::$node_to_rev_map[ $meta_record[$nid_field] ] )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tforeach( $meta_record as $column => $value ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( empty( $value ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( 0 !== strpos( $column, $meta_field['field_name'] ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( strpos( $column, '_fid' ) ) {\n\n\t\t\t\t\t\t\t$value = self::importAttachedFile(\n\t\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record[$nid_field] ],\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'file_id' => (int)$value\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tadd_post_meta(\n\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t'_drupal_source',\n\t\t\t\t\t\t\t\t$column\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( array_key_exists( str_replace( '_fid', '_data', $column ), $meta_record ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$details = maybe_unserialize( $meta_record[ str_replace( '_fid', '_data', $column ) ] );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( isset( $details['title'] ) ) {\n\t\t\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'ID' => $value,\n\t\t\t\t\t\t\t\t\t\t\t'post_excerpt' => $details['title']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif( isset( $details['alt'] ) ) {\n\t\t\t\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t\t'_wp_attachment_image_alt',\n\t\t\t\t\t\t\t\t\t\t$details['alt']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tadd_post_meta(\n\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record[$nid_field] ],\n\t\t\t\t\t\t\t'_drupal_' . $column,\n\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$searched_fields[] = $column;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t} else {\n\n\t\t\t\t// Search the content_type_[content type] table for this value\n\t\t\t\t$table_name = 'content_type_' . $meta_field['type_name'];\n\t\t\t\tif( ! isset( drupal()->$table_name ) )\n\t\t\t\t\t$table_name = 'field_revision_' . $meta_field['type_name'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( isset( drupal()->$table_name ) ) {\n\t\t\t\t\t$meta_records = drupal()->$table_name->getRecords();\n\t\t\t\t\t\n\t\t\t\t\tforeach( $meta_records as $meta_record ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Import all columns beginning with field_name\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( ! array_key_exists( $meta_record['nid'], self::$node_to_post_map ) )\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif( $meta_record[$vid_field] != self::$node_to_rev_map[ $meta_record[$nid_field] ] )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t//\t\t\t\t\techo 'Adding metadata for: ' . self::$node_to_post_map[ $meta_record['nid'] ] . ' - ' . $meta_record[ $value_column ] . \"<br>\\n\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach( $meta_record as $column => $value ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( empty( $value ) )\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( 0 !== strpos( $column, $meta_field['field_name'] ) )\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( strpos( $column, '_fid' ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$value = self::importAttachedFile(\n\t\t\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record[$nid_field] ],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'file_id' => (int)$value\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tadd_post_meta(\n\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t'_drupal_source',\n\t\t\t\t\t\t\t\t\t$column\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( array_key_exists( str_replace( '_fid', '_data', $column ), $meta_record ) ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$details = maybe_unserialize( $meta_record[ str_replace( '_fid', '_data', $column ) ] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif( isset( $details['title'] ) ) {\n\t\t\t\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'ID' => $value,\n\t\t\t\t\t\t\t\t\t\t\t\t'post_excerpt' => $details['title']\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif( isset( $details['alt'] ) ) {\n\t\t\t\t\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t\t\t'_wp_attachment_image_alt',\n\t\t\t\t\t\t\t\t\t\t\t$details['alt']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record['nid'] ],\n\t\t\t\t\t\t\t\t'_drupal_' . $column,\n\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t} // End if isset table\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$searched_fields[] = $meta_field['field_name'];\n\t\t\t\t\n\t\t}\n\t\t\n\t\t// Search for table named for the node type\n\t\t$types = drupal()->node->type->getUniqueValues();\n\t\t\n\t\tforeach( $types as $type ) {\n\t\t\t\n\t\t\tif( isset( drupal()->$type ) ) {\n\t\t\t\t\n\t\t\t\t$type_records = drupal()->$type->getRecords();\n\t\t\t\tforeach( $type_records as $type_record ) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( ! array_key_exists( $type_record['nid'], self::$node_to_post_map ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tforeach( $type_record as $column => $value ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( empty( $value ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\tself::$node_to_post_map[ $type_record['nid'] ],\n\t\t\t\t\t\t\t'_drupal_' . $column,\n\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Check for uploaded files\n\t\t\n\t\tif( isset( drupal()->upload ) ) {\n\t\t\t\n\t\t\t$uploads = drupal()->getRecords(\n\t\t\t\tdrupal()->query(\n\t\t\t\t\t'SELECT * FROM upload u\n\t\t\t\t\t\tWHERE (nid, vid) IN\n\t\t\t\t\t\t(SELECT nid, MAX(vid) FROM upload GROUP BY nid)'\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tforeach( $uploads as $upload ) {\n\t\t\t\t\n\t\t\t\t$node = drupal()->node->getRecord(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'nid' => $upload['nid']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif( apply_filters( 'import_node_skip_node', false, $node ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tif( ! array_key_exists( $upload['nid'], self::$node_to_post_map ) )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Skip records with fid = 0\n\t\t\t\tif( 0 == $upload['fid'] )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t$value = self::importAttachedFile(\n\t\t\t\t\tself::$node_to_post_map[ $upload['nid'] ],\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'file_id' => (int)$upload['fid']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tadd_post_meta(\n\t\t\t\t\t$value,\n\t\t\t\t\t'_drupal_source',\n\t\t\t\t\t'upload'\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tadd_post_meta(\n\t\t\t\t\t$value,\n\t\t\t\t\t'_drupal_list_upload',\n\t\t\t\t\t(int)$upload['list']\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tdo_action( 'imported_metadata' );\n\t\t\n\t}", "public function testAddItemSubCategoryFileByURL()\n {\n }", "static public function configureFileField() {}", "public function testAddExternalShipmentFileByURL()\n {\n }", "public function getFileExtension();", "public function testAddLowStockFileByURL()\n {\n }", "function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }", "public function getTargetFileExtension() {}", "public function getTargetFileExtension() {}", "function G3Client_PluginMetaLinks($links, $file){\n if($file == plugin_basename(__FILE__)) {\n\n }\n\n return $links;\n}", "public function testAddOrderFileByURL()\n {\n }", "function getExtension() ;", "public function getExtension() : string;", "public static function update_metadata($id, $filename = false, $link = false,\n $backref = false, $created_on = false,\n $created_by = false, $deleted = false)\n {\n $fields = [];\n $values = [];\n if (false !== $filename) {\n $fields[] = 'filename=%s';\n $values[] = $filename;\n }\n if (false !== $backref) {\n $fields[] = 'backref=%s';\n $values[] = $backref;\n }\n if (false !== $created_on) {\n $fields[] = 'created_on=%T';\n $values[] = $created_on;\n }\n if (false !== $created_by) {\n $fields[] = 'created_by=%d';\n $values[] = $created_by;\n }\n if (false !== $deleted) {\n $fields[] = 'deleted=%d';\n $values[] = $deleted;\n }\n if (!empty($fields)) {\n $fields = implode(',', $fields);\n $values[] = $id;\n DB::Execute(\"UPDATE utils_filestorage SET $fields WHERE id=%d\", $values);\n }\n if (false !== $link) {\n self::add_link($link, $id);\n }\n }", "public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}", "public function testFileValue() : void {\n\t\t$this->assertEquals('kc_file', PostType::File->value);\n\t}", "abstract function getExtension(): string;", "protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }", "public function hasExtension($name);", "public function testLargeAttribute() {\n $file = new Mock\\File();\n $file->data = file_get_contents('../src/ORM_Model.php');\n $file->name = 'ORM_Model.php';\n\n $this->assertTrue( $file->save(), \"Unable to save File\" );\n\n $storedFile = Mock\\File::Find( $file->id() );\n $this->assertEquals( $file->data, $storedFile->data );\n }", "public function testGetAttribute_lstat_Calculated()\n {\n \t$stat = lstat($this->file);\n \t\n $this->assertEquals(is_link($this->file) ? 'link' : filetype($this->file), $this->Fs_Node->getAttribute('type', Fs::NO_DEREFERENCE), 'type');\n $this->assertEquals(Fs::mode2perms($stat['mode']), $this->Fs_Node->getAttribute('perms', Fs::NO_DEREFERENCE), 'perms');\n }", "function TESTMETA($path, $TESTexif, $TESTiptc) {\n\t\t$files = scandir($path);\n\t\tforeach($files as $file) {\n\t\t\tif(strlen($file) >= 3) {\n\n\t\t\t\tif($TESTiptc) {\n\t\t\t\t\tprint_r(\"FILENAME IS: \" . $file . \"<br>\");\n\t\t\t\t\tgetMeta($path . $file);\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t} elseif ($TESTexif) {\n\t\t\t\t\tprint_r(\"FILENAME IS: \" . $file . \"<br>\");\n\t\t\t\t\tgetEXIF($path . $file);\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function phptemplate_filefield_file($file) {\n if (empty($file['fid'])) {\n return '';\n }\n\n $path = $file['filepath'];\n $url = file_create_url($path);\n $icon = theme('filefield_icon', $file);\n\n // Set options as per anchor format described at\n $options = array(\n 'attributes' => array(\n 'type' => $file['filemime'] . '; length=' . $file['filesize'],\n ),\n );\n\n // Use the description as the link text if available.\n if (empty($file['data']['description'])) {\n $link_text = $file['filename'];\n }\n else {\n $link_text = $file['data']['description'];\n $options['attributes']['title'] = $file['filename'];\n }\n\n //open files of particular mime types in new window\n $new_window_mimetypes = array(\n 'application/pdf',\n 'text/plain'\n );\n if (in_array($file['filemime'], $new_window_mimetypes)) {\n $options['attributes']['target'] = '_blank';\n }\n\n return '<div class=\"filefield-file clear-block\">'. $icon . l($link_text, $url, $options) .'</div>';\n}", "function file_display_url(File $file, $format = 'fullsize')\n{\n if (!$file->exists()) {\n return false;\n }\n return $file->getWebPath($format);\n}", "public abstract function getExtension();", "function link_to_file_show($attributes = array(), $text = null, $file = null)\n{\n if (!$file) {\n $file = get_current_record('file');\n }\n if (!$text) {\n $text = metadata($file, 'display_title');\n }\n return link_to($file, 'show', $text, $attributes);\n}", "public function getExtension() {}", "public function getExtension() {}", "public function getFileExtension($format);", "public function testWithFileFields()\n {\n $config = array(\n 'subject_field' => array('description'),\n 'fields' => array ('origin' => 'From','destination' => 'To','price' => 'Miles')\n );\n $record = array(\n 'From'=>'Singapore',\n 'To'=>'London',\n 'Miles'=>'12000',\n 'description' => 'Flight From %origin% To %destination% for %price% miles'\n );\n\n $node_replace = new \\Giift\\Etl\\Transformer\\Replace($config);\n $node_replace->addOutput($this->node_loader);\n\n $node_replace->processRecord($record);\n\n $rs = $this->node_loader->getResult();\n\n $this->assertNotNull($rs);\n $this->assertNotEmpty($rs);\n foreach ($rs as $result) {\n $this->assertArrayHasKey('From', $result);\n $this->assertArrayHasKey('Miles', $result);\n $this->assertEquals(\"Flight From Singapore To London for 12000 miles\", $result['description']);\n }\n }", "abstract public function getFileMetadata(FileData $fileData);", "abstract public function getExtensionName();", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "function fileExtension($nameFile) {\n\t$format = substr($nameFile, -4);\n\treturn ($format == \".pat\");\n}", "public function addExtension(string $extension);", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "public function getLocalExtListFile() {}", "public function testGetFunctionsFromExtension()\n {\n if (is_null($this->ref)) {\n return;\n }\n\n foreach ($this->ref['extensions'] as $extname => $opt) {\n $ext = get_extension_funcs($extname);\n if (!is_array($ext)) {\n // At least, for sqlite3 (PHP Bug ?)\n continue;\n }\n\n foreach ($ext as $fctname) {\n if (!in_array($fctname, $this->ignoredfunctions)) {\n $this->assertArrayHasKey(\n $fctname,\n $this->ref['functions'],\n \"Defined function '$fctname' not known in Reference.\"\n );\n }\n }\n }\n }", "public function testTypeIdentifiesStorage()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertSame('file', Storage::type(self::$temp.DS.'foo.txt'));\n }", "function dl(string $extension_filename): void\n{\n error_clear_last();\n $safeResult = \\dl($extension_filename);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n}", "private function detectExtension()\n {\n $arr = explode('.', $this->file['name']);\n $this->file['extension'] = end($arr);\n }", "function is_valid_file_extension($value, $set){\n if (in_array($value, $set)) {\n return true;\n }\n}", "abstract public function acceptedExtension(): string;", "public function canGetExtensionKey() {\n\t\t$provider = $this->getConfigurationProviderInstance();\n\t\t$record = $this->getBasicRecord();\n\t\t$extensionKey = $provider->getExtensionKey($record);\n\t\t$this->assertNull($extensionKey);\n\t}", "function is_external_file($file) {\n\n $allowed = array('jpeg', 'png', 'bmp', 'gif', 'pdf', 'jpg', 'doc', 'docx');\n\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n\n if (in_array(strtolower($ext), $allowed)) {\n return true;\n }\n\n return false;\n}", "protected function isFile() {}", "function files_for_item($options = array(), $wrapperAttributes = array('class' => 'item-file'), $item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n if (!isset($options['linkToMetadata'])) {\n $options['linkToMetadata'] = (bool) get_option('link_to_file_metadata');\n }\n $options['filesForItem'] = true;\n $html = file_markup($item->Files, $options, $wrapperAttributes);\n return apply_filters('files_for_item', $html, compact('item', 'options', 'wrapperAttributes'));\n}", "protected function determineTargetFileExtension() {}", "function ft_hook_fileextras($file, $dir) {}", "public function testShouldGetFileInfo() {\n\t\t$this->assertEquals(\n\t\t\t$this->_testFilesId[0],\n\t\t\t$this->_Files->run(['ids' => $this->_testFilesId])[0]['id']\n\t\t);\n\t}", "private function processLink($link) {\n if ($id = $this->evalFileToSave($link)) {\n $this->file->add($id, $link);\n return $id;\n }\n return FALSE;\n }", "function verifyExternalLink(){\n $this->type(BUTTON_PREVIEW, \"\");\n $this->click(LINK_ADDLINK);\n $this->type(TEXT_LINKNAME, WIKI_EXTERNAL_LINK);\n try {\n $this->assertTrue($this->isElementPresent(ICON_PAGEEXTERNAL));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n $this->assertEquals(\"on\", $this->getValue(OPT_EXTERNAL));\n $this->click(BUTTON_INSERTLINK);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((WIKI_EXTERNAL_LINK), $this->getText(LINK_START.(WIKI_EXTERNAL_LINK)));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n $this->click(LINK_START.(WIKI_EXTERNAL_LINK));\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((WIKI_EXTERNAL_LINK_TITLE), $this->getTitle());\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "public function testCreateAttachment()\n {\n }", "public function testMustProvideValidExtension()\n {\n $response = $this->actingAs($this->user)->json('POST', '/avatar', [\n 'avatar' => UploadedFile::fake()->image('avatar.random')\n ]);\n\n $response->assertStatus(422);\n }", "function createFilesMetaData($file)\n\t{\n\t $filetype = '';\n\t $format = self::isKnownMimeType($file, $filetype);\n\t $transferServer = new BizTransferServer();\n\t $files = array();\n\t \n\t $attachment = new Attachment();\n\t $attachment->Rendition = 'native';\n\t $attachment->Type = $format; // mime file type, for this demo assumed to always be jpg\n\t $transferServer->copyToFileTransferServer($file, $attachment);\n\t $files[] = $attachment;\n\t \n\t return $files;\n\t}", "public function testSetAllowedExtensionsFail() {\n $dl2 = new downloader();\n $dl2->setAllowedExtensions(array('jpg' => 'image/jpeg',\n 'pl' => 'application/x-perl'));\n $this->assertTrue($dl2->areErrors());\n\n // one invalid extension will invalidate the entire list\n $this->assertFalse($dl2->checkExtension('jpg'));\n $this->assertFalse($dl2->checkExtension('jpeg'));\n $this->assertFalse($dl2->checkExtension('pl'));\n }", "public function setFileLinkFormat($format)\n {\n $old = $this->fileLinkFormat;\n $this->fileLinkFormat = $format;\n\n return $old;\n }", "public function testGetAttachmentContent()\n {\n }", "public function testFileSettings() {\n $config = $this->config('file.settings');\n $this->assertSame('textfield', $config->get('description.type'));\n $this->assertSame(128, $config->get('description.length'));\n $this->assertSame('sites/default/files/icons', $config->get('icon.directory'));\n $this->assertConfigSchema(\\Drupal::service('config.typed'), 'file.settings', $config->get());\n }", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}", "public function testGetAttachment()\n {\n }", "public function fileDenyPatternMatchesPhpExtensionDataProvider() {}", "public function testAddPackingPlanFileByURL()\n {\n }", "protected function createFakeExtension() {}", "function PMA_istableFieldBlob($field)\n{\n // If check to ensure types such as \"enum('one','two','blob',..)\" or\n // \"enum('one','two','tinyblob',..)\" etc. are not categorized as blob.\n if (stripos($field['Type'], 'blob') === 0\n || stripos($field['Type'], 'tinyblob') === 0\n || stripos($field['Type'], 'mediumblob') === 0\n || stripos($field['Type'], 'longblob') === 0\n ) {\n return stristr($field['Type'], 'blob');\n } else {\n return false;\n }\n}", "function fn_filter_instant_upload($filter_by_ext = array())\n{\n if (!empty($_FILES['upload'])) {\n $_FILES['upload']['path'] = $_FILES['upload']['tmp_name'];\n $uploaded_data = fn_get_local_data(Bootstrap::stripSlashes($_FILES['upload']));\n if (fn_check_uploaded_data($uploaded_data, $filter_by_ext)) {\n return $uploaded_data;\n }\n }\n\n return false;\n}", "function ui_description() {\n return t('Extend Linkit with file support (Managed files).');\n }", "public function checkExt($f) {\r\n $ext = pathinfo($f, PATHINFO_EXTENSION);\r\n return $ext;\r\n }", "public function getClientOriginalExtension();", "function acf_get_external_path($file, $path = '')\n{\n}", "protected function analyzeExtensionTables() {}", "public function testPhpExtensionsAreValid()\n {\n $this->assert->php->extensions\n ->isLoaded('simplexml')\n ->isLoaded('fileinfo')\n ->isLoaded('xsl');\n // validate that fileinfo is loaded and configured properly\n $this->assert->php->extensions->fileinfo->isAlive();\n }", "protected function initializeExtensionFiles() {}", "private function _checkExt($field)\n {\n if ( ! empty($field)) {\n $ext = $field->getClientOriginalExtension();\n $allowed = Config::get('filer.allowed_file_ext');\n\n foreach ($allowed as $type => $ext_arr) {\n if (in_array(strtolower($ext), $ext_arr)) {\n $this->_type\t\t= $type;\n $this->_ext\t\t\t= implode('|', $ext_arr);\n $this->_filename\t= str_random(30);\n\n break;\n }\n }\n\n if ( ! $this->_ext) {\n return $this->result(false, trans('files.invalid_extension'), $field->getClientOriginalName());\n }\n } else {\n return $this->result(false, trans('files.upload_error'));\n }\n\n return $this->result(true);\n }", "protected static function checkFileinfoExtension()\n {\n // Make sure that the \"fileinfo\" extension is loaded/enabled\n if (!extension_loaded('fileinfo')) {\n throw new RuntimeException('Required \"fileinfo\" extension not loaded');\n }\n }", "public function testSaveFiles()\n {\n $jsonData = '{\n \"links\": [\n {\n \"$ref\": \"http://localhost/testcase/readonly/101\",\n \"type\": \"owner\"\n },\n {\n \"$ref\": \"http://localhost/testcase/readonly/102\",\n \"type\": \"module\"\n }\n ],\n \"metadata\": {\n \"action\":[{\"command\":\"print\"},{\"command\":\"archive\"}]\n }\n }';\n\n $uploadedFile = $this->getUploadFile('test.txt');\n $client = $this->createClient();\n $client->request(\n 'POST',\n '/file',\n [\n 'metadata' => $jsonData,\n ],\n [\n 'upload' => $uploadedFile,\n ]\n );\n $response = $client->getResponse();\n $location = $response->headers->get('location');\n\n $this->assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n $this->assertStringContainsString('/file/', $location);\n\n // receive generated file information\n $client = $this->createClient();\n $client->request('GET', $location, [], [], ['HTTP_ACCEPT' => 'application/json']);\n\n $response = $client->getResponse();\n $contentArray = json_decode($response->getContent(), true);\n\n $this->assertEquals([[\"command\" => \"print\"], [\"command\" => \"archive\"]], $contentArray['metadata']['action']);\n $this->assertJsonStringEqualsJsonString(\n '[\n {\n \"$ref\": \"http://localhost/testcase/readonly/101\",\n \"type\": \"owner\"\n },\n {\n \"$ref\": \"http://localhost/testcase/readonly/102\",\n \"type\": \"module\"\n }\n ]',\n json_encode($contentArray['links'])\n );\n\n // Check contain data\n $this->assertArrayHasKey('modificationDate', $contentArray['metadata']);\n $this->assertArrayHasKey('createDate', $contentArray['metadata']);\n\n // Test Metadata, and Remove date.\n unset($contentArray['metadata']['modificationDate']);\n unset($contentArray['metadata']['createDate']);\n\n $this->assertJsonStringEqualsJsonString(\n '{\n \"size\":16,\n \"action\":[\n {\"command\":\"print\"},\n {\"command\":\"archive\"}\n ],\n \"mime\":\"text\\/plain\",\n \"filename\":\"test.txt\",\n \"hash\":\"4f3cbec0e58903d8bdcbd03d283cf43ed49a95d8d8b341ee38c0ba085204e2d5\",\n \"additionalProperties\":[]\n }',\n json_encode($contentArray['metadata'])\n );\n\n // clean up\n $client = $this->createClient();\n $client->request(\n 'DELETE',\n $location\n );\n }", "public function guessExtension();", "function pmpromd_plugin_row_meta($links, $file) {\r\n\tif(strpos($file, 'pmpro-member-directory.php') !== false)\r\n\t{\r\n\t\t$new_links = array(\r\n\t\t\t'<a href=\"' . esc_url('https://www.paidmembershipspro.com/add-ons/pmpro-member-directory/') . '\" title=\"' . esc_attr( __( 'View Documentation', 'pmpro' ) ) . '\">' . __( 'Docs', 'pmpro' ) . '</a>',\r\n\t\t\t'<a href=\"' . esc_url('https://www.paidmembershipspro.com/support/') . '\" title=\"' . esc_attr( __( 'Visit Customer Support Forum', 'pmpro' ) ) . '\">' . __( 'Support', 'pmpro' ) . '</a>',\r\n\t\t);\r\n\t\t$links = array_merge($links, $new_links);\r\n\t}\r\n\treturn $links;\r\n}", "public function getExtensionName() {}", "public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }", "public function test_listUnsupportedFileTypes() {\n\n }", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }" ]
[ "0.6041335", "0.5783697", "0.5769219", "0.5703821", "0.5584675", "0.5538111", "0.5528048", "0.549769", "0.5461188", "0.5443181", "0.5379179", "0.53302604", "0.53252846", "0.53247774", "0.5289768", "0.52819514", "0.52806014", "0.5278683", "0.5240148", "0.52401465", "0.5236624", "0.5211641", "0.52069867", "0.52002895", "0.5199376", "0.5195062", "0.5186672", "0.5177991", "0.5170457", "0.5168742", "0.5152689", "0.51468104", "0.5138359", "0.51225144", "0.5122128", "0.51206636", "0.5115778", "0.5096269", "0.50953406", "0.50929844", "0.50775594", "0.50700974", "0.5065787", "0.5051386", "0.5051386", "0.5051386", "0.5048412", "0.5030616", "0.50226873", "0.49869436", "0.49865788", "0.49837038", "0.49818525", "0.49755767", "0.4969431", "0.49642316", "0.49637944", "0.4963506", "0.49603528", "0.49532285", "0.4945505", "0.49338228", "0.4931657", "0.49302378", "0.49236053", "0.49204996", "0.49153662", "0.49076408", "0.49059922", "0.49057803", "0.49026123", "0.48915064", "0.4889779", "0.4880143", "0.4880143", "0.4880143", "0.48790887", "0.48781008", "0.48696715", "0.48541912", "0.48416114", "0.48414236", "0.4835359", "0.48351067", "0.48324078", "0.48255903", "0.4823796", "0.48174107", "0.48162428", "0.4811606", "0.48071218", "0.4805272", "0.47957537", "0.47926137", "0.47908", "0.47892135", "0.47814527", "0.47774306", "0.4772546", "0.47714522", "0.47686407" ]
0.0
-1
Tests file_link field metadata storage with extension.
public function testDeletedEntity() { $settings = Settings::getAll(); // Set up the fixtures. $settings['file_link_test_middleware'] = [ 'http://file_link.drupal/latentcy-test-file.txt' => [ 'status' => 200, 'headers' => ['Content-Type' => 'text/plain', 'Content-Length' => 27], ], ]; new Settings($settings); /** @var \Drupal\entity_test\Entity\EntityTest $entity */ $entity = EntityTest::create(['name' => 'Foo', 'type' => 'article']); $entity->get('deferred_url')->set(0, ['uri' => 'http://file_link.drupal/latentcy-test-file.txt']); $entity->save(); static::assertEquals(1, file_link_test_entity_save_counter($entity)); static::assertEquals(NULL, $entity->get('deferred_url')->get(0)->getFormat()); static::assertEquals(0, $entity->get('deferred_url')->get(0)->getSize()); static::assertEquals(0, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file.txt')); $entity->delete(); $this->container->get('cron')->run(); static::assertEquals(0, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file.txt')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExtensionReturnsExtension()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertSame('txt', Storage::extension(self::$temp.DS.'foo.txt'));\n }", "public function testAddFieldVisualisationFile() {\n $new_field_label = 'Testing visualisation file field';\n $new_field_name = 'testing_vis_file_field';\n $storage_type = 'dvf_file';\n\n $this->addNewFieldToPage($new_field_label, $new_field_name, $storage_type);\n }", "abstract protected function getFileExtension();", "function appendProperExt($link, $file_name){\n\tif(isset($link['type'])){\n\t\tif(stripos($link['type'], \"/mp4\") == false){\n\t\t\t$ext = \"mp4\";\n\t\t}\n\t\telse if(stripos($link['type'], \"/webm\") == false){\n\t\t\t$ext = \"webm\";\n\t\t}\n\t\telse if(stripos($link['type'], \"/x-flv\") == false){\n\t\t\t$ext = \"flv\";\n\t\t}\n\t\telse if(stripos($link['type'], \"video/3gpp\") == false){\n\t\t\t$ext = \"3gp\";\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\n\t\t$new_file = $file_name.\".\".$ext;\n\t\t\n\t\trename($file_name, $new_file);\n\t\treturn $new_file;\n\t}\n}", "public function testCheckExtensionNotAllowedDefault() {\n $this->assertFalse($this->dl->checkExtension('jpg'));\n }", "public function testAddReplenishmentFileByURL()\n {\n }", "public function testFileRefs() {}", "public function getExtendedType()\n {\n return 'file';\n }", "function fs_is_link($filename) {\n\treturn @is_link($filename);\n}", "function getTargetFileExtension() ;", "public function setExtension($ext);", "static function importMetadata() {\n\t\t\n\t\tself::$file_to_file_map = array();\n\t\t\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/image.php' );\n\t\t\n\t\techo_now( 'Importing metadata...' );\n\t\t\n\t\tself::$files_upload_path = wp_upload_dir();\n\t\t$searched_fields = array();\n\t\t\n\t\t# Add content field meta values as postmeta\n\t\t\n\t\tif( isset( drupal()->content_node_field_instance ) )\n\t\t\t$field_instance_table = 'content_node_field_instance';\n\t\telse if( isset( drupal()->field_config_instance ) )\n\t\t\t$field_instance_table = 'field_config_instance';\n\t\t\n\t\t$nid_field = 'nid';\n\t\t$vid_field = 'vid';\n\t\t\n\t\t$meta_fields = drupal()->$field_instance_table->getRecords();\n\t\t\n\t\tforeach( $meta_fields as $meta_field ) {\n\t\t\t\n\t\t\t// There are two ways of storing metadata -- simply (in the content_type_[node content type] table)\n\t\t\t// and richly (in the content_[field name] table)\n\t\t\t\n\t\t\t$table_name = 'content_' . $meta_field['field_name'];\n\t\t\t\n\t\t\tif( in_array( $meta_field['field_name'], $searched_fields ) )\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t# D7 compatibility\n\t\t\tif( ! array_key_exists( 'type_name', $meta_field ) )\n\t\t\t\t$meta_field['type_name'] = $meta_field['entity_type'];\n\t\t\t\n\t\t\t# D7 compatibility\n\t\t\tif( ! isset( drupal()->$table_name ) ) {\n\t\t\t\t$table_name = 'field_revision_' . $meta_field['field_name'];\n\t\t\t}\n\t\t\t\n\t\t\t# D7 compatibility\n\t\t\tself::$files_table_name = 'files';\n\t\t\tif( ! isset( drupal()->{self::$files_table_name} ) ) {\n\t\t\t\tself::$files_table_name = 'file_managed';\n\t\t\t\t$nid_field = 'entity_id';\n\t\t\t\t$vid_field = 'revision_id';\n\t\t\t\t\n\t\t\t\tself::$files_public_path = trailingslashit( \n\t\t\t\t\t\tunserialize(\n\t\t\t\t\t\tdrupal()->variable->value->getValue(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => 'file_public_path'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n//\t\t\techo_now( 'Searching: ' . $table_name );\n\t\t\t\n\t\t\tif( isset( drupal()->$table_name ) ) {\n\t\t\t\t\n\t\t\t\t// Found a content_field_name table -- add post meta from its columns\n//\t\t\t\techo 'Table - search content table: ' . $table_name . ' for fields' . \"<br>\\n\";\n\t\t\t\t\n\t\t\t\t$meta_records = drupal()->$table_name->getRecords();\n\t\t\t\t\n\t\t\t\tforeach( $meta_records as $meta_record ) {\n\t\t\t\t\t\n\t\t\t\t\t// Import all columns beginning with field_name\n\t\t\t\t\t\n\t\t\t\t\tif( ! array_key_exists( $meta_record[$nid_field], self::$node_to_post_map ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif( $meta_record[$vid_field] != self::$node_to_rev_map[ $meta_record[$nid_field] ] )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tforeach( $meta_record as $column => $value ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( empty( $value ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( 0 !== strpos( $column, $meta_field['field_name'] ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( strpos( $column, '_fid' ) ) {\n\n\t\t\t\t\t\t\t$value = self::importAttachedFile(\n\t\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record[$nid_field] ],\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'file_id' => (int)$value\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tadd_post_meta(\n\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t'_drupal_source',\n\t\t\t\t\t\t\t\t$column\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( array_key_exists( str_replace( '_fid', '_data', $column ), $meta_record ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$details = maybe_unserialize( $meta_record[ str_replace( '_fid', '_data', $column ) ] );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( isset( $details['title'] ) ) {\n\t\t\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'ID' => $value,\n\t\t\t\t\t\t\t\t\t\t\t'post_excerpt' => $details['title']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif( isset( $details['alt'] ) ) {\n\t\t\t\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t\t'_wp_attachment_image_alt',\n\t\t\t\t\t\t\t\t\t\t$details['alt']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tadd_post_meta(\n\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record[$nid_field] ],\n\t\t\t\t\t\t\t'_drupal_' . $column,\n\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$searched_fields[] = $column;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t} else {\n\n\t\t\t\t// Search the content_type_[content type] table for this value\n\t\t\t\t$table_name = 'content_type_' . $meta_field['type_name'];\n\t\t\t\tif( ! isset( drupal()->$table_name ) )\n\t\t\t\t\t$table_name = 'field_revision_' . $meta_field['type_name'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( isset( drupal()->$table_name ) ) {\n\t\t\t\t\t$meta_records = drupal()->$table_name->getRecords();\n\t\t\t\t\t\n\t\t\t\t\tforeach( $meta_records as $meta_record ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Import all columns beginning with field_name\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( ! array_key_exists( $meta_record['nid'], self::$node_to_post_map ) )\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif( $meta_record[$vid_field] != self::$node_to_rev_map[ $meta_record[$nid_field] ] )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t//\t\t\t\t\techo 'Adding metadata for: ' . self::$node_to_post_map[ $meta_record['nid'] ] . ' - ' . $meta_record[ $value_column ] . \"<br>\\n\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach( $meta_record as $column => $value ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( empty( $value ) )\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( 0 !== strpos( $column, $meta_field['field_name'] ) )\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif( strpos( $column, '_fid' ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$value = self::importAttachedFile(\n\t\t\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record[$nid_field] ],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'file_id' => (int)$value\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tadd_post_meta(\n\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t'_drupal_source',\n\t\t\t\t\t\t\t\t\t$column\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( array_key_exists( str_replace( '_fid', '_data', $column ), $meta_record ) ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$details = maybe_unserialize( $meta_record[ str_replace( '_fid', '_data', $column ) ] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif( isset( $details['title'] ) ) {\n\t\t\t\t\t\t\t\t\t\twp_update_post(\n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'ID' => $value,\n\t\t\t\t\t\t\t\t\t\t\t\t'post_excerpt' => $details['title']\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif( isset( $details['alt'] ) ) {\n\t\t\t\t\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\t\t\t\t\t'_wp_attachment_image_alt',\n\t\t\t\t\t\t\t\t\t\t\t$details['alt']\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\t\tself::$node_to_post_map[ $meta_record['nid'] ],\n\t\t\t\t\t\t\t\t'_drupal_' . $column,\n\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t} // End if isset table\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$searched_fields[] = $meta_field['field_name'];\n\t\t\t\t\n\t\t}\n\t\t\n\t\t// Search for table named for the node type\n\t\t$types = drupal()->node->type->getUniqueValues();\n\t\t\n\t\tforeach( $types as $type ) {\n\t\t\t\n\t\t\tif( isset( drupal()->$type ) ) {\n\t\t\t\t\n\t\t\t\t$type_records = drupal()->$type->getRecords();\n\t\t\t\tforeach( $type_records as $type_record ) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( ! array_key_exists( $type_record['nid'], self::$node_to_post_map ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tforeach( $type_record as $column => $value ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( empty( $value ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tupdate_post_meta(\n\t\t\t\t\t\t\tself::$node_to_post_map[ $type_record['nid'] ],\n\t\t\t\t\t\t\t'_drupal_' . $column,\n\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Check for uploaded files\n\t\t\n\t\tif( isset( drupal()->upload ) ) {\n\t\t\t\n\t\t\t$uploads = drupal()->getRecords(\n\t\t\t\tdrupal()->query(\n\t\t\t\t\t'SELECT * FROM upload u\n\t\t\t\t\t\tWHERE (nid, vid) IN\n\t\t\t\t\t\t(SELECT nid, MAX(vid) FROM upload GROUP BY nid)'\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tforeach( $uploads as $upload ) {\n\t\t\t\t\n\t\t\t\t$node = drupal()->node->getRecord(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'nid' => $upload['nid']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif( apply_filters( 'import_node_skip_node', false, $node ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tif( ! array_key_exists( $upload['nid'], self::$node_to_post_map ) )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Skip records with fid = 0\n\t\t\t\tif( 0 == $upload['fid'] )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t$value = self::importAttachedFile(\n\t\t\t\t\tself::$node_to_post_map[ $upload['nid'] ],\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'file_id' => (int)$upload['fid']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tadd_post_meta(\n\t\t\t\t\t$value,\n\t\t\t\t\t'_drupal_source',\n\t\t\t\t\t'upload'\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tadd_post_meta(\n\t\t\t\t\t$value,\n\t\t\t\t\t'_drupal_list_upload',\n\t\t\t\t\t(int)$upload['list']\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tdo_action( 'imported_metadata' );\n\t\t\n\t}", "public function testAddItemSubCategoryFileByURL()\n {\n }", "static public function configureFileField() {}", "public function testAddExternalShipmentFileByURL()\n {\n }", "public function getFileExtension();", "public function testAddLowStockFileByURL()\n {\n }", "function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }", "public function getTargetFileExtension() {}", "public function getTargetFileExtension() {}", "function G3Client_PluginMetaLinks($links, $file){\n if($file == plugin_basename(__FILE__)) {\n\n }\n\n return $links;\n}", "public function testAddOrderFileByURL()\n {\n }", "function getExtension() ;", "public function getExtension() : string;", "public static function update_metadata($id, $filename = false, $link = false,\n $backref = false, $created_on = false,\n $created_by = false, $deleted = false)\n {\n $fields = [];\n $values = [];\n if (false !== $filename) {\n $fields[] = 'filename=%s';\n $values[] = $filename;\n }\n if (false !== $backref) {\n $fields[] = 'backref=%s';\n $values[] = $backref;\n }\n if (false !== $created_on) {\n $fields[] = 'created_on=%T';\n $values[] = $created_on;\n }\n if (false !== $created_by) {\n $fields[] = 'created_by=%d';\n $values[] = $created_by;\n }\n if (false !== $deleted) {\n $fields[] = 'deleted=%d';\n $values[] = $deleted;\n }\n if (!empty($fields)) {\n $fields = implode(',', $fields);\n $values[] = $id;\n DB::Execute(\"UPDATE utils_filestorage SET $fields WHERE id=%d\", $values);\n }\n if (false !== $link) {\n self::add_link($link, $id);\n }\n }", "public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}", "public function testFileValue() : void {\n\t\t$this->assertEquals('kc_file', PostType::File->value);\n\t}", "abstract function getExtension(): string;", "protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }", "public function hasExtension($name);", "public function testLargeAttribute() {\n $file = new Mock\\File();\n $file->data = file_get_contents('../src/ORM_Model.php');\n $file->name = 'ORM_Model.php';\n\n $this->assertTrue( $file->save(), \"Unable to save File\" );\n\n $storedFile = Mock\\File::Find( $file->id() );\n $this->assertEquals( $file->data, $storedFile->data );\n }", "public function testGetAttribute_lstat_Calculated()\n {\n \t$stat = lstat($this->file);\n \t\n $this->assertEquals(is_link($this->file) ? 'link' : filetype($this->file), $this->Fs_Node->getAttribute('type', Fs::NO_DEREFERENCE), 'type');\n $this->assertEquals(Fs::mode2perms($stat['mode']), $this->Fs_Node->getAttribute('perms', Fs::NO_DEREFERENCE), 'perms');\n }", "function TESTMETA($path, $TESTexif, $TESTiptc) {\n\t\t$files = scandir($path);\n\t\tforeach($files as $file) {\n\t\t\tif(strlen($file) >= 3) {\n\n\t\t\t\tif($TESTiptc) {\n\t\t\t\t\tprint_r(\"FILENAME IS: \" . $file . \"<br>\");\n\t\t\t\t\tgetMeta($path . $file);\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t} elseif ($TESTexif) {\n\t\t\t\t\tprint_r(\"FILENAME IS: \" . $file . \"<br>\");\n\t\t\t\t\tgetEXIF($path . $file);\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"--------------------------\");\n\t\t\t\t\tprint_r(\"<br>\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function phptemplate_filefield_file($file) {\n if (empty($file['fid'])) {\n return '';\n }\n\n $path = $file['filepath'];\n $url = file_create_url($path);\n $icon = theme('filefield_icon', $file);\n\n // Set options as per anchor format described at\n $options = array(\n 'attributes' => array(\n 'type' => $file['filemime'] . '; length=' . $file['filesize'],\n ),\n );\n\n // Use the description as the link text if available.\n if (empty($file['data']['description'])) {\n $link_text = $file['filename'];\n }\n else {\n $link_text = $file['data']['description'];\n $options['attributes']['title'] = $file['filename'];\n }\n\n //open files of particular mime types in new window\n $new_window_mimetypes = array(\n 'application/pdf',\n 'text/plain'\n );\n if (in_array($file['filemime'], $new_window_mimetypes)) {\n $options['attributes']['target'] = '_blank';\n }\n\n return '<div class=\"filefield-file clear-block\">'. $icon . l($link_text, $url, $options) .'</div>';\n}", "function file_display_url(File $file, $format = 'fullsize')\n{\n if (!$file->exists()) {\n return false;\n }\n return $file->getWebPath($format);\n}", "public abstract function getExtension();", "function link_to_file_show($attributes = array(), $text = null, $file = null)\n{\n if (!$file) {\n $file = get_current_record('file');\n }\n if (!$text) {\n $text = metadata($file, 'display_title');\n }\n return link_to($file, 'show', $text, $attributes);\n}", "public function getExtension() {}", "public function getExtension() {}", "public function getFileExtension($format);", "public function testWithFileFields()\n {\n $config = array(\n 'subject_field' => array('description'),\n 'fields' => array ('origin' => 'From','destination' => 'To','price' => 'Miles')\n );\n $record = array(\n 'From'=>'Singapore',\n 'To'=>'London',\n 'Miles'=>'12000',\n 'description' => 'Flight From %origin% To %destination% for %price% miles'\n );\n\n $node_replace = new \\Giift\\Etl\\Transformer\\Replace($config);\n $node_replace->addOutput($this->node_loader);\n\n $node_replace->processRecord($record);\n\n $rs = $this->node_loader->getResult();\n\n $this->assertNotNull($rs);\n $this->assertNotEmpty($rs);\n foreach ($rs as $result) {\n $this->assertArrayHasKey('From', $result);\n $this->assertArrayHasKey('Miles', $result);\n $this->assertEquals(\"Flight From Singapore To London for 12000 miles\", $result['description']);\n }\n }", "abstract public function getFileMetadata(FileData $fileData);", "abstract public function getExtensionName();", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "function fileExtension($nameFile) {\n\t$format = substr($nameFile, -4);\n\treturn ($format == \".pat\");\n}", "public function addExtension(string $extension);", "public function checkExtensions()\r\n\t{\r\n\t\treturn (strcasecmp(pathinfo($this->targetFile, PATHINFO_EXTENSION), pathinfo($this->referenceFile, PATHINFO_EXTENSION)) === 0);\r\n\t}", "public function getLocalExtListFile() {}", "public function testGetFunctionsFromExtension()\n {\n if (is_null($this->ref)) {\n return;\n }\n\n foreach ($this->ref['extensions'] as $extname => $opt) {\n $ext = get_extension_funcs($extname);\n if (!is_array($ext)) {\n // At least, for sqlite3 (PHP Bug ?)\n continue;\n }\n\n foreach ($ext as $fctname) {\n if (!in_array($fctname, $this->ignoredfunctions)) {\n $this->assertArrayHasKey(\n $fctname,\n $this->ref['functions'],\n \"Defined function '$fctname' not known in Reference.\"\n );\n }\n }\n }\n }", "public function testTypeIdentifiesStorage()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertSame('file', Storage::type(self::$temp.DS.'foo.txt'));\n }", "function dl(string $extension_filename): void\n{\n error_clear_last();\n $safeResult = \\dl($extension_filename);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n}", "private function detectExtension()\n {\n $arr = explode('.', $this->file['name']);\n $this->file['extension'] = end($arr);\n }", "function is_valid_file_extension($value, $set){\n if (in_array($value, $set)) {\n return true;\n }\n}", "abstract public function acceptedExtension(): string;", "public function canGetExtensionKey() {\n\t\t$provider = $this->getConfigurationProviderInstance();\n\t\t$record = $this->getBasicRecord();\n\t\t$extensionKey = $provider->getExtensionKey($record);\n\t\t$this->assertNull($extensionKey);\n\t}", "function is_external_file($file) {\n\n $allowed = array('jpeg', 'png', 'bmp', 'gif', 'pdf', 'jpg', 'doc', 'docx');\n\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n\n if (in_array(strtolower($ext), $allowed)) {\n return true;\n }\n\n return false;\n}", "protected function isFile() {}", "function files_for_item($options = array(), $wrapperAttributes = array('class' => 'item-file'), $item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n if (!isset($options['linkToMetadata'])) {\n $options['linkToMetadata'] = (bool) get_option('link_to_file_metadata');\n }\n $options['filesForItem'] = true;\n $html = file_markup($item->Files, $options, $wrapperAttributes);\n return apply_filters('files_for_item', $html, compact('item', 'options', 'wrapperAttributes'));\n}", "protected function determineTargetFileExtension() {}", "function ft_hook_fileextras($file, $dir) {}", "public function testShouldGetFileInfo() {\n\t\t$this->assertEquals(\n\t\t\t$this->_testFilesId[0],\n\t\t\t$this->_Files->run(['ids' => $this->_testFilesId])[0]['id']\n\t\t);\n\t}", "private function processLink($link) {\n if ($id = $this->evalFileToSave($link)) {\n $this->file->add($id, $link);\n return $id;\n }\n return FALSE;\n }", "function verifyExternalLink(){\n $this->type(BUTTON_PREVIEW, \"\");\n $this->click(LINK_ADDLINK);\n $this->type(TEXT_LINKNAME, WIKI_EXTERNAL_LINK);\n try {\n $this->assertTrue($this->isElementPresent(ICON_PAGEEXTERNAL));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n $this->assertEquals(\"on\", $this->getValue(OPT_EXTERNAL));\n $this->click(BUTTON_INSERTLINK);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((WIKI_EXTERNAL_LINK), $this->getText(LINK_START.(WIKI_EXTERNAL_LINK)));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n $this->click(LINK_START.(WIKI_EXTERNAL_LINK));\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((WIKI_EXTERNAL_LINK_TITLE), $this->getTitle());\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "public function testCreateAttachment()\n {\n }", "public function testMustProvideValidExtension()\n {\n $response = $this->actingAs($this->user)->json('POST', '/avatar', [\n 'avatar' => UploadedFile::fake()->image('avatar.random')\n ]);\n\n $response->assertStatus(422);\n }", "function createFilesMetaData($file)\n\t{\n\t $filetype = '';\n\t $format = self::isKnownMimeType($file, $filetype);\n\t $transferServer = new BizTransferServer();\n\t $files = array();\n\t \n\t $attachment = new Attachment();\n\t $attachment->Rendition = 'native';\n\t $attachment->Type = $format; // mime file type, for this demo assumed to always be jpg\n\t $transferServer->copyToFileTransferServer($file, $attachment);\n\t $files[] = $attachment;\n\t \n\t return $files;\n\t}", "public function testSetAllowedExtensionsFail() {\n $dl2 = new downloader();\n $dl2->setAllowedExtensions(array('jpg' => 'image/jpeg',\n 'pl' => 'application/x-perl'));\n $this->assertTrue($dl2->areErrors());\n\n // one invalid extension will invalidate the entire list\n $this->assertFalse($dl2->checkExtension('jpg'));\n $this->assertFalse($dl2->checkExtension('jpeg'));\n $this->assertFalse($dl2->checkExtension('pl'));\n }", "public function setFileLinkFormat($format)\n {\n $old = $this->fileLinkFormat;\n $this->fileLinkFormat = $format;\n\n return $old;\n }", "public function testGetAttachmentContent()\n {\n }", "public function testFileSettings() {\n $config = $this->config('file.settings');\n $this->assertSame('textfield', $config->get('description.type'));\n $this->assertSame(128, $config->get('description.length'));\n $this->assertSame('sites/default/files/icons', $config->get('icon.directory'));\n $this->assertConfigSchema(\\Drupal::service('config.typed'), 'file.settings', $config->get());\n }", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}", "public function testGetAttachment()\n {\n }", "public function fileDenyPatternMatchesPhpExtensionDataProvider() {}", "public function testAddPackingPlanFileByURL()\n {\n }", "protected function createFakeExtension() {}", "function PMA_istableFieldBlob($field)\n{\n // If check to ensure types such as \"enum('one','two','blob',..)\" or\n // \"enum('one','two','tinyblob',..)\" etc. are not categorized as blob.\n if (stripos($field['Type'], 'blob') === 0\n || stripos($field['Type'], 'tinyblob') === 0\n || stripos($field['Type'], 'mediumblob') === 0\n || stripos($field['Type'], 'longblob') === 0\n ) {\n return stristr($field['Type'], 'blob');\n } else {\n return false;\n }\n}", "function fn_filter_instant_upload($filter_by_ext = array())\n{\n if (!empty($_FILES['upload'])) {\n $_FILES['upload']['path'] = $_FILES['upload']['tmp_name'];\n $uploaded_data = fn_get_local_data(Bootstrap::stripSlashes($_FILES['upload']));\n if (fn_check_uploaded_data($uploaded_data, $filter_by_ext)) {\n return $uploaded_data;\n }\n }\n\n return false;\n}", "function ui_description() {\n return t('Extend Linkit with file support (Managed files).');\n }", "public function checkExt($f) {\r\n $ext = pathinfo($f, PATHINFO_EXTENSION);\r\n return $ext;\r\n }", "public function getClientOriginalExtension();", "function acf_get_external_path($file, $path = '')\n{\n}", "protected function analyzeExtensionTables() {}", "public function testPhpExtensionsAreValid()\n {\n $this->assert->php->extensions\n ->isLoaded('simplexml')\n ->isLoaded('fileinfo')\n ->isLoaded('xsl');\n // validate that fileinfo is loaded and configured properly\n $this->assert->php->extensions->fileinfo->isAlive();\n }", "protected function initializeExtensionFiles() {}", "private function _checkExt($field)\n {\n if ( ! empty($field)) {\n $ext = $field->getClientOriginalExtension();\n $allowed = Config::get('filer.allowed_file_ext');\n\n foreach ($allowed as $type => $ext_arr) {\n if (in_array(strtolower($ext), $ext_arr)) {\n $this->_type\t\t= $type;\n $this->_ext\t\t\t= implode('|', $ext_arr);\n $this->_filename\t= str_random(30);\n\n break;\n }\n }\n\n if ( ! $this->_ext) {\n return $this->result(false, trans('files.invalid_extension'), $field->getClientOriginalName());\n }\n } else {\n return $this->result(false, trans('files.upload_error'));\n }\n\n return $this->result(true);\n }", "protected static function checkFileinfoExtension()\n {\n // Make sure that the \"fileinfo\" extension is loaded/enabled\n if (!extension_loaded('fileinfo')) {\n throw new RuntimeException('Required \"fileinfo\" extension not loaded');\n }\n }", "public function testSaveFiles()\n {\n $jsonData = '{\n \"links\": [\n {\n \"$ref\": \"http://localhost/testcase/readonly/101\",\n \"type\": \"owner\"\n },\n {\n \"$ref\": \"http://localhost/testcase/readonly/102\",\n \"type\": \"module\"\n }\n ],\n \"metadata\": {\n \"action\":[{\"command\":\"print\"},{\"command\":\"archive\"}]\n }\n }';\n\n $uploadedFile = $this->getUploadFile('test.txt');\n $client = $this->createClient();\n $client->request(\n 'POST',\n '/file',\n [\n 'metadata' => $jsonData,\n ],\n [\n 'upload' => $uploadedFile,\n ]\n );\n $response = $client->getResponse();\n $location = $response->headers->get('location');\n\n $this->assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n $this->assertStringContainsString('/file/', $location);\n\n // receive generated file information\n $client = $this->createClient();\n $client->request('GET', $location, [], [], ['HTTP_ACCEPT' => 'application/json']);\n\n $response = $client->getResponse();\n $contentArray = json_decode($response->getContent(), true);\n\n $this->assertEquals([[\"command\" => \"print\"], [\"command\" => \"archive\"]], $contentArray['metadata']['action']);\n $this->assertJsonStringEqualsJsonString(\n '[\n {\n \"$ref\": \"http://localhost/testcase/readonly/101\",\n \"type\": \"owner\"\n },\n {\n \"$ref\": \"http://localhost/testcase/readonly/102\",\n \"type\": \"module\"\n }\n ]',\n json_encode($contentArray['links'])\n );\n\n // Check contain data\n $this->assertArrayHasKey('modificationDate', $contentArray['metadata']);\n $this->assertArrayHasKey('createDate', $contentArray['metadata']);\n\n // Test Metadata, and Remove date.\n unset($contentArray['metadata']['modificationDate']);\n unset($contentArray['metadata']['createDate']);\n\n $this->assertJsonStringEqualsJsonString(\n '{\n \"size\":16,\n \"action\":[\n {\"command\":\"print\"},\n {\"command\":\"archive\"}\n ],\n \"mime\":\"text\\/plain\",\n \"filename\":\"test.txt\",\n \"hash\":\"4f3cbec0e58903d8bdcbd03d283cf43ed49a95d8d8b341ee38c0ba085204e2d5\",\n \"additionalProperties\":[]\n }',\n json_encode($contentArray['metadata'])\n );\n\n // clean up\n $client = $this->createClient();\n $client->request(\n 'DELETE',\n $location\n );\n }", "public function guessExtension();", "function pmpromd_plugin_row_meta($links, $file) {\r\n\tif(strpos($file, 'pmpro-member-directory.php') !== false)\r\n\t{\r\n\t\t$new_links = array(\r\n\t\t\t'<a href=\"' . esc_url('https://www.paidmembershipspro.com/add-ons/pmpro-member-directory/') . '\" title=\"' . esc_attr( __( 'View Documentation', 'pmpro' ) ) . '\">' . __( 'Docs', 'pmpro' ) . '</a>',\r\n\t\t\t'<a href=\"' . esc_url('https://www.paidmembershipspro.com/support/') . '\" title=\"' . esc_attr( __( 'Visit Customer Support Forum', 'pmpro' ) ) . '\">' . __( 'Support', 'pmpro' ) . '</a>',\r\n\t\t);\r\n\t\t$links = array_merge($links, $new_links);\r\n\t}\r\n\treturn $links;\r\n}", "public function getExtensionName() {}", "public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }", "public function test_listUnsupportedFileTypes() {\n\n }", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }" ]
[ "0.6041335", "0.5783697", "0.5769219", "0.5703821", "0.5584675", "0.5538111", "0.5528048", "0.549769", "0.5461188", "0.5443181", "0.5379179", "0.53302604", "0.53252846", "0.53247774", "0.5289768", "0.52819514", "0.52806014", "0.5278683", "0.5240148", "0.52401465", "0.5236624", "0.5211641", "0.52069867", "0.52002895", "0.5199376", "0.5195062", "0.5186672", "0.5177991", "0.5170457", "0.5168742", "0.5152689", "0.51468104", "0.5138359", "0.51225144", "0.5122128", "0.51206636", "0.5115778", "0.5096269", "0.50953406", "0.50929844", "0.50775594", "0.50700974", "0.5065787", "0.5051386", "0.5051386", "0.5051386", "0.5048412", "0.5030616", "0.50226873", "0.49869436", "0.49865788", "0.49837038", "0.49818525", "0.49755767", "0.4969431", "0.49642316", "0.49637944", "0.4963506", "0.49603528", "0.49532285", "0.4945505", "0.49338228", "0.4931657", "0.49302378", "0.49236053", "0.49204996", "0.49153662", "0.49076408", "0.49059922", "0.49057803", "0.49026123", "0.48915064", "0.4889779", "0.4880143", "0.4880143", "0.4880143", "0.48790887", "0.48781008", "0.48696715", "0.48541912", "0.48416114", "0.48414236", "0.4835359", "0.48351067", "0.48324078", "0.48255903", "0.4823796", "0.48174107", "0.48162428", "0.4811606", "0.48071218", "0.4805272", "0.47957537", "0.47926137", "0.47908", "0.47892135", "0.47814527", "0.47774306", "0.4772546", "0.47714522", "0.47686407" ]
0.0
-1
put your code here
public function __construct() { parent::__construct(); if( ! $this->require_role('client') ){ redirect('app/logout'); } //Force https $this->force_ssl(); //Load helpes $this->load->helper(array('form','client')); $this->load->library(array('weather_library')); //Load model $this->load->model(array('client_model')); $this->load->model(array('app_model')); $vars['page'] = 'agriculture'; $this->load->vars($vars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n //\n \n }", "public function run()\n\t{\n\t\t//\n\t}", "public function preExecute(){\n\n\t\n\t}", "function script()\n {\n }", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "public function custom()\n\t{\n\t}", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "public function run()\r\n {\r\n\r\n }", "public function run(){\n parent::run();\n //Do stuff...\n }", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "function use_codepress()\n {\n }", "public function run()\n {\n // Put your code here;\n }", "function run()\r\n {\r\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run() {\n }", "public static function run() {\n\t}", "public function onRun()\n {\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function run() {\n }", "public function render_content() {\n\t}", "public function main()\r\n {\r\n \r\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "function render() ;", "function execute()\n {\n }", "public function run(): void\n {\n //\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public function execute()\n {\n //echo __('Hello Webkul Team.');\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function render()\n {\n //\n }", "public function run(){\n echo CHtml::closeTag( \"div\" );\n $this->registerScript();\n }", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "function __desctuct(){\r\n\t\t?>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\n\t\t<?php\r\n\t}", "public function run(){}", "public function demo()\n {\n // xu ly logic\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "public function render(){\n\t\t\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function render() {\r\n\t\t\r\n\t}", "public function main()\n\t{\n\t}", "function handle() ;", "public function execute() {\n\t}", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run() {}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function main()\r\n {\r\n $this->setOutput();\r\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function _exec()\n {\n }", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "protected function after_load(){\n\n\n }", "public function work()\n {\n }", "function run();", "function run();", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "function tap_run_page_handler() \n {\n include(\"/var/www/html/run/tap_run.php\");\n \n $params = cargaArray('Torneo Argentino de Programación', $form, '');\n \n include('body.php'); \n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "public function helper()\n\t{\n\t\n\t}", "public function drawContent()\n\t\t{\n\t\t}" ]
[ "0.60586566", "0.59289104", "0.5919654", "0.5899511", "0.5838488", "0.5838488", "0.58356965", "0.5814271", "0.5814271", "0.57796824", "0.5701954", "0.5700516", "0.5685669", "0.5684617", "0.5684617", "0.5684617", "0.5639208", "0.563027", "0.56278986", "0.56231225", "0.5620407", "0.56068903", "0.56068903", "0.56068903", "0.56016845", "0.5597219", "0.5595339", "0.5591545", "0.558057", "0.55636305", "0.55034596", "0.5487096", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.54594034", "0.5446425", "0.5446197", "0.54451364", "0.54319674", "0.5426377", "0.54072845", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.53981763", "0.5394762", "0.5392594", "0.5392164", "0.5391672", "0.5391672", "0.5391672", "0.5386191", "0.53823715", "0.5374112", "0.5373851", "0.5371084", "0.5369742", "0.53666246", "0.5365522", "0.5358571", "0.53542304", "0.5353158", "0.5345768", "0.5339915", "0.53389114", "0.53339213", "0.5332912", "0.5323722", "0.5323722", "0.5321411", "0.5318719", "0.53184503", "0.5300535", "0.5290181", "0.52723837", "0.52723306" ]
0.0
-1
Method should not be directly accessible
public function manageshops() { if( $this->uri->uri_string() == 'client/market/manageshops') show_404(); $this->load->view('client/agriculture'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function method() {\n\t}", "private function private_method() {}", "private function __() {\n }", "private function method1()\n\t{\n\t}", "public function helper()\n\t{\n\t\n\t}", "protected function protected_method() {}", "public function method();", "public function method();", "public function method();", "public function method();", "private function method2()\n\t{\n\t}", "public function method()\n {\n\n }", "private function _i() {\n }", "protected function _request() {}", "public function someStuff()\n {\n \n }", "public function __invoke()\n {\n }", "protected function __init__() { }", "public function oops () {\n }", "public function custom()\n\t{\n\t}", "public function access();", "final private function __construct() {}", "final private function __construct() {}", "protected final function __construct() {}", "function getMethod()\r\n {\r\n }", "public function __invoke()\n {\n\n }", "private function __construct () {}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "public function obtener()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function __init(){}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "abstract protected function external();", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.6992388", "0.6727627", "0.6702065", "0.6690052", "0.668501", "0.6679591", "0.66671705", "0.66671705", "0.66671705", "0.66671705", "0.6612656", "0.6578418", "0.6445728", "0.6244594", "0.6244079", "0.6232563", "0.6214153", "0.6200094", "0.61712414", "0.6148294", "0.6139532", "0.6139532", "0.61161894", "0.6085864", "0.6074843", "0.6066386", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.6039733", "0.60371125", "0.60371125", "0.60371125", "0.6026887", "0.6024966", "0.6016521", "0.6005339", "0.6005339", "0.6005339", "0.60047084", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377", "0.5995377" ]
0.0
-1
/ Count all moderated sites
private function getSiteAmount() { $repository = $this->getDoctrine() ->getRepository('AppBundle:Site'); return $repository->createQueryBuilder('s') ->select('count(s.id)') ->where('s.isModerated = 1') ->getQuery() ->getSingleScalarResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSiteCount()\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\tglobal $objSmarty;\n\t\t\t$sql_qry = \"SELECT count(theme_id) as site_count FROM \".$CFG['table']['domaindetails'].\" WHERE theme_id != '0'\";\n\t\t \t$res_qry = $this->ExecuteQuery($sql_qry,'select');\n\t\t \treturn $res_qry[0]['site_count'];\n\t\t}", "public function countNotModerated(){\n $count = ORM::factory($this->object_name())->where('moderate', '=', 0)->count_all();\n return $count;\n }", "function wp_update_network_user_counts() {\n\tglobal $wpdb;\n\n\t$count = $wpdb->get_var( \"SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'\" );\n\tupdate_site_option( 'user_count', $count );\n}", "public static function count_for_site( $db_site, $modifier = NULL )\n {\n return static::select_for_site( $db_site, $modifier, true );\n }", "public function getWebsiteCount()\n {\n return count($this->getWebsites());\n }", "public function count()\n {\n return count($this->sitemaps);\n }", "private function count_urls_to_validate() {\n\t\t/*\n\t\t * If the homepage is set to 'Your latest posts,' start the $total_count at 1.\n\t\t * Otherwise, it will probably be counted in the query for pages below.\n\t\t */\n\t\t$total_count = 'posts' === get_option( 'show_on_front' ) && $this->is_template_supported( 'is_home' ) ? 1 : 0;\n\n\t\t$amp_enabled_taxonomies = array_filter(\n\t\t\tget_taxonomies( [ 'public' => true ] ),\n\t\t\t[ $this, 'does_taxonomy_support_amp' ]\n\t\t);\n\n\t\t// Count all public taxonomy terms.\n\t\tforeach ( $amp_enabled_taxonomies as $taxonomy ) {\n\t\t\t$term_query = new WP_Term_Query(\n\t\t\t\t[\n\t\t\t\t\t'taxonomy' => $taxonomy,\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t\t'number' => $this->limit_type_validate_count,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// If $term_query->terms is an empty array, passing it to count() will throw an error.\n\t\t\t$total_count += ! empty( $term_query->terms ) ? count( $term_query->terms ) : 0;\n\t\t}\n\n\t\t// Count posts by type, like post, page, attachment, etc.\n\t\t$public_post_types = get_post_types( [ 'public' => true ], 'names' );\n\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t$posts = $this->get_posts_that_support_amp( $this->get_posts_by_type( $post_type ) );\n\t\t\t$total_count += ! empty( $posts ) ? count( $posts ) : 0;\n\t\t}\n\n\t\t// Count author pages, like https://example.com/author/admin/.\n\t\t$total_count += count( $this->get_author_page_urls() );\n\n\t\t// Count a single example date page, like https://example.com/?year=2019.\n\t\tif ( $this->get_date_page() ) {\n\t\t\t$total_count++;\n\t\t}\n\n\t\t// Count a single example search page, like https://example.com/?s=example.\n\t\tif ( $this->get_search_page() ) {\n\t\t\t$total_count++;\n\t\t}\n\n\t\treturn $total_count;\n\t}", "function subsite_manager_get_site_statistics($site_guid = 0) {\n global $CONFIG;\n\n $site_stats = array();\n $site_guid = (int) $site_guid;\n\n $dbprefix = get_config(\"dbprefix\");\n\n $query = \"SELECT distinct e.type,s.subtype,e.subtype as subtype_id from {$dbprefix}entities e left join {$dbprefix}entity_subtypes s on e.subtype=s.id\";\n\n $site_query = \"\";\n if ($site_guid) {\n $query .= \" where site_guid=$site_guid\";\n $site_query = \"and site_guid=$site_guid \";\n }\n\n // Get a list of major types\n if($types = get_data($query)){\n foreach ($types as $type) {\n // assume there are subtypes for now\n if (!is_array($site_stats[$type->type])) {\n $site_stats[$type->type] = array();\n }\n\n $query = \"SELECT count(*) as count from {$dbprefix}entities where type='{$type->type}' $site_query\";\n if ($type->subtype) {\n $query.= \" and subtype={$type->subtype_id}\";\n }\n\n $subtype_cnt = get_data_row($query);\n\n if ($type->subtype) {\n $site_stats[$type->type][$type->subtype] = $subtype_cnt->count;\n } else {\n $site_stats[$type->type]['__base__'] = $subtype_cnt->count;\n }\n }\n }\n\n return $site_stats;\n }", "function get_all_pagina_web_count()\r\n {\r\n $pagina_web = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `pagina_web`\r\n \")->row_array();\r\n\r\n return $pagina_web['count'];\r\n }", "public function numLinks();", "public function getModerationCountAttribute()\n\t{\n\t\treturn $this->moderations->count();\n\t}", "public function count_lists(){\n $cart_result = @mysqli_query($this->dbc, \"SELECT SUM(state='draft') as draft, SUM(article_type='news' and state='published') as news, SUM(article_type='guidance' and state='published') as guidance from `news_advice`\") or die(\"Couldn't ViewSql page USERS lists()\");\n $this->num_rows = mysqli_num_rows($cart_result);\n while ($row = mysqli_fetch_assoc($cart_result)) {\n $this->draft = $row[\"draft\"];\n $this->news = $row[\"news\"];\n $this->guidance = $row[\"guidance\"];\n }// end while\n mysqli_close($this->dbc);\n }", "static function countAdministrators() {\n return Users::count(\"type = 'Administrator' AND state = '\" . STATE_VISIBLE . \"'\");\n }", "public function computeCount() {\n $count = 0;\n foreach ($this->sourceUrls as $url) {\n $reader = new $this->readerClass($url, $this->elementQuery, $this->idQuery);\n foreach ($reader as $element) {\n // Only count relevant postType\n $field = 'wp:post_type';\n\n $post_type = current($element->xpath($field));\n\n // Check menu name.\n $menu = 'category[@domain=\"nav_menu\"]';\n $menu_name = current($element->xpath($menu));\n\n // Hard code main menu here.\n if ($post_type == $this->postType && $menu_name == 'Main') {\n $count++;\n }\n }\n }\n\n return $count;\n }", "public static function getAllCount()\n {\n return (int) FrontendModel::get('database')->getVar(\n 'SELECT COUNT(i.id) AS count\n FROM menu AS i\n WHERE i.language = ?',\n array(FRONTEND_LANGUAGE)\n );\n }", "function wp_count_posts($type = 'post', $perm = '')\n {\n }", "function get_all_download_count() {\n\t// the cached count is maintained in PluginProject::updateDownloadCount\n\treturn (int)elgg_get_plugin_setting('site_plugins_downloads', 'community_plugins');\n}", "function getBlogCount()\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\tglobal $objSmarty;\n\t\t\t$sql_qry = \"SELECT count(blog_id) as blog_count FROM \".$CFG['table']['domaindetails'].\" WHERE blog_id != '0'\";\n\t\t \t$res_qry = $this->ExecuteQuery($sql_qry,'select');\n\t\t \treturn $res_qry[0]['blog_count'];\n\t\t}", "function wp_update_network_site_counts($network_id = \\null)\n {\n }", "public function get_sites_count( $filter, $search, $orderby )\n\t{\n\t\tglobal $wpdb;\n \t\t$groupby = null;\n\t\treturn $wpdb->get_var( \"SELECT COUNT(DISTINCT \".self::$site_table.\".id) FROM \".self::$site_table.' '.$this->filter_sql($filter, $search, $groupby, $orderby) );\n\t}", "public function computeCount() {\n $count = 0;\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n $count = count($data);\n }\n }\n return $count;\n }", "private function getAdminCount() {\n $roles_name = array();\n $get_roles = Role::loadMultiple();\n unset($get_roles[AccountInterface::ANONYMOUS_ROLE]);\n $permission = array('administer permissions', 'administer users');\n foreach ($permission as $value) {\n $filtered_roles = array_filter($get_roles, function ($role) use ($value) {\n return $role->hasPermission($value);\n });\n foreach ($filtered_roles as $role_name => $data) {\n $roles_name[] = $role_name;\n }\n }\n\n if (!empty($roles_name)) {\n $roles_name_unique = array_unique($roles_name);\n $query = db_select('user__roles', 'ur');\n $query->fields('ur', array('entity_id'));\n $query->condition('ur.bundle', 'user', '=');\n $query->condition('ur.deleted', '0', '=');\n $query->condition('ur.roles_target_id', $roles_name_unique, 'IN');\n $count = $query->countQuery()->execute()->fetchField();\n }\n\n return (isset($count) && is_numeric($count)) ? $count : NULL;\n }", "public function countSiteTags($siteId);", "public function getAllWithPostsCounts();", "public function getPostCount();", "function count_site_visit($from_admin_overview=false) {\r\n\tif (file_exists(COUNTER_FILE)) {\r\n\t\t$ignore = false;\r\n\t\t$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : \"no agent\";\r\n\t\t$current_time = time();\r\n\t\t$current_ip = $_SERVER['REMOTE_ADDR']; \r\n\t \r\n\t\t// daten einlesen\r\n\t\t$c_file = array();\r\n\t\t$handle = fopen(COUNTER_FILE, \"r\");\r\n\t \r\n\t \tif ($handle) {\r\n\t\t\twhile (!feof($handle)) {\r\n\t\t\t\t$line = trim(fgets($handle, 4096)); \r\n\t\t\t\tif ($line != \"\") {\r\n\t\t\t\t\t$c_file[] = $line;\r\n\t\t\t\t}\t\t \r\n\t\t\t}\r\n\t\t\tfclose ($handle);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t \r\n\t\t// bots ignorieren \r\n\t\tif (substr_count($current_agent, \"bot\") > 0) {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t\t \r\n\t \r\n\t\t// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?\r\n\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t$counter_time = trim($counter_time);\r\n\t\t \r\n\t\t\tif ($counter_ip == $current_ip && $current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t// besucher wurde bereits gezählt, daher hier abbruch\r\n\t\t\t\t$ignore = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t// counter hochzählen\r\n\t\tif (!$ignore) {\r\n\t\t\tif (sizeof($c_file) == 0) {\r\n\t\t\t\t// wenn counter leer, dann füllen \r\n\t\t\t\t$add_line1 = date(\"z\") . \":1||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $current_time . \"\\n\";\r\n\t\t\t\t$add_line2 = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t \r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\t\t\t\t\tfwrite($fp, $add_line2);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// werte zur verfügung stellen\r\n\t\t\t\t$day = $week = $month = $year = $all = $record = 1;\r\n\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t$online = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// counter hochzählen\r\n\t\t\t\tlist($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n\t\t\t \r\n\t\t\t\t// day\r\n\t\t\t\t$day_data = explode(\":\", $day_arr);\r\n\t\t\t\t$day = $day_data[1];\r\n\t\t\t\tif ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n\t\t\t \r\n\t\t\t\t// week\r\n\t\t\t\t$week_data = explode(\":\", $week_arr);\r\n\t\t\t\t$week = $week_data[1];\r\n\t\t\t\tif ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n\t\t\t \r\n\t\t\t\t// month\r\n\t\t\t\t$month_data = explode(\":\", $month_arr);\r\n\t\t\t\t$month = $month_data[1];\r\n\t\t\t\tif ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n\t\t\t \r\n\t\t\t\t// year\r\n\t\t\t\t$year_data = explode(\":\", $year_arr);\r\n\t\t\t\t$year = $year_data[1];\r\n\t\t\t\tif ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n\t\t\t \r\n\t\t\t\t// all\r\n\t\t\t\t$all++;\r\n\t\t\t \r\n\t\t\t\t// neuer record?\r\n\t\t\t\t$record_time = trim($record_time);\r\n\t\t\t\tif ($day > $record) {\r\n\t\t\t\t\t$record = $day;\r\n\t\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// speichern und aufräumen und anzahl der online leute bestimmten\r\n\t\t\t \r\n\t\t\t\t$online = 1;\r\n\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\t$add_line1 = date(\"z\") . \":\" . $day . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\";\t\t \r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\r\n\t\t\t\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\t\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// übernehmen\r\n\t\t\t\t\t\tif ($current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t\t\t\t$counter_time = trim($counter_time);\r\n\t\t\t\t\t\t\t$add_line = $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n\t\t\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\t\t\t$online++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$add_line = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function countUnseenNewsItems(){\n return $this->newsModel->countUnseenNewsItems();\n }", "function dokan_get_seller_count() {\n global $wpdb;\n\n\n $counts = array( 'yes' => 0, 'no' => 0 );\n\n $result = $wpdb->get_results( \"SELECT COUNT(um.user_id) as count, um1.meta_value as type\n FROM $wpdb->usermeta um\n LEFT JOIN $wpdb->usermeta um1 ON um1.user_id = um.user_id\n WHERE um.meta_key = 'wp_capabilities' AND um1.meta_key = 'dokan_enable_selling'\n AND um.meta_value LIKE '%seller%'\n GROUP BY um1.meta_value\" );\n\n if ( $result ) {\n foreach ($result as $row) {\n $counts[$row->type] = (int) $row->count;\n }\n }\n\n return $counts;\n}", "function social_get_share_count($service, $url)\n{\n switch ($service) {\n case 'linkedin':\n $get = router_add_query(\n 'https://www.linkedin.com/countserv/count/share',\n array('url' => $url, 'format' => 'json')\n );\n callmap_log($get);\n $response = http_get($get);\n $body = json_decode($response['body'], true);\n return empty($body['count']) ? 0 : (int) $body['count'];\n case 'gplus':\n $get = router_add_query(\n 'https://plusone.google.com/_/+1/fastbutton',\n array('url' => $url)\n );\n callmap_log($get);\n $response = http_get($get);\n $regex = '/id=\"aggregateCount\"[^>]*>([^<]+)</';\n if (preg_match($regex, $response['body'], $matches)) {\n $count = strtolower($matches[1]);\n $count = str_replace(['k', 'm'], ['000', '000000'], $count);\n $count = preg_replace('/[^\\d]/', '', $count);\n return (int) $count;\n }\n return 0;\n default:\n return 0;\n }\n}", "public function getCountLikes() {\r\n\t\t$table = Engine_Api::_() -> getDbtable('likes', 'core');\r\n\t\t$Name = $table -> info('name');\r\n\t\t$select = $table -> select() -> from($Name);\r\n\t\t$select -> where(\"resource_id = ?\", $this -> blog_id) -> where(\"resource_type LIKE 'blog'\");\r\n\t\t$blogs = $table -> fetchAll($select);\r\n\t\treturn count($blogs);\r\n\t}", "public function countFrontend(){\n\t\t\t\t\t return count($this->listeFrontend());\n\t\t\t\t\t }", "public function getUnapprovedCount();", "function get_all_commission_tech_count()\n {\n $this->db->from('commission_tech');\n return $this->db->count_all_results();\n }", "private function setVisitsCount()\r\n {\r\n\r\n // settings\r\n\r\n // ip-protection in seconds\r\n $counter_expire = 600;\r\n $counter_filename = \"counter.txt\";\r\n\r\n // ignore agent list\r\n $counter_ignore_agents = array('bot', 'bot1', 'bot3');\r\n\r\n // ignore ip list\r\n $counter_ignore_ips = array('127.0.0.2', '127.0.0.3');\r\n\r\n\r\n // get basic information\r\n $counter_agent = $_SERVER['HTTP_USER_AGENT'] ?? null;\r\n $counter_ip = $_SERVER['REMOTE_ADDR']; \r\n $counter_time = time();\r\n \r\n \r\n if (file_exists($counter_filename)) \r\n {\r\n // check ignore lists\r\n $ignore = false;\r\n \r\n $length = sizeof($counter_ignore_agents);\r\n for ($i = 0; $i < $length; $i++)\r\n {\r\n if (substr_count($counter_agent, strtolower($counter_ignore_agents[$i])))\r\n {\r\n $ignore = true;\r\n break;\r\n }\r\n }\r\n \r\n $length = sizeof($counter_ignore_ips);\r\n for ($i = 0; $i < $length; $i++)\r\n {\r\n if ($counter_ip == $counter_ignore_ips[$i])\r\n {\r\n $ignore = true;\r\n break;\r\n }\r\n }\r\n \r\n // get current counter state\r\n $c_file = array();\r\n $fp = fopen($counter_filename, \"r\");\r\n \r\n if ($fp)\r\n {\r\n //flock($fp, LOCK_EX);\r\n $canWrite = false;\r\n while (!$canWrite) \r\n $canWrite = flock($fp, LOCK_EX);\r\n \r\n while (!feof($fp)) \r\n {\r\n $line = trim(fgets($fp, 1024)); \r\n if ($line != \"\")\r\n $c_file[] = $line; \r\n }\r\n flock($fp, LOCK_UN);\r\n fclose ($fp);\r\n }\r\n else\r\n {\r\n $ignore = true;\r\n }\r\n \r\n \r\n // check for ip lock\r\n if ($ignore == false)\r\n {\r\n $continue_block = array();\r\n for ($i = 1; $i < sizeof($c_file); $i++)\r\n {\r\n $tmp = explode(\"||\", $c_file[$i]);\r\n \r\n if (sizeof($tmp) == 2)\r\n {\r\n list($counter_ip_file, $counter_time_file) = $tmp;\r\n $counter_time_file = trim($counter_time_file);\r\n \r\n if ($counter_ip == $counter_ip_file && $counter_time-$counter_expire < $counter_time_file)\r\n {\r\n // do not count this user but keep ip\r\n $ignore = true;\r\n \r\n $continue_block[] = $counter_ip . \"||\" . $counter_time;\r\n }\r\n else if ($counter_time-$counter_expire < $counter_time_file)\r\n {\r\n $continue_block[] = $counter_ip_file . \"||\" . $counter_time_file; \r\n }\r\n } \r\n }\r\n }\r\n \r\n // count now\r\n if ($ignore == false)\r\n {\r\n // increase counter\r\n if (isset($c_file[0]))\r\n $tmp = explode(\"||\", $c_file[0]);\r\n else\r\n $tmp = array();\r\n \r\n if (sizeof($tmp) == 8)\r\n {\r\n // prevent errors\r\n list($day_arr, $yesterday_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = $tmp;\r\n \r\n $day_data = explode(\":\", $day_arr);\r\n $yesterday_data = explode(\":\", $yesterday_arr);\r\n \r\n // yesterday\r\n $yesterday = $yesterday_data[1];\r\n if ($day_data[0] == (date(\"z\")-1)) \r\n {\r\n $yesterday = $day_data[1]; \r\n }\r\n else\r\n {\r\n if ($yesterday_data[0] != (date(\"z\")-1))\r\n {\r\n $yesterday = 0; \r\n }\r\n }\r\n \r\n // day\r\n $day = $day_data[1];\r\n if ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n \r\n // week\r\n $week_data = explode(\":\", $week_arr);\r\n $week = $week_data[1];\r\n if ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n \r\n // month\r\n $month_data = explode(\":\", $month_arr);\r\n $month = $month_data[1];\r\n if ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n \r\n // year\r\n $year_data = explode(\":\", $year_arr);\r\n $year = $year_data[1];\r\n if ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n \r\n // all\r\n $all++;\r\n \r\n // neuer record?\r\n $record_time = trim($record_time);\r\n if ($day > $record)\r\n {\r\n $record = $day;\r\n $record_time = $counter_time;\r\n }\r\n \r\n // speichern und aufräumen und anzahl der online leute bestimmten\r\n $online = 1;\r\n \r\n // write counter data (avoid resetting)\r\n if ($all > 1)\r\n {\r\n $fp = fopen($counter_filename,\"w+\");\r\n if ($fp)\r\n {\r\n //flock($fp, LOCK_EX);\r\n $canWrite = false;\r\n while (!$canWrite) \r\n $canWrite = flock($fp, LOCK_EX);\r\n \r\n $add_line1 = date(\"z\") . \":\" . $day . \"||\" . (date(\"z\")-1) . \":\" . $yesterday . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\"; \r\n fwrite($fp, $add_line1);\r\n \r\n $length = sizeof($continue_block);\r\n for ($i = 0; $i < $length; $i++)\r\n {\r\n fwrite($fp, $continue_block[$i] . \"\\n\");\r\n $online++;\r\n }\r\n \r\n fwrite($fp, $counter_ip . \"||\" . $counter_time . \"\\n\");\r\n flock($fp, LOCK_UN);\r\n fclose($fp);\r\n }\r\n } \r\n else\r\n {\r\n $online = 1; \r\n }\r\n }\r\n else\r\n {\r\n // show data when error (of course these values are wrong, but it prevents error messages and prevent a counter reset)\r\n \r\n // get counter values\r\n $yesterday = 0;\r\n $day = $week = $month = $year = $all = $record = 1;\r\n $record_time = $counter_time;\r\n $online = 1;\r\n }\r\n }\r\n else\r\n {\r\n // get data for reading only\r\n if (sizeof($c_file) > 0)\r\n list($day_arr, $yesterday_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n else\r\n list($day_arr, $yesterday_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", date(\"z\") . \":1||\" . (date(\"z\")-1) . \":0||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $counter_time);\r\n \r\n // day\r\n $day_data = explode(\":\", $day_arr);\r\n $day = $day_data[1];\r\n \r\n // yesterday\r\n $yesterday_data = explode(\":\", $yesterday_arr);\r\n $yesterday = $yesterday_data[1];\r\n \r\n // week\r\n $week_data = explode(\":\", $week_arr);\r\n $week = $week_data[1];\r\n \r\n // month\r\n $month_data = explode(\":\", $month_arr);\r\n $month = $month_data[1];\r\n \r\n // year\r\n $year_data = explode(\":\", $year_arr);\r\n $year = $year_data[1];\r\n \r\n $record_time = trim($record_time);\r\n \r\n $online = sizeof($c_file) - 1;\r\n if ($online <= 0)\r\n $online = 1;\r\n }\r\n }\r\n else\r\n {\r\n // create counter file\r\n $add_line = date(\"z\") . \":1||\" . (date(\"z\")-1) . \":0||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $counter_time . \"\\n\" . $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n \r\n // write counter data\r\n $fp = fopen($counter_filename,\"w+\");\r\n if ($fp)\r\n {\r\n //flock($fp, LOCK_EX);\r\n $canWrite = false;\r\n while (!$canWrite) \r\n $canWrite = flock($fp, LOCK_EX);\r\n \r\n fwrite($fp, $add_line);\r\n flock($fp, LOCK_UN);\r\n fclose($fp);\r\n }\r\n \r\n // get counter values\r\n $yesterday = 0;\r\n $day = $week = $month = $year = $all = $record = 1;\r\n $record_time = $counter_time;\r\n $online = 1;\r\n }\r\n\r\n $this->please->unsetStorage([ 'online', 'day', 'yesterday', 'week', 'month', 'year', 'all' ], true);\r\n $this->please->setStorage([\r\n 'online' => ['content' => function() use ($online) { return $online; }],\r\n 'day' => ['content' => function() use ($day) { return $day; }],\r\n 'yesterday' => ['content' => function() use ($yesterday) { return $yesterday; }],\r\n 'week' => ['content' => function() use ($week) { return $week; }],\r\n 'month' => ['content' => function() use ($month) { return $month; }],\r\n 'year' => ['content' => function() use ($year) { return $year; }],\r\n 'all' => ['content' => function() use ($all) { return $all; }],\r\n ], true);\r\n }", "public function count()\n {\n return count($this->permissions);\n }", "function getTotalServerCount() {\n\t\t$count = 0;\n\t\tforeach ($this->masterservers as $masterserver) {\n\t\t\tif (isset($masterserver['num_servers_loaded'])) {\n\t\t\t\t$count += $masterserver['num_servers_loaded'];\n\t\t\t} else if (isset($masterserver['num_servers'])) {\n\t\t\t\t$count += $masterserver['num_servers'];\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}", "public function getSubscribersCount();", "function community_stat_counter() {\n\t\n\t// Try to retrieve counts from cache\n\t$counts = wp_cache_get( 'stat_counts' , 'apoc' );\n\tif ( false === $counts ) {\n\t\t\n\t\t// Get Faction Counts \n\t\t$counts = new stdClass();\n\t\t$counts->total\t\t= bp_core_get_total_member_count();\n\t\t$counts->aldmeri\t= max( count_users_by_meta( 'faction' , 'aldmeri' ) \t, 1 );\n\t\t$counts->daggerfall = max( count_users_by_meta( 'faction' , 'daggerfall' ) \t, 1 );\n\t\t$counts->ebonheart\t= max( count_users_by_meta( 'faction' , 'ebonheart' ) \t, 1 );\n\t\t$counts->declared\t= $counts->aldmeri + $counts->daggerfall + $counts->ebonheart;\n\t\t// Cache them\n\t\twp_cache_add( 'stat_counts' , $counts , 'apoc' , 600 );\n\t}\n\t\n\t// Compute Banner Heights - normalize max to 250px \n\t$largest = max( $counts->aldmeri , $counts->daggerfall , $counts->ebonheart );\n\t$aheight = round( ( $counts->aldmeri / $largest ) * 200 ) + 50;\n\t$dheight = round( ( $counts->daggerfall / $largest ) * 200 ) + 50;\n\t$eheight = round( ( $counts->ebonheart / $largest ) * 200 ) + 50;\n\t\n\t// Get the group URL stub\n\t$groups = SITEURL . '/groups/';\n\t?>\n\t\n\t<div id=\"stat-counter\" class=\"widget stat-counter\">\n\t\t<header class=\"widget-header\"><h3 class=\"widget-title\">Foundry Stats</h3></header>\n\t\t<p class=\"stat-counter-total\">Total Champions: <?php echo number_format( $counts->total , 0 , '' , ',' ); ?></p>\n\t\t<div class=\"banner-top aldmeri\" style=\"height:<?php echo $aheight; ?>px\">\n\t\t\t<div class=\"banner-bottom aldmeri\">\n\t\t\t\t<a class=\"banner-count\" href=\"<?php echo $groups; ?>aldmeri-dominion\" title=\"Aldmeri Dominion - <?php echo round( $counts->aldmeri * 100 / $counts->declared ); ?>%\"><?php echo number_format( $counts->aldmeri , 0 , '' , ',' ); ?></a>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"banner-top daggerfall\" style=\"height:<?php echo $dheight; ?>px\">\n\t\t\t<div class=\"banner-bottom daggerfall\">\n\t\t\t\t<a class=\"banner-count\" href=\"<?php echo $groups; ?>daggerfall-covenant\" title=\"Daggerfall Covenant - <?php echo round( $counts->daggerfall * 100 / $counts->declared ); ?>%\"><?php echo number_format( $counts->daggerfall , 0 , '' , ',' ); ?></a>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"banner-top ebonheart\" style=\"height:<?php echo $eheight; ?>px\">\n\t\t\t<div class=\"banner-bottom ebonheart\">\n\t\t\t\t<a class=\"banner-count\" href=\"<?php echo $groups; ?>ebonheart-pact\" title=\"Ebonheart Pact - <?php echo round( $counts->ebonheart * 100 / $counts->declared ); ?>%\"><?php echo number_format( $counts->ebonheart , 0 , '' , ',' ); ?></a>\n\t\t\t</div>\n\t\t</div>\n\t</div><?php\n}", "function count_many_users_posts($users, $post_type = 'post', $public_only = \\false)\n {\n }", "public function getInstallmentCount()\r\n\t{\r\n\t\treturn $this->root->getAttribute('nbmensualites');\r\n\t}", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function countCorpDocuments() {\n return $this->getAttributesDocuments(false, false, true, false, true);\n }", "function count_posts()\n {\n $this->Admin_model->procedure = 'COUNT_POSTS';\n $rs = $this->Admin_model->get_media();\n return $rs;\n }", "public function countAll() {}", "public function countAll() {}", "public function countAll() {}", "function submssion_count_allFunc() {\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'submissions';\n\n\t$Countjournal = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'journal' AND Approval = 1\");\n\t$Countevent = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'event' AND Approval = 1\");\n\t$Counttraining = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'training' AND Approval = 1\");\n\t$Countreports = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'reports' AND Approval = 1\");\n\n\t$output = '<ul class=\"submissions\">';\n\n\t$output .= \"<li><span>\" . count($Countjournal) . \"</span> Journal article or conference pape Submissions</li>\";\n\t$output .= \"<li><span>\" . count($Countevent) . \"</span> Event or Campaign Submissions</li>\";\n\t$output .= \"<li><span>\" . count($Counttraining) . \"</span> Training Submissions</li>\";\n\t$output .= \"<li><span>\" . count($Countreports) . \"</span> Reports Submissions</li>\";\n\n\t$output .= '</ul>';\n\n\treturn $output;\n\n}", "public function getCount()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$count = parent::getCount();\r\n\t\t} else {\r\n\t\t\t$count = $this->getGroupTagsCount() +\r\n\t\t\t\t$this->getMembersTagsCount() +\r\n\t\t\t\t$this->getDocumentsTagsCount() +\r\n\t\t\t\t$this->getEventsTagsCount() +\r\n\t\t\t\t$this->getPhotosTagsCount() +\r\n\t\t\t\t$this->getListsTagsCount();\r\n\t\t}\r\n return (int) $count;\r\n }", "public function likesCount()\n\t{\n\t\treturn $this->ratings()->where('value', 1)->count();\n\t}", "public function updaterArticlesCount()\n {\n //return $this->hasOne('NationRegion','id','nation_region_id');\n return $this->updater_articles()\n ->selectRaw('updated_user, count(*) as aggregate')\n ->groupBy('updated_user');\n }", "function get_user_count() {\n\treturn get_site_option( 'user_count' );\n}", "function count_nodes($drupal_content_type) {\n $result = db_query('SELECT nid FROM node WHERE type = \"%s\"', $drupal_content_type);\n $num = 0;\n while ($obj = db_fetch_object($result)) {\n $num++;\n }\n return($drupal_content_type . ': ' . $num . \" items\");\n}", "public function iN_CalculateAllSubscribersPosts() {\n\t\t$query = mysqli_query($this->db, \"SELECT COUNT(*) AS psts FROM i_posts WHERE who_can_see = '3' AND post_status = '1'\") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['psts']) ? $row['psts'] : '0';\n\t}", "public function count() {\n\t\treturn $this->sets[':default']->count();\n\t}", "public function getCounters()\n {\n $st = $this->db->query('SELECT COUNT(*) as count from users')->result_array();\n $data['users'] = $st[0]['count'];\n\n /*===== COUNT INSTANCES =====*/\n $st = $this->db->query('SELECT COUNT(*) as count from instances')->result_array();\n $data['instances'] = $st[0]['count'];\n\n\n /*===== COUNT SERVERS =====*/\n $st = $this->db->query('SELECT COUNT(*) as count from servers')->result_array();\n $data['servers'] = $st[0]['count'];\n\n /*==== COUNT MODULES ====*/\n $st = $this->db->query('SELECT COUNT(*) as count from modules')->result_array();\n $data['modules'] = $st[0]['count'];\n\n return $data;\n }", "function process_stats() {\r\n\t global $wpdb;\r\n\r\n\t $date = date(\"Y-m-d\", time());\r\n\r\n\t //don't process if already completed today (in case wp_cron goes nutzy)\r\n\t $existing = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_daily_stats WHERE date = '\" . $date . \"'\");\r\n\t if ($existing)\r\n\t return;\r\n\r\n\t $active_pro_sites = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '\" . time() . \"'\");\r\n\t $expired_pro_sites = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire <= '\" . time() . \"'\");\r\n\t $term_1_pro_sites = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE term = 1 AND expire > '\" . time() . \"'\");\r\n\t $term_3_pro_sites = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE term = 3 AND expire > '\" . time() . \"'\");\r\n\t $term_12_pro_sites = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE term = 12 AND expire > '\" . time() . \"'\");\r\n\t $term_manual_pro_sites = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE term NOT IN (1,3,12) AND expire > '\" . time() . \"'\");\r\n\r\n\t\t//get level counts\r\n $levels = get_site_option('psts_levels');\r\n for ($i=1; $i<=10; $i++) $level_count[$i] = 0; //prefill the array\r\n\t\tif (is_array($levels) && count($levels) > 1) {\r\n\t\t\tforeach ($levels as $level => $data) {\r\n\t\t\t\t//if last level include all previous ones greater than that level, in case a level was deleted\r\n\t\t\t\tif (count($levels) == $level)\r\n\t\t\t\t\t$level_count[$level] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE level >= $level AND expire > '\" . time() . \"'\");\r\n\t\t\t\telse\r\n $level_count[$level] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE level = $level AND expire > '\" . time() . \"'\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$level_count[1] = $active_pro_sites;\r\n\t\t}\r\n\r\n\t $wpdb->query( \"INSERT INTO {$wpdb->base_prefix}pro_sites_daily_stats ( date, supporter_count, expired_count, term_count_1, term_count_3, term_count_12, term_count_manual, level_count_1, level_count_2, level_count_3, level_count_4, level_count_5, level_count_6, level_count_7, level_count_8, level_count_9, level_count_10 ) VALUES ( '$date', $active_pro_sites, $expired_pro_sites, $term_1_pro_sites, $term_3_pro_sites, $term_12_pro_sites, $term_manual_pro_sites, {$level_count[1]}, {$level_count[2]}, {$level_count[3]}, {$level_count[4]}, {$level_count[5]}, {$level_count[6]}, {$level_count[7]}, {$level_count[8]}, {$level_count[9]}, {$level_count[10]} )\" );\r\n\t}", "public function countInstances() {\n $sql = \"SHOW TABLES LIKE '\" . self::TABLE_PREFIX . \"%usermeta'\";\n $pdo = $this->getPDO();\n $query = $pdo->query($sql);\n $instances = count( $query->fetch(\\PDO::FETCH_NUM) );\n return $instances;\n }", "function statistics_extended_members_views($group){\r\n\tglobal $CONFIG;\r\n\tif(!empty($group)){\r\n\t\t$query = \"SELECT sum(m.string) as count FROM {$CONFIG->dbprefix}annotations a, {$CONFIG->dbprefix}metastrings m \";\r\n\t\t$views_counter_id = get_metastring_id(\"views_counter\");\r\n\t\t$query.= \"WHERE name_id={$views_counter_id} \";\r\n\t\t$query.= \"AND entity_guid={$group} \";\r\n\t\t$query.= \"AND owner_guid IN (SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n\t\t$query.= \"AND a.value_id = m.id\";\r\n\t\t$count = get_data_row($query);\r\n\t\treturn $count->count;\r\n\t}\r\n\treturn 0;\r\n}", "public function countNameservers(): int {}", "public function getActivitiesCount() : int;", "function getCount() {\n\t\t$i = $this->_query->join('synd_issue','i');\n\t\t$query = clone $this->_query;\n\t\t$query->column(\"COUNT(DISTINCT $i.node_id)\");\n\n\t\t$persistent = $this->_storage->getPersistentStorage();\n\t\t$database = $persistent->getDatabase();\n\t\treturn $database->getOne($query->toString());\n\t}", "public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject()) {\n return $this->setNoRender();\n }\n\n //GET GROUP OBJECT\n $this->view->sitegroup = $sitegroup = Engine_Api::_()->core()->getSubject('sitegroup_group');\n\n //START MANAGE-ADMIN CHECK\n $isManageAdmin = Engine_Api::_()->sitegroup()->isManageAdmin($sitegroup, 'edit');\n if (empty($isManageAdmin)) {\n return $this->setNoRender();\n }\n\n $isManageAdmin = Engine_Api::_()->sitegroup()->isManageAdmin($sitegroup, 'insight');\n if (empty($isManageAdmin)) {\n return $this->setNoRender();\n }\n //END MANAGE-ADMIN CHECK\n\n $values = array();\n $values['group_id'] = $sitegroup->group_id;\n $values['month_activeusers'] = 1;\n\n //GET DATA\n $statObject = Engine_Api::_()->getDbtable('groupstatistics', 'sitegroup')->getInsights($values);\n $rawData = Engine_Api::_()->getDbtable('groupstatistics', 'sitegroup')->fetchAll($statObject);\n\n $new_responder_array = array();\n $merged_array = array();\n $this->view->total_users = $total_users = 0;\n\n foreach ($rawData as $rawDatum) {\n $new = 0;\n $array = array();\n if (!empty($rawDatum->viewer_id)) {\n $array[] = $rawDatum->viewer_id;\n $new_responder_array[] = $rawDatum->viewer_id;\n }\n $merged_array = array_unique(array_merge($array, $merged_array));\n if (!empty($merged_array)) {\n $new = count($merged_array);\n }\n if (!empty($rawDatum->summation_view)) {\n $this->view->total_users = $total_users = $new;\n }\n }\n }", "protected function get_site_ids()\n {\n }", "function getAllStudentCount($connection){\n $query = \"SELECT fs.*,fu.user_role FROM forum_student fs LEFT JOIN forum_users fu ON fs.user_id=fu.id WHERE fu.user_role='student'\";\n $count = $connection->query($query);\n return $count;\n }", "public function countResult($currentLevel)\n {\n global $wp_query;\n\n $counts = array(\n 'all' => 0,\n 'subscriptions' => 0,\n 'current' => 0,\n );\n\n $counts[$currentLevel] = $wp_query->found_posts;\n\n foreach ($counts as $level => $resultCount) {\n if ($resultCount <> 0) {\n continue;\n }\n\n $queryVars = $wp_query->query_vars;\n $sites = \\VcExtended\\Library\\Search\\ElasticSearch::getSitesFromLevel($level);\n\n $postStatuses = array('publish', 'inherit');\n\n if (is_user_logged_in()) {\n $postStatuses[] = 'private';\n }\n\n $query = new \\WP_Query(array(\n 's' => get_search_query(),\n 'orderby' => 'relevance',\n 'sites' => $sites,\n 'post_status' => $postStatuses,\n 'post_type' => \\VcExtended\\Library\\Helper\\PostType::getPublic(),\n 'cache_results' => false\n ));\n\n $counts[$level] = $query->found_posts;\n }\n\n $counts['users'] = isset($this->data['users']) ? count($this->data['users']) : 0;\n\n $this->data['counts'] = $counts;\n }", "function getTotalArticlesInSite()\n\t{\n\t\tglobal $CFG;\n\t\tglobal $db;\n\t\t$sql =\t'SELECT SUM(total_articles) AS total_articles'.\n\t \t\t' FROM '.$CFG['db']['tbl']['users'].' WHERE usr_status=\\'Ok\\'';\n\n\t\t$paramFields = array();\n\t\t$stmt = $db->Prepare($sql);\n\t\t$rs = $db->Execute($stmt, $paramFields);\n\t\tif (!$rs)\n\t\t\ttrigger_error($db->ErrorNo().' '.\n\t\t\t\t$db->ErrorMsg(), E_USER_ERROR);\n\n\t\tif ($rs->PO_RecordCount())\n\t\t{\n\t\t\tif($row = $rs->FetchRow())\n\t\t\t{\n \t\t\t\tif($row['total_articles'])\n \t\t\t\t{\n \t\t\t\t\t$all_article_url = getUrl('articlelist','?pg=articlenew', 'articlenew/','','article');\n \t\t\t\t\treturn '<a href=\"'.$all_article_url.'\">'.$row['total_articles'].'</a>';\n \t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "function get_object_count()\r\n {\r\n return $this->get_browser()->count_profile_publications($this->get_condition());\r\n }", "function getModuleBadgeCounts($type) {\n\tglobal $fmdb, $__FM_CONFIG;\n\t\n\t$badge_counts = null;\n\tif ($type == 'zones') {\n\t\t$badge_counts = array('forward' => 0, 'reverse' => 0);\n\t\t\n\t\t/** Zones */\n\t\tbasicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'domains', 'domain_id', 'domain_');\n\t\t$domain_count = $fmdb->num_rows;\n\t\tif ($domain_count) $domain_results = $fmdb->last_result;\n\t\tfor ($i=0; $i<$domain_count; $i++) {\n\t\t\tif ($domain_results[$i]->domain_template == 'no' && !$domain_results[$i]->domain_clone_domain_id && \n\t\t\t\t\t$domain_results[$i]->domain_type == 'master') {\n\t\t\t\tif (currentUserCan(array('access_specific_zones'), $_SESSION['module'], array(0, $domain_results[$i]->domain_id))) {\n\t\t\t\t\tif (!getSOACount($domain_results[$i]->domain_id)) {\n\t\t\t\t\t\t$badge_counts[$domain_results[$i]->domain_mapping]++;\n\t\t\t\t\t} elseif (!getNSCount($domain_results[$i]->domain_id)) {\n\t\t\t\t\t\t$badge_counts[$domain_results[$i]->domain_mapping]++;\n\t\t\t\t\t} elseif ($domain_results[$i]->domain_reload != 'no') {\n\t\t\t\t\t\t$badge_counts[$domain_results[$i]->domain_mapping]++;\n\t\t\t\t\t} elseif ($domain_results[$i]->domain_dnssec != 'no') {\n\t\t\t\t\t\tbasicGetList('fm_' . $__FM_CONFIG['fmDNS']['prefix'] . 'keys', 'key_id', 'key_', 'AND domain_id=' . $domain_results[$i]->domain_id);\n\t\t\t\t\t\tif (!$fmdb->num_rows || ($domain_results[$i]->domain_dnssec_signed && getDNSSECExpiration($domain_results[$i]) <= strtotime('now + 7 days'))) {\n\t\t\t\t\t\t\t$badge_counts[$domain_results[$i]->domain_mapping]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($domain_results, $domain_count);\n\t} elseif ($type == 'servers' && currentUserCan('manage_servers', $_SESSION['module'])) {\n\t\t$server_builds = array();\n\t\t\n\t\t/** Servers */\n\t\tbasicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_id', 'server_', \" AND `server_type`!='remote' AND (`server_installed`!='yes' OR (`server_status`='active' AND `server_build_config`='yes'))\");\n\t\t$server_count = $fmdb->num_rows;\n\t\tif ($server_count) $server_results = $fmdb->last_result;\n\t\tfor ($i=0; $i<$server_count; $i++) {\n\t\t\t$server_builds[] = $server_results[$i]->server_name;\n\t\t}\n\t\tif (version_compare(getOption('version', 0, $_SESSION['module']), '1.1', '>=')) {\n\t\t\tbasicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_id', 'server_', \"AND `server_type`!='remote' AND `server_client_version`!='\" . getOption('client_version', 0, $_SESSION['module']) . \"'\");\n\t\t\t$server_count = $fmdb->num_rows;\n\t\t\tif ($server_count) $server_results = $fmdb->last_result;\n\t\t\tfor ($i=0; $i<$server_count; $i++) {\n\t\t\t\t$server_builds[] = $server_results[$i]->server_name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$servers = array_unique($server_builds);\n\t\t$badge_counts = count($servers);\n\t\t\n\t\tunset($server_builds, $servers, $server_count, $server_results);\n\t}\n\t\n\treturn $badge_counts;\n}", "public static function count();", "public function getSitemapsCount()\n {\n return $this->sitemapsCount;\n }", "public static function getCount()\n {\n return static::find()->count();\n }", "public function record_count() {\r\n return $this->db->count_all(\"administradores\");\r\n }", "function GetSubmissionsCount () {\n return @mysql_result (@mysql_query (\"SELECT COUNT(*) AS `num` FROM `hunt_submissions` WHERE `submission_hunt` = '\".$this->hunt_id.\"'\", $this->ka_db), 0, \"num\");\n }", "function jb_list_all_network_sites()\n{\n global $wpdb;\n\n $result = '';\n $sites = array();\n $blogs = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $wpdb->blogs WHERE spam = '0' AND deleted = '0' and archived = '0' and public='1'\"));\n\n if(!empty($blogs))\n {\n foreach($blogs as $blog)\n {\n $details = get_blog_details($blog->blog_id);\n\n if($details != false)\n {\n $url = $details->siteurl;\n $name = $details->blogname;\n\n if(!(($blog->blog_id == 1) && ($show_main != 1)))\n {\n $sites[$name] = $url;\n }\n }\n }\n\n ksort($sites);\n\n $count = count($sites);\n $current = 1;\n \n $result.= '<ul class=\"inside-site-list\">';\n foreach($sites as $name=>$url)\n {\n $result.= '<li class=\"inside-site\"><a href=\"'.$url.'\">'.$name.'</a></li>';\n\n ++$current;\n }\n $result.= '</ul>';\n }\n\n return $result;\n}", "public function _count();", "public function count() {\n\t \treturn sizeof($this->links);\n\t}", "public function countLinks() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$where = \"WHERE link_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links $where\" );\n\t\t$count = $get->fetch_row();\n\t\treturn $count[0];\n\t}", "private function all_sites()\r\n {\r\n return $this->sites_repository()->all_sites();\r\n }", "function getNumAdmins($classId){\r\n $this->db->select('classAdmins');\r\n $this->db->where('id', $classId);\r\n $row = $this->db->get('class')->row();\r\n $admin_group = $row->classAdmins;\r\n\r\n $this->db->from('group_has_user');\r\n $this->db->where('group_id', $admin_group);\r\n return $this->db->count_all_results(); \r\n }" ]
[ "0.658768", "0.64084667", "0.62968117", "0.6254764", "0.62051487", "0.6088182", "0.59934217", "0.59437364", "0.5860839", "0.5857473", "0.584826", "0.58198833", "0.5769829", "0.57277817", "0.5715145", "0.5705795", "0.5631194", "0.56064904", "0.5594903", "0.55948424", "0.5570315", "0.5566569", "0.55660325", "0.55635965", "0.5557975", "0.55480945", "0.55475247", "0.5534252", "0.5525898", "0.5523588", "0.5500867", "0.5495105", "0.54836404", "0.5465016", "0.54581094", "0.5457037", "0.5456649", "0.5432331", "0.5431015", "0.5429959", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.54293275", "0.5419254", "0.54179174", "0.54166234", "0.54166234", "0.54166234", "0.5411472", "0.54105407", "0.5405519", "0.5401809", "0.539532", "0.53946465", "0.53899485", "0.5389561", "0.5389476", "0.5386612", "0.53842866", "0.53680766", "0.53620064", "0.5359781", "0.53493404", "0.5346772", "0.53414637", "0.5338684", "0.53328", "0.5329477", "0.532512", "0.5321386", "0.5318404", "0.5312165", "0.5306916", "0.53036", "0.53009385", "0.52793974", "0.5279288", "0.5275796", "0.5273235", "0.5270789", "0.5269301" ]
0.6435331
1
/ Get last added site
private function getLastSite() { $repository = $this->getDoctrine() ->getRepository('AppBundle:Site'); return $repository-> findOneBy(['isModerated' => '1'],['id' => 'DESC']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function last()\n {\n return $this->execGetRequest(['allow_state' => true], UrlBuilder::RESOURCE_GET_LATEST_NEWS);\n }", "public function get_last_url_request() {\n\t\treturn $this->_last_url_request;\n\t}", "public function getUrl()\n {\n return $this->lastUrl;\n }", "public function getSiteUrl()\n {\n sort($this->siteUrl);\n return $this->siteUrl;\n }", "function get_current_site()\n {\n }", "public function getLastPageUrl();", "public function getLastUpdate()\n {\n return $this->cache->load(\n self::CACHE_TAG\n );\n }", "public function getLastUpdate()\n {\n return Mage::app()->loadCache('admin_notifications_lastcheck');\n// return Mage::getStoreConfig(self::XML_LAST_UPDATE_PATH);\n }", "public function getSite();", "public function getCurrentSite() {\n\t\treturn $this->_currentSite;\n\t}", "function wp_cache_set_sites_last_changed()\n {\n }", "public function lastBlog()\n {\n $chapitres = $this->chapitre->getLastBlog();\n $commentaires = $this->comment->lastComments();\n }", "public function getSite()\n\t\t{\n\t\t\t$ref_list = ECash::getFactory()->getReferenceList('Site');\n\t\t\t$list_item = isset($ref_list[$this->model->enterprise_site_id]) ? $ref_list[$this->model->enterprise_site_id] : null;\n\t\t\treturn $list_item;\t\t\t\n\t\t}", "public static function getLastPageAddress()\n {\n return $_SESSION[self::LAST_PAGE_SESSION_NAME];\n }", "public function getLastApp();", "private function getLatestPlace(){\n $last = -100000000;\n foreach($this->URLs as $url){\n if($url['url_place'] > $last) $last = $url['url_place'];\n }\n if($last == -100000000) $last = 0;\n return $last;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite()\n {\n return $this->_site;\n }", "public function getSite()\n {\n return $this->_site;\n }", "public function getCurrentSite()\n {\n return $this->application->getSite();\n }", "public function getSite() {\n return $this->sSite;\n }", "public static function site()\n {\n return \\get_current_site();\n }", "public function getSiteURL()\r\n {\r\n return $this->siteURL;\r\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getLastRequestURL()\n {\n return $this->requestUrl;\n \n }", "public function GetLastRecord(){$this->LastPosts();return $this->lastrecord;}", "public function site() {\n return $this->site;\n }", "public function getLastUpdated();", "public function getLast()\n\t{\n\t\t$this->_db->setQuery(\"SELECT publish_down FROM $this->_tbl ORDER BY publish_down DESC LIMIT 1\");\n\t\treturn $this->_db->loadResult();\n\t}", "static public function getLastPage() {\n\t\treturn self::$last_page;\n\t}", "private function getCurrentWebsiteId()\n {\n return $this->storeManager->getWebsite()->getId();\n }", "private function getLastURL() {\n\t\tif (!isset($_SERVER['REQUEST_URI'])) {\n\t\t\t$serverrequri = $_SERVER['PHP_SELF'];\n\t\t} else {\n\t\t\t$serverrequri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\t$slcurrentPageName=str_replace('?&no_cache=1', '', $serverrequri);\n\t\t$slcurrentPageName=str_replace('?no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?L=0', '', $slcurrentPageName);\n\t\treturn $slcurrentPageName;\n\t}", "public function getUrl() {\n\t\treturn $this->siteURL;\n\t}", "public function get_last_logon() \n {\n return $this->last_logon;\n }", "public function getSiteHost();", "public static function getLastRequestUri()\n {\n return self::$lastRequestUri;\n }", "public function LastLink()\n {\n return HTTP::setGetVar(\n $this->getPaginationGetVar(),\n ($this->TotalPages() - 1) * $this->getPageLength(),\n ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null\n );\n }", "function getsite( )\n{\n\t\t\t\tif ( empty( $_SERVER['HTTP_HOST'] ) )\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$R8607b50296 = \"http://\".$_SERVER['HTTP_HOST'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$R8607b50296 = \"http://\".$_SERVER['SERVER_NAME'];\n\t\t\t\t}\n\t\t\t\tif ( !empty( $_SERVER['REQUEST_URI'] ) )\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$Rd4e4624cdb = $_SERVER['REQUEST_URI'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t\t\t$Rd4e4624cdb = $_SERVER['PHP_SELF'];\n\t\t\t\t}\n\t\t\t\t$Rcc5c6e696c = explode( \"/\", $Rd4e4624cdb );\n\t\t\t\tarray_pop( $Rcc5c6e696c );\n\t\t\t\tarray_pop( $Rcc5c6e696c );\n\t\t\t\tarray_pop( $Rcc5c6e696c );\n\t\t\t\t$Rd4e4624cdb = implode( \"/\", $Rcc5c6e696c );\n\t\t\t\treturn $R8607b50296.$Rd4e4624cdb;\n}", "public function getLastUpdate() {\n\t\treturn $this->lastUpdate;\n\t}", "function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {\n\tglobal $wpdb;\n\n\tif ( ! empty( $deprecated ) )\n\t\t_deprecated_argument( __FUNCTION__, 'MU' ); // never used\n\n\treturn $wpdb->get_results( $wpdb->prepare( \"SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d\", get_current_network_id(), $start, $quantity ), ARRAY_A );\n}", "public static function get_latest_version_url()\r\n\t\t{\r\n\t\t\treturn get_option('siteurl') . '/' . str_replace(ABSPATH, '', self::get_latest_version_dir());\r\n\t\t}", "function get_site_name() {\n\t\tglobal $site_array;\n\t\tif (isset($site_array)) {\n\t\t\treturn $site_array[\"site_name\"];\n\t\t}\n\t}", "static function getLastPage()\r\n {\r\n return $_SESSION[\"last_page\"];\r\n }", "public function getLastUpdate()\n {\n if (! isset($this->lastUpdate)) {\n $this->lastUpdate = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getLastUpdateQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->lastUpdate;\n }", "public function getLastUpdated() {\n return $this->lastUpdated;\n }", "function siteName() {\n\t\treturn $GLOBALS[\"siteName\"];\n\t}", "public function getLastIp()\n\t{\n\t\treturn $this->last_ip;\n\t}", "function getLastVisitOn() {\n if($this->last_visit_on === false) {\n \t$last_visit = parent::getLastVisitOn();\n \t$this->last_visit_on = instance_of($last_visit, 'DateTimeValue') ? $last_visit : new DateTimeValue(filectime(ENVIRONMENT_PATH . '/config/config.php'));\n } // if\n return $this->last_visit_on;\n }", "function getLastchange() {\n\t\treturn $this->get(\"lastchange\");\n\t}", "function get_current_site_name($current_site)\n {\n }", "function getLastModified() {\n\t\treturn $this->getData('lastModified');\n\t}", "public function site(){\n return $this->site;\n }", "public function getLastUpdate()\n {\n return $this->lastUpdate;\n }", "public function getLastUpdate()\n {\n return $this->lastUpdate;\n }", "public function getLatestPost()\n {\n $recent = $this->getRecent(1);\n\n if (is_array($recent)) {\n $recent = array_pop($recent);\n }\n\n return $recent;\n }", "public function getLastLogin()\n {\n return $this->get(self::_LAST_LOGIN);\n }", "public function getLastLogin()\n {\n return $this->get(self::_LAST_LOGIN);\n }", "function twispay_tw_get_live_site_id() {\n // Wordpress database refference\n global $wpdb;\n $table_name = $wpdb->prefix . 'twispay_tw_configuration';\n\n $live_id = $wpdb->get_results( \"SELECT live_id FROM $table_name\" );\n\n if ( $live_id ) {\n return $live_id[0]->live_id;\n }\n else {\n return '';\n }\n}", "function getLastBuildDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_LASTBUILDDATE);\n\t}", "function lastUpdate() {\n\t\tif ( !$this->postID && !$this->exists() )\n\t\t\treturn 999;\n\t\t\t\n\t\t$sql = \"SELECT last_update FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( !$results[0] )\n\t\t\treturn 999;\t\n\t\t\n\t\t$updateTime = strtotime( $results[0]->last_update );\n\t\t$current = strtotime( date( \"Y-m-d H:i:s\" ) );\t\t\n\t\t$lastUpdate = ( $current - $updateTime ) / 3600;\t\t\n\t\t\n\t\treturn $lastUpdate;\t\t\n\t\n\t}", "function getLatestDate() {\n\t\t$date = $this->LatestDatePacked;\n\t\tif(!$date && $this->URL) {\n\t\t\t$this->NeedsLatestRev = 1;\n\t\t\t$this->update();\n\t\t\t$date = $this->LatestDatePacked;\n\t\t}\n\t\treturn $date;\n\t}", "public function getWebsite();", "public function getLastPost() {\r\n $db = $this->dbConnect();\r\n $req = $db->query('SELECT id, title, content,adress_street, adress_city, DATE_FORMAT(date_creation, \\'%d/%m/%Y à %Hh%imin%ss\\') AS date_creation_fr FROM articles ORDER BY date_creation DESC LIMIT 0, 1');\r\n\r\n return $req->fetchAll();\r\n }", "public function getLast()\n\t{\n\t\treturn $this->last;\n\t}", "public function getLast ()\n {\n return reset ( $this->_list ) ;\n }", "final public function getLast() {\n\t\treturn null;\n\t}", "function get_last_comic_permalink() {\n\t$terminal = get_last_comic();\n\treturn !empty($terminal) ? get_permalink($terminal->ID) : false;\n}", "public function getWebsite(){\r\n\t\t\treturn $this->website;\r\n\t\t}", "private static function get_site_name()\n {\n }", "public function get_last_run() {\n\t\n\t\tif(empty($this->lastRun) && $this->is_wordpress_loaded()) {\n\t\t\t$this->lastRun = get_option('wpu-last-run');\n\t\t}\n\n\t\t return $this->lastRun;\n\t}", "public function getWebsite()\n\t{\n\t\treturn $this->website;\n\t}", "public function getRemoteSite() {\n return $this->remoteSite;\n }", "function GetPrewURI() /*added 16_05*/\n\t\t{\n\t\tif($this->history[count($this->history)-1])\n\t\t\t$ret = $this->history[count($this->history)-1];\n\t\telse\n\t\t\t$ret = $_SERVER['SERVER_NAME'];\n//\t\treturn $this->history[count($this->history)-1]; \n\t\treturn $ret;\n\t\t}", "public function getLastRequest() {\n\t\treturn $this->_lastRequest;\n\t}", "public function getLastResponse() {\n\t\treturn $this -> data['lastResponse'];\n\t}", "public function latest();", "public static function getSiteId()\n {\n return get_current_blog_id();\n }", "function getSiteURL()\n\t{\n\t return JURI::root();\n\t}", "public static function mostRecent()\n {\n return self::latest()->published()->first();\n }", "public function getWebsiteURL() {\n return $this->getChaveValor('WEBSITE_URL');\n }", "public function getLastRequestUri()\n\t{\n\t\treturn $this->_lastRequestUri;\n\t}", "public function getWebsite()\n {\n return isset($this->website) ? $this->website : null;\n }", "function last_response() {\n\t\treturn $this->last_response;\n\t}", "public function getLastRequest() {\n\t\treturn $this->lastRequest;\n\t}", "public function getWebsite()\n {\n return $this->website;\n }", "public function getWebsite()\n {\n return $this->website;\n }", "public function getWebsite()\n {\n return $this->website;\n }", "public function getLastCreatedNode() {\n $node = end($this->nodes);\n\n return $node;\n }", "function getRecents() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY id DESC LIMIT 30;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "function zg_ai_get_last_value() {\n global $last_value;\n return $last_value;\n}", "function get_site_url() {\n\t$protocol = (isSet($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';\n\treturn $protocol . '://' . $_SERVER['HTTP_HOST'];\n}", "public function getLastRequest()\n {\n return $this->__getLastRequest();\n }", "function get_site_title()\n\t{\n\t\tglobal $conn;\n\t\t\n\t\t$siteTitle = \"SELECT infoData FROM misc_info WHERE infoName='siteTitle' LIMIT 1\";\n\t\t\n\t\t$siteTitle = mysql_query($siteTitle, $conn);\n\t\t$siteTitle = mysql_fetch_assoc($siteTitle);\n\t\t\n\t\treturn array_shift($siteTitle);\n\t}", "public function getLastUsed()\n {\n return $this->lastUsed;\n }", "public function getLastLogin() {\n\t\treturn $this->lastLogin;\n\t}", "public function getLatestHistory() {\n $history = $this->getHistory();\n if (count($history) === 0) {\n return null;\n }\n return $history[count($history) - 1];\n }", "public function getLastRequestUri()\n {\n return $this->_lastRequestUri;\n }", "public function getLast_login()\n {\n return $this->last_login;\n }", "static public function get_current_blog_data() {\n\t\t$host = Util_Environment::host();\n\n\t\t// subdomain\n\t\tif ( Util_Environment::is_wpmu_subdomain() ) {\n\t\t\t$blog_data = Util_WpmuBlogmap::try_get_current_blog_data( $host );\n\t\t\tif ( is_null( $blog_data ) )\n\t\t\t\t$GLOBALS['w3tc_blogmap_register_new_item'] = $host;\n\n\t\t\treturn $blog_data;\n\t\t} else {\n\t\t\t// try subdir blog\n\t\t\t$url = $host . $_SERVER['REQUEST_URI'];\n\t\t\t$pos = strpos( $url, '?' );\n\t\t\tif ( $pos !== false )\n\t\t\t\t$url = substr( $url, 0, $pos );\n\n\t\t\t$url = rtrim( $url, '/' );\n\t\t\t$start_url = $url;\n\n\t\t\tfor ( ;; ) {\n\t\t\t\t$blog_data = Util_WpmuBlogmap::try_get_current_blog_data( $url );\n\t\t\t\tif ( !is_null( $blog_data ) )\n\t\t\t\t\treturn $blog_data;\n\t\t\t\t$pos = strrpos( $url, '/' );\n\t\t\t\tif ( $pos === false )\n\t\t\t\t\tbreak;\n\n\t\t\t\t$url = rtrim( substr( $url, 0, $pos ), '/' );\n\t\t\t}\n\n\t\t\t$GLOBALS['w3tc_blogmap_register_new_item'] = $start_url;\n\t\t\treturn null;\n\t\t}\n\t}" ]
[ "0.68619466", "0.68574226", "0.6604839", "0.6493649", "0.64382714", "0.6411656", "0.63763833", "0.63734347", "0.6371999", "0.636809", "0.63617903", "0.63151956", "0.6259804", "0.62585896", "0.6230022", "0.6228856", "0.62230706", "0.62095916", "0.62095916", "0.6195821", "0.619072", "0.61887056", "0.6187134", "0.6184458", "0.6184458", "0.61836296", "0.6170632", "0.6155729", "0.6135693", "0.6123644", "0.61170155", "0.6106891", "0.6099814", "0.60804635", "0.60719013", "0.6064627", "0.6056817", "0.6039281", "0.6037238", "0.6033072", "0.6032165", "0.6022903", "0.60155696", "0.5999781", "0.5996554", "0.59892154", "0.596895", "0.59676087", "0.59657186", "0.5955415", "0.5954561", "0.5947281", "0.5947255", "0.59448963", "0.59448963", "0.59379756", "0.59252197", "0.59252197", "0.5920096", "0.59163576", "0.59150076", "0.5912536", "0.59076416", "0.59051025", "0.5903246", "0.5898241", "0.5897938", "0.58935237", "0.588317", "0.58809674", "0.58806604", "0.58788997", "0.58775544", "0.5870293", "0.58671844", "0.5861147", "0.58587617", "0.585313", "0.58513284", "0.5849726", "0.58496207", "0.5842562", "0.58398557", "0.5837013", "0.5832342", "0.5816944", "0.5816944", "0.5816944", "0.5816811", "0.58161837", "0.58111644", "0.5808528", "0.57976776", "0.5795595", "0.5794555", "0.5791558", "0.5790122", "0.5787529", "0.5787458", "0.5778345" ]
0.79681635
0
/ Get all category
private function getAllCategory() { $repository = $this->getDoctrine() ->getRepository('AppBundle:Category'); return $repository-> findBy( [], ['name' => 'ASC'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllCategories();", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "public function getAllWithCategory();", "public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function allCategories()\n {\n return Category::all();\n }", "public function all()\n {\n return $this->category->all();\n }", "public function getAll()\n {\n return CategorieResource::collection(Categorie::paginate());\n }", "public function getCategories();", "public function getCategories();", "public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public static function getAllCategories()\n\t{\n\t\t$categories= Category::all();\n\t\treturn $categories;\n\t}", "public function getCategories()\n {\n return Category::all();\n }", "public static function getAll(){\n $result = static::$conn->query(\"SELECT * FROM enews.category\");\n return $result->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "public static function getAll() {\n self::checkConnection();\n $results = self::$connection->execute(\"SELECT * FROM category;\");\n $categories = array();\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\n }", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getAll(): Collection\n {\n return $this->categoryRepository->getAll();\n }", "public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }", "public function get_all_categories()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('category');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function read_all_categories()\n {\n $result = array(\n \"status\" => \"\" ,\n \"body\" => array(\n \"categories\" => array(\n \"id\" => 0,\n \"category_name\" => \"\"\n ),\n \"count\" => 0\n ),\n \"error\" => array()\n );\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n $res = $stmt->get_result();\n $result['body']['count'] = $res->num_rows;\n if ($res->num_rows > 0){\n $result['status'] = \"Categories read \";\n while($row = $res->fetch_assoc()){\n $data = array(\n \"id\" => $row[\"id\"],\n \"category_name\" => $row['categoryName']\n );\n array_push($result['body']['categories'], $data);\n }\n } else {\n $result['status'] = \"No categories found \";\n }\n return $result;\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function all_category() {\n\n $query = $this->db->get('tbl_category');\n return $query->result_array();\n }", "public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }", "function fetchAllCategory()\n\t{\t\t\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->result_array();\n\t\n\t}", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }", "public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}", "function all_category()\n\t{\n\t\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->result_array();\n\t}", "public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }", "public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }", "public function getCategories(){\n return Category::get();\n }", "public function all() : Collection\n {\n return Category::all();\n }", "function fetchAllCategory() {\n $query = $this->db->get('tbl_category');\n return $query->result_array();\n }", "public function getAllCategory(){\n $query = \"SELECT * FROM category ORDER BY catId DESC\";\n $result = $this->db->select($query);\n return $result; \n }", "private function getAllCategories()\n {\n $query = Queries::$getAllCategories;\n\n try {\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n $this->successResponse($result);\n } catch (\\PDOException$e) {\n $this->errorResponse($e->getMessage());\n }\n }", "public function findAllCategories(): iterable;", "public function getAll(){\n\n \t$categorias = $this->db->query(\"SELECT * FROM categorias ORDER BY id_categoria DESC\");\n\n \treturn $categorias;\n }", "public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}", "public function listsCategoriesGet()\r\n {\r\n $response = Category::all();\r\n return response()->json($response, 200);\r\n }", "public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "function get_all_category(){\n $cat_args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n\n );\n $all_category = get_categories( $cat_args );\n\n return $all_category;\n }", "public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }", "public function all_category(){\n $all = $this->db->get(\"tb_category_services\")->result();\n $response['status']=200;\n $response['error']=false;\n $response['category']=$all;\n return $response;\n }", "public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }", "public function index()\n {\n return Category::all();\n }", "public function index()\n {\n return Category::all();\n }", "public function index()\n {\n return Category::all();\n }", "public function loadAllCategories() {\n\t\t$sql = \"SELECT * FROM categories_grumble ORDER BY category_name ASC\";\n\t\t$this->db->query($sql);\n\t\treturn $this->db->rows();\n\t}", "public static function getAllCategories() {\n\t\t\t$db = Db::getInstance();\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description\n\t\t\t\t\t\t\t\t\t\t\t FROM categories\n\t\t\t\t\t\t\t\t\t\t ORDER BY location\n\t\t\t\t\t\t\t\t\t\t');\n\t\t\t\t$categoryQuery->execute();\n\t\t\t$allCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allCategories;\n\t\t}", "public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}", "function getAllCategories(){\r\n $query = $this->db->query(\"SELECT * FROM category\");\r\n return $query->result_array();\r\n }", "public function index(){\n return CategoryResource::collection(Category::all());\n }", "function getAll()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $return_array = array();\r\n $category_array = array();\r\n\r\n $db->array_query( $category_array, \"SELECT ID, Name FROM eZImageCatalogue_Category ORDER BY Name\" );\r\n\r\n for ( $i = 0; $i < count( $category_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZImageCategory( $category_array[$i][$db->fieldName( \"ID\" )] );\r\n }\r\n\r\n return $return_array;\r\n }", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function get_all_category(){\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM evs_database.evs_set_form_attitude\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function get_all_category_ids()\n {\n }", "public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}", "public function allCategories (){\n\n $categories = Category::orderBy('id','desc')->get();\n return response()->json([\n 'categories'=>$categories\n ],200);\n }", "public function index()\n {\n return CategoryResource::collection(Category::all());\n }", "private function fetchAllCategories()\n {\n $sql = '\n SELECT * FROM Rm_Category;\n ';\n\n $res = $this->db->executeSelectQueryAndFetchAll($sql);\n\n $categoriesArray = array();\n foreach ($res as $key => $row) {\n $name = $row->name;\n $categoriesArray[] = $name;\n }\n\n return $categoriesArray;\n }", "public function index()\n {\n $categories = $this->category_model->get();\n\n return $categories;\n }", "public function getCategories() : array;", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}", "function getAllcate(){\n return db()->query(\"SELECT * FROM categories\");\n }", "public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }", "function listCategories(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name FROM Category\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\n\t}", "public static function getCategories(){\n $categories = Category::all()->toArray();\n\n return $categories;\n }", "public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function findCategories();", "protected function findAllCategories()\n {\n return resolve([]);\n }", "public static function getAll()\n {\n $all = self::remember(60)\n ->orderBy('Category','ASC')\n ->orderBy('Name','ASC')\n ->get();\n foreach($all as $row)\n {\n $result[$row->id] = $row->category.\" - \".$row->name;\n }\n return $result;\n }", "function getCategories(){\n\treturn dbSelect('categories');\n}", "public function getAllCategories() {\n $q = $this->db->get('categories');\n if ($q->num_rows() > 0) {\n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function all()\n {\n $sql =\"SELECT c.id, c.name_category, c.waiting, c.obs_waiting, c.cover, count(p.name_product) as total_prods FROM categories as c LEFT JOIN products as p ON(c.name_category = p.category) WHERE p.status = 0 GROUP BY c.id\";\n $sql = $this->db->query($sql);\n return $categories = $sql->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function index()\n {\n return CategoryResource::collection(Category::latest()->get());\n }", "public function index()\n {\n $categories = Category::all();\n return $categories;\n \n }", "public function index()\n {\n return new CategoryCollection(Category::all());\n }", "public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }", "public function listCategories(){\n\t\t$lab = new lelabDB();\n\t\t$query = \"select * from $this->tableName order by id\";\n\t\t$result = $lab->getArray($query);\n\t\treturn $result;\n\t}", "public static function all() {\n $list = [];\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM categories');\n\n // we create a list of Category objects from the database results\n foreach($req->fetchAll() as $category) {\n $list[] = new Category($category['id'], $category['name']);\n }\n\n return $list;\n }", "public function getCategory() {\n\t\t$categories = Category::all();\n\t\treturn Response::json($categories);\n\t}", "public function getCategories()\r\n {\r\n $this->db->query(\"SELECT * FROM categories\");\r\n\r\n $row = $this->db->resultset();\r\n\r\n //Check Rows\r\n return $row;\r\n }", "public function get_all_academic_article_category()\n {\n echo $this->academic_article_model->get_all_academic_article_category();\n }", "public function getCategory();", "public function getCategory();", "public function index()\n\t{\n\t\treturn \\Response::json(Category::all());\n\t}", "public function getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }", "public function getAllWithCategoryAndTags();", "public function getCategory()\n {\n \t$cat = Category::with('child')->get();\n return response()->json( [ 'cat' => $cat ] );\n }", "public function getAll()\n {\n\t\t\treturn Category::with([\n\t\t\t\t'user'=>function($query){\n\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t},\n\t\t\t\t'updatedByUser'=>function($query){\n\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t},\n\t\t\t])->get(['id','name','type','created_by','updated_by']);\n }", "public function index()\n {\n //\n $cat = Category::all();\n return $cat;\n }", "public function getCat() {\n return DB::q_array(\"SELECT id, title, image FROM news_category WHERE published = 1\");\n }", "function category_list() {\n $query = $this->db->get(\"categories\");\n return $query->result_array();\n }" ]
[ "0.8815062", "0.8784961", "0.8608016", "0.85222656", "0.84492606", "0.84455", "0.8445441", "0.82644403", "0.82557863", "0.8254928", "0.8254928", "0.82313335", "0.8169965", "0.8131422", "0.81262136", "0.81164765", "0.810779", "0.8095979", "0.8093381", "0.8072341", "0.80279547", "0.8021059", "0.80082417", "0.800678", "0.79856354", "0.79742455", "0.7951112", "0.7945096", "0.79355645", "0.7931876", "0.7927257", "0.79129905", "0.79116946", "0.78818864", "0.7877256", "0.7862783", "0.78581405", "0.78505445", "0.7847992", "0.7828052", "0.78237396", "0.78222233", "0.7810497", "0.7798971", "0.7785949", "0.77755994", "0.7770654", "0.77635854", "0.77635854", "0.77635854", "0.77349216", "0.77340823", "0.7727464", "0.7726179", "0.77261555", "0.77169204", "0.7714981", "0.7703902", "0.768301", "0.76702285", "0.7669728", "0.7668398", "0.76683533", "0.7664511", "0.7663268", "0.76600903", "0.76405346", "0.762202", "0.7617978", "0.7616274", "0.7610012", "0.76081526", "0.7599649", "0.7592438", "0.75616056", "0.75588006", "0.7550844", "0.75503945", "0.7533077", "0.753036", "0.7509496", "0.75060457", "0.7501574", "0.74978745", "0.7491658", "0.74875414", "0.748131", "0.74810904", "0.7476794", "0.7476468", "0.7474843", "0.7474843", "0.7464929", "0.7460458", "0.74559504", "0.7449839", "0.7448879", "0.7448516", "0.7445534", "0.7435082" ]
0.8457635
4
Get the validation rules.
public function rules() { return [ 'id' => 'required|integer', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRules()\n {\n return $this->validation_rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n { \n return $this->rules;\n }", "public function getRules()\r\n\t{\r\n\t\treturn $this->rules;\r\n\t}", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public function getRules()\r\n\t{\r\n\t\treturn $this->_rules;\r\n\t}", "public function rules()\n {\n return static::$rules;\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function getRules()\n {\n if (!isset($this->_rules)){\n $this->_getRules();\n }\n return $this->_rules;\n }", "protected function get_validation_rules()\n {\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function getValidationRules() : array;", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function getRules()\n {\n return $this->get(self::_RULES);\n }", "public static function getRules() \n {\n return self::$rules;\n }", "public function getRules() {\n\t\treturn self::$rules;\n\t}", "public function getRules() {\n\t\treturn $this->rules ?? [];\n\t}", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function getRules()\n\t{\n\t\t\n\t\t$rules = array();\n\t\t\n\t\tforeach ( $this->getFields() as $field )\n\t\t{\n\t\t\t$rules = array_merge( $rules, $field->getRules() );\n\t\t}\n\t\t\n\t\treturn $rules;\n\t}", "public function validation_rules() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn $class::_object()->validates;\r\n }", "public function getRules( )\n {\n return $this->rules;\n }", "public function validationRules()\n {\n return [];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function getRules(): array\n {\n return $this->rules;\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function getRules()\n {\n // Set the validation rules.\n $rules = [\n 'party_id' => 'integer|required|exists:pgsql.core.parties,id',\n 'bank_id' => 'integer|required|exists:pgsql.core.banks,id',\n 'currency_id' => 'integer|required|exists:pgsql.core.currencies,id',\n 'first_name' => 'string|required|max:50',\n 'last_name' => 'string|required|max:50',\n 'last_name' => 'string|nullable|max:255',\n 'type' => 'string|nullable|in:savings,current',\n 'class' => 'string|nullable|in:personal,business',\n ];\n\n // Add the account number check if it's a new record.\n if (!$this->exists) {\n $rules['account_number'] = 'string|required|max:100|unique:pgsql.core.bank_accounts,account_number,NULL,id,bank_id,' . $this->bank_id;\n }\n\n return $rules;\n }", "public function getRules() : array\n {\n return $this->rules;\n }", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function getRules()\n {\n return (array) $this->rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function rules()\n {\n $rules = array();\n if ($this->exists('nombre')){\n $rules['nombre'] = $this->validateNombre();\n }\n if ($this->exists('categoria')){\n $rules['categoria'] = $this->validateCategoria();\n }\n if ($this->exists('detalle')){\n $rules['detalle'] = $this->validateDetalle();\n }\n if ($this->exists('precio')){\n $rules['precio'] = $this->validatePrecio();\n }\n if ($this->exists('marca')){\n $rules['marca'] = $this->validateMarca();\n }\n return $rules;\n }", "private function getRules()\n {\n return array(\n 'name' => new Pattern\\Name,\n 'height' => new Pattern\\Height,\n 'lat' => array(\n 'required' => true,\n 'rules' => array('Latitude')\n ),\n 'lng' => array(\n 'required' => true,\n 'rules' => array('Longitude')\n ),\n 'api_key' => array(\n 'required' => true,\n 'rules' => array(\n 'NotEmpty' => array(\n 'message' => 'Google API key can not be empty'\n )\n )\n ),\n 'style' => array(\n 'required' => false,\n 'rules' => array('Json')\n )\n );\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function & getRules()\n {\n return $this->rules;\n }", "public function rules()\n {\n $this->formObject();\n\n return $this->formObject()->rulesForStoring();\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "abstract public function getValidationRules(): array;", "public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function getRules()\n\t{\n\t\t$rules['org_id']\t= ['required', 'integer', 'exists:'. app()->make(\\App\\Org::class)->getTable() . ',id'];\n\t\t$rules['name']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t$rules['code']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t// $rules['group']\t\t\t\t\t= ['required', 'string', 'in:'.implode(',', SELF::GROUP)];\n\t\t$rules['group']\t\t\t\t\t= ['required', 'string'];\n\t\t$rules['description']\t\t\t= ['nullable', 'string'];\n\t\t$rules['threshold']\t\t\t\t= ['nullable', 'numeric', 'min:0'];\n\t\t$rules['unit']\t\t\t\t\t= ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = [];\n\n $questions = $this->paper->getQuestionsbyPaperID($this->get('paper_id'));\n\n foreach ($questions as $question) {\n $rules[$question->id] = 'required';\n }\n\n return $rules;\n }", "public function getRules();", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n\n $rules = [];\n\n // Validate the quantities\n $rules['quantity'] = $this->getRuleQuantity($this->getCartItem()->quantity);\n\n return $rules;\n }", "public function get_validation_rules() {\n\t\t$field = $this->field;\n\t\t$id = self::get_property( 'element_id', $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$rules = '';\n\n\t\tif ( $is_required && $post_image_enabled ) {\n\t\t\t$rules .= '\"' . $this->get_id( $field ) . '-post-image\": {';\n\t\t\tif ( $is_required ) {\n\t\t\t\t$rules .= '\"required\": true,';\n\t\t\t}\n\t\t\t$rules .= '},';\n\t\t}\n\t\t$category_list = forminator_post_categories( $post_type );\n\t\tif( ! empty( $category_list ) ) {\n\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\tif ( $is_required && $post_category_enabled ) {\n\t\t\t\t\t$rules .= '\"' . $this->get_id( $field ) . '-' . $category['value'] . '[]\": {';\n\t\t\t\t\tif ( $is_required ) {\n\t\t\t\t\t\t$rules .= '\"required\": true,';\n\t\t\t\t\t}\n\t\t\t\t\t$rules .= '},';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'forminator_field_postdata_validation_rules', $rules, $id, $field );\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "public function getRules()\n {\n return isset($this->Rules) ? $this->Rules : null;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "public static function validationRules($rules=array()) {\r\n\t\t$class = __CLASS__;\r\n if(!empty($rules)) {\r\n $class::_object()->validates = $rules;\r\n }\r\n\t\treturn $class::_object()->validates;\r\n }", "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function getValidationRules(): array\n {\n if ($this->validatorForEach) {\n return [\n new ParameterValidationRule(Validator::callback(function ($value) {\n $items = UnpackCSV::un($value, $this->separator);\n return Validator::each($this->validatorForEach->getValidator())->validate($items);\n }), $this->validatorForEach->getDescription())\n ];\n } else {\n return [];\n }\n }", "public function rules()\n {\n return static::staticRules();\n }", "protected function validationRules() : array\n {\n return [];\n }", "public function rules()\n {\n return RuleSet::find(Game::find($this->game_id)->rules_id);\n }", "private function validationRules()\n {\n return [\n 'newPassword' => [\n new PasswordRule($this->newPasswordConfirmation),\n ],\n 'currentPassword' => [\n 'required',\n new PasswordCheckRule($this->user),\n ],\n ];\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "protected function validationRules(): array\n {\n return [\n 'publicId' => 'required',\n 'paymentType' => 'required|numeric|between:1,8',\n 'payments' => 'required'\n ];\n }", "public function getRules() {}", "public function getRules()\n {\n return [\n 'title' => ['requiredFill', 'trim', 'htmlSpecialChars', 'len100'],\n 'content' => ['requiredFill', 'htmlSpecialChars'],\n 'categoryId' => ['requiredFill', 'isInteger'],\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => ['nullable', 'min:3', 'string', 'max:100'],\n 'email' => ['sometimes', 'email:rfc', 'min:8'],\n 'current_password' => ['sometimes', 'nullable', 'min:8', new MatchOldPassword],\n 'new_password' => ['sometimes', 'nullable', 'min:8'],\n 'confirm_new_password' => ['sometimes', 'same:new_password']\n ];\n\n return $rules;\n }", "public function getValidationRules($passthru = null)\n {\n return $this->model->validation($passthru);\n }", "private function getLaravelRules()\n {\n $validator = Validator::make(array(), array());\n\n $r = new ReflectionClass($validator);\n $methods = $r->getMethods();\n\n\n $methods = array_filter($methods, function ($v) {\n if ($v->name == 'validate') {\n return false;\n }\n return strpos($v->name, 'validate') === 0;\n });\n\n\n $rules = array_map(function ($v) {\n $value = preg_replace('%^validate%', '', $v->name);\n $value = Str::snake($value);\n return Str::snake($value);\n }, $methods);\n\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n return $this->initRules(new Calendar());\n }", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $locale = defaultLanguage();\n $rules = [];\n $state = State::where('country_id', $this->country)->get()->toArray();\n\n $rules['institution.'.$locale.'.title'] = 'required';\n $rules['institution.'.$locale.'.description'] = 'required';\n $rules['type_id'] = 'required';\n $rules['country_id'] = 'required';\n $rules['city_id'] = 'required';\n $rules['national_ranking'] = 'required';\n $rules['global_ranking'] = 'required';\n $rules['youtube_url'] = 'required|url';\n $rules['image_name'] = 'required';\n\n if ($state) {\n $rules['state_id'] = 'required';\n }\n return $rules;\n }", "public function rules(): array\n {\n $rules = new ValidationRules();\n\n return [\n 'title' => \"required|min:{$rules->string_min}|max:{$rules->string_max}\",\n 'description' => \"max:{$rules->string_max}\",\n 'division_id' => 'required|exists:divisions,id',\n 'emails' => 'required',\n 'tags' => 'required',\n 'short_content' => \"required|min:{$rules->string_min}\",\n 'full_content' => \"required|min:{$rules->string_min}\",\n 'position' => \"integer|min:{$rules->position_min}|max:{$rules->position_max}\"\n ];\n }" ]
[ "0.86321664", "0.8624515", "0.8618566", "0.8603134", "0.8498762", "0.83887804", "0.8385489", "0.83734876", "0.8298829", "0.8298829", "0.8298829", "0.8298829", "0.8298829", "0.8298829", "0.8282606", "0.82700413", "0.82050955", "0.8193733", "0.81913275", "0.81913275", "0.81913275", "0.81913275", "0.8188931", "0.81716996", "0.8144908", "0.8143179", "0.81199026", "0.8112204", "0.8110668", "0.80950546", "0.8073506", "0.80691594", "0.8048272", "0.80471164", "0.80465007", "0.80423456", "0.8022696", "0.7999882", "0.79920816", "0.7985751", "0.79708475", "0.79287285", "0.792837", "0.7910379", "0.7909017", "0.78908813", "0.7886977", "0.78625685", "0.7829467", "0.77789843", "0.7778882", "0.7764706", "0.773157", "0.77274114", "0.7705378", "0.76992583", "0.7698017", "0.76905406", "0.76755106", "0.7665814", "0.7664706", "0.76627433", "0.76626503", "0.76359993", "0.7620485", "0.7611015", "0.7602139", "0.7591338", "0.7576327", "0.75595945", "0.75571436", "0.75538635", "0.7542599", "0.7540976", "0.75405544", "0.7537523", "0.7522126", "0.75220305", "0.7516978", "0.7511448", "0.7510882", "0.751004", "0.7497131", "0.7483921", "0.7483717", "0.7476633", "0.7464097", "0.7459801", "0.7459328", "0.745487", "0.7447831", "0.74451715", "0.74188584", "0.7410777", "0.7401289", "0.73999494", "0.7398513", "0.7397334", "0.73967195", "0.7394699", "0.73910254" ]
0.0
-1
/ When the post is saved, saves our custom data
function wpcurriculos_save_postdata( $post_id ) { if ( !wp_verify_nonce( $_POST['pessoais_noncename'], plugin_basename(__FILE__) )) { return $post_id;} if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; $textfield2 = $_POST["textfield2"]; delete_post_meta($post_id, 'textfield2'); if (isset($textfield2) && !empty($textfield2)) { add_post_meta($post_id, 'textfield2', $textfield2);} $textfield3 = $_POST["textfield3"]; delete_post_meta($post_id, 'textfield3'); if (isset($textfield3) && !empty($textfield3)) { add_post_meta($post_id, 'textfield3', $textfield3);} $sexo = $_POST["sexo"]; delete_post_meta($post_id, 'sexo'); if (isset($sexo) && !empty($sexo)) { add_post_meta($post_id, 'sexo', $sexo);} $e_civil = $_POST["e_civil"]; delete_post_meta($post_id, 'e_civil'); if (isset($e_civil) && !empty($e_civil)) { add_post_meta($post_id, 'e_civil', $e_civil);} $textfield5 = $_POST["textfield5"]; delete_post_meta($post_id, 'textfield5'); if (isset($textfield5) && !empty($textfield5)) { add_post_meta($post_id, 'textfield5', $textfield5);} $textfield6 = $_POST["textfield6"]; delete_post_meta($post_id, 'textfield6'); if (isset($textfield6) && !empty($textfield6)) { add_post_meta($post_id, 'textfield6', $textfield6);} $textfield7 = $_POST["textfield7"]; delete_post_meta($post_id, 'textfield7'); if (isset($textfield7) && !empty($textfield7)) { add_post_meta($post_id, 'textfield7', $textfield7);} $textfield8 = $_POST["textfield8"]; delete_post_meta($post_id, 'textfield8'); if (isset($textfield8) && !empty($textfield8)) { add_post_meta($post_id, 'textfield8', $textfield8);} $textfield9 = $_POST["textfield9"]; delete_post_meta($post_id, 'textfield9'); if (isset($textfield9) && !empty($textfield9)) { add_post_meta($post_id, 'textfield9', $textfield9);} $select4 = $_POST["select4"]; delete_post_meta($post_id, 'select4'); if (isset($select4) && !empty($select4)) { add_post_meta($post_id, 'select4', $select4);} $select5 = $_POST["select5"]; delete_post_meta($post_id, 'select5'); if (isset($select5) && !empty($select5)) { add_post_meta($post_id, 'select5', $select5);} $select6 = $_POST["select6"]; delete_post_meta($post_id, 'select6'); if (isset($select6) && !empty($select6)) { add_post_meta($post_id, 'select6', $select6);} $select7 = $_POST["select7"]; delete_post_meta($post_id, 'select7'); if (isset($select7) && !empty($select7)) { add_post_meta($post_id, 'select7', $select7);} $ensino = $_POST["ensino"]; delete_post_meta($post_id, 'ensino'); if (isset($ensino) && !empty($ensino)) { add_post_meta($post_id, 'ensino', $ensino);} $textfield10 = $_POST["textfield10"]; delete_post_meta($post_id, 'textfield10'); if (isset($textfield10) && !empty($textfield10)) { add_post_meta($post_id, 'textfield10', $textfield10);} $textfield11 = $_POST["textfield11"]; delete_post_meta($post_id, 'textfield11'); if (isset($textfield11) && !empty($textfield11)) { add_post_meta($post_id, 'textfield11', $textfield11);} $textfield12 = $_POST["textfield12"]; delete_post_meta($post_id, 'textfield12'); if (isset($textfield12) && !empty($textfield12)) { add_post_meta($post_id, 'textfield12', $textfield12);} $textfield13 = $_POST["textfield13"]; delete_post_meta($post_id, 'textfield13'); if (isset($textfield13) && !empty($textfield13)) { add_post_meta($post_id, 'textfield13', $textfield13);} $textfield14 = $_POST["textfield14"]; delete_post_meta($post_id, 'textfield14'); if (isset($textfield14) && !empty($textfield14)) { add_post_meta($post_id, 'textfield14', $textfield14);} $textfield15 = $_POST["textfield15"]; delete_post_meta($post_id, 'textfield15'); if (isset($textfield15) && !empty($textfield15)) { add_post_meta($post_id, 'textfield15', $textfield15);} $textfield16 = $_POST["textfield16"]; delete_post_meta($post_id, 'textfield16'); if (isset($textfield16) && !empty($textfield16)) { add_post_meta($post_id, 'textfield16', $textfield16);} $textfield17 = $_POST["textfield17"]; delete_post_meta($post_id, 'textfield17'); if (isset($textfield17) && !empty($textfield17)) { add_post_meta($post_id, 'textfield17', $textfield17);} $ano = $_POST["ano"]; delete_post_meta($post_id, 'ano'); if (isset($ano) && !empty($ano)) { add_post_meta($post_id, 'ano', $ano);} $textarea = $_POST["textarea"]; delete_post_meta($post_id, 'textarea'); if (isset($textarea) && !empty($textarea)) { add_post_meta($post_id, 'textarea', $textarea);} $atual = $_POST["atual"]; delete_post_meta($post_id, 'atual'); if (isset($atual) && !empty($atual)) { add_post_meta($post_id, 'atual', $atual);} $textfield30 = $_POST["textfield30"]; delete_post_meta($post_id, 'textfield30'); if (isset($textfield30) && !empty($textfield30)) { add_post_meta($post_id, 'textfield30', $textfield30);} $textfield31 = $_POST["textfield31"]; delete_post_meta($post_id, 'textfield31'); if (isset($textfield31) && !empty($textfield31)) { add_post_meta($post_id, 'textfield31', $textfield31);} $textfield32 = $_POST["textfield32"]; delete_post_meta($post_id, 'textfield32'); if (isset($textfield32) && !empty($textfield32)) { add_post_meta($post_id, 'textfield32', $textfield32);} $textfield33 = $_POST["textfield33"]; delete_post_meta($post_id, 'textfield33'); if (isset($textfield33) && !empty($textfield33)) { add_post_meta($post_id, 'textfield33', $textfield33);} $textarea2 = $_POST["textarea2"]; delete_post_meta($post_id, 'textarea2'); if (isset($textarea2) && !empty($textarea2)) { add_post_meta($post_id, 'textarea2', $textarea2);} $profissao = $_POST["profissao"]; delete_post_meta($post_id, 'profissao'); if (isset($profissao) && !empty($profissao)) { add_post_meta($post_id, 'profissao', $profissao);} $textarea3 = $_POST["textarea3"]; delete_post_meta($post_id, 'textarea3'); if (isset($textarea3) && !empty($textarea3)) { add_post_meta($post_id, 'textarea3', $textarea3);} $email = $_POST["email"]; delete_post_meta($post_id, 'email'); if (isset($email) && !empty($email)) { add_post_meta($post_id, 'email', $email);} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save(){\r\n // Need the post type name again\r\n $post_type_name = $this->post_type_name;\r\n\r\n add_action( 'save_post',\r\n function() use( $post_type_name ){\r\n // Deny the WordPress autosave function\r\n if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\r\n\r\n if ( ! wp_verify_nonce( $_POST['custom_post_type'], plugin_basename(__FILE__) ) ) return;\r\n\r\n global $post;\r\n\r\n if( isset( $_POST ) && isset( $post->ID ) && get_post_type( $post->ID ) == $post_type_name ){\r\n global $custom_fields;\r\n\r\n // Loop through each meta box\r\n foreach( $custom_fields as $title => $fields ){\r\n // Loop through all fields\r\n foreach( $fields as $label => $type ){\r\n $field_id_name = strtolower( str_replace( ' ', '_', $title ) ) . '_' . strtolower( str_replace( ' ', '_', $label ) );\r\n if($_POST['custom_meta'][$field_id_name] != ''){//Check Entry is not empty\r\n update_post_meta( $post->ID, $field_id_name, $_POST['custom_meta'][$field_id_name] );\r\n }\r\n }\r\n\r\n }\r\n }\r\n }\r\n );\r\n }", "function _save_post_hook()\n {\n }", "public static function save_custom_post( ) {\n\n\t\t\tglobal $post;\t\n\t\t\t\n\t\t\tif( $_POST ) {\n\t\t\t\tupdate_post_meta( $post->ID, 'meta_menucat', $_POST['cat_id'] );\n\t\t\t\t$price = $_POST['dish_price'] . \".\" . $_POST['dish_price_cents'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice', $price );\n\t\t\t\t$price2 = $_POST['dish_price2'] . \".\" . $_POST['dish_price_cents2'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice2', $price2 );\n\t\t\t\t$type = $_POST['new_dish'] . \"=\" . $_POST['special_dish']. \"=\" . $_POST['hot_dish']. \"=\" . $_POST['spicy_dish']. \"=\" . $_POST['vegetarian_dish'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishtype', $type );\n\t\t\t\t$break = (isset($_POST['breakfast'])) ? \"1\" : \"0\";\n\t\t\t\t$lunch = (isset($_POST['lunch'])) ? \"1\" : \"0\";\n\t\t\t\t$dinner = (isset($_POST['dinner'])) ? \"1\" : \"0\";\n\t\t\t\t$serve = $break . \"=\" . $lunch . \"=\" . $dinner;\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishserve', $serve );\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "protected function _postSave()\r\n\t{\r\n\t}", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "function nsbr_save_custom_data( $post_id ) {\r\n // verify if this is an auto save routine.\r\n // If it is our form has not been submitted, so we dont want to do anything\r\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\r\n return $post_id;\r\n\r\n // verify this came from the our screen and with proper authorization,\r\n // because save_post can be triggered at other times\r\n if ( !isset( $_POST['nsbr_noncename'] ) )\r\n return $post_id;\r\n\r\n if ( !wp_verify_nonce( $_POST['nsbr_noncename'], plugin_basename( __FILE__ ) ) )\r\n return $post_id;\r\n \r\n // Check this is the Contact Custom Post Type\r\n if ( 'nsbr' != $_POST['post_type'] ) {\r\n return $post_id;\r\n }\r\n \r\n // if our current user can't edit this post, bail\r\n if( !current_user_can( 'edit_nsbr' ) ) return $post_id;\r\n\r\n $boat = new nmmc_nsbr_helper();\r\n // OK to save meta data\r\n $history = $_POST['history'];\r\n $boat->save_boat_history($post_id, $history);\r\n \r\n $gallery = $_POST['gallery'];\r\n $boat->save_boat_gallery($post_id,$gallery);\r\n \r\n $nsbr_reg_no = sanitize_text_field( $_POST['nsbr_reg_no'] );\r\n $boat->save_boat_nsbr_registration($post_id,$nsbr_reg_no);\r\n\r\n \r\n $length_m = sanitize_text_field( $_POST['nsbr_length_m'] );\r\n update_post_meta( $post_id, '_nsbr_length_m', $length_m );\r\n \r\n $length_ft = sanitize_text_field( $_POST['nsbr_length_ft'] );\r\n update_post_meta( $post_id, '_nsbr_length_ft', $length_ft );\r\n \r\n $breadth_m = sanitize_text_field( $_POST['nsbr_breadth_m'] );\r\n update_post_meta( $post_id, '_nsbr_breadth_m', $breadth_m );\r\n \r\n $breadth_ft = sanitize_text_field( $_POST['nsbr_breadth_ft'] );\r\n update_post_meta( $post_id, '_nsbr_breadth_ft', $breadth_ft );\r\n \r\n $location = sanitize_text_field( $_POST['nsbr_location'] );\r\n update_post_meta( $post_id, '_nsbr_location', $location );\r\n \r\n $current_use = sanitize_text_field( $_POST['nsbr_current_use'] );\r\n update_post_meta( $post_id, '_nsbr_current_use', $current_use );\r\n \r\n $build_date = sanitize_text_field( $_POST['nsbr_build_date'] );\r\n update_post_meta( $post_id, '_nsbr_build_date', $build_date );\r\n \r\n $copyright = sanitize_text_field( $_POST['nsbr_copyright'] );\r\n update_post_meta( $post_id, '_nsbr_copyright', $copyright );\r\n}", "public function savePostData( $post_id ) {\n global $post;\n // verify if this is an auto save routine. \n // If it is our form has not been submitted, so we dont want to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n \n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n \n // Check permissions\n \n if ( !current_user_can( 'edit_post', $post->ID) )\n return;\n \n // OK, we're authenticated: we need to find and save the data\n if(!empty($this->meta_box_fields_formats) && is_array($this->meta_box_fields_formats)):\n foreach($this->meta_box_fields_formats as $field => $format):\n if($_POST[$field]):\n switch( $format ):\n case \"datetime\":\n update_post_meta($post->ID, $field, date(\"Y-m-d H:i:s\", strtotime( $_POST[$field] ) ) );\n break;\n case \"date\":\n update_post_meta($post->ID, $field, date(\"Y-m-d\", strtotime( $_POST[$field] ) ) );\n break;\n case \"section\":\n break;\n default:\n update_post_meta($post->ID, $field, $_POST[$field]);\n break;\n endswitch;\n else:\n if( get_post_meta($post->ID, $field, true) ):\n delete_post_meta($post->ID, $field); // Useful for Checkboxes. Delete completely.\n endif;\n endif;\n endforeach;\n endif;\n // Do something with $mydata \n // probably using add_post_meta(), update_post_meta(), or \n // a custom table (see Further Reading section below)\n }", "public static function save_meta_data($post_id)\n {\n $standardMetaValues = array(\"label\", \"link\", \"priority\");\n parent::save_standard_meta_values($standardMetaValues, $post_id);\n }", "public function plc_save_custom_post_meta($post_id)\n {\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n return;\n\n // if our nonce isn't there, or we can't verify it, bail\n if (!isset($_POST['plc_nonce']) || !wp_verify_nonce($_POST['plc_nonce'], 'my_plc_nonce'))\n return;\n\n // if our current user can't edit this post, bail\n if (!current_user_can('edit_post'))\n return;\n\n // now we can actually save the data\n $allowed = array(\n 'a' => array(// on allow a tags\n 'href' => array() // and those anchords can only have href attribute\n )\n );\n update_post_meta($post_id, '_notification_head_template', $_POST['notification_head_template']);\n update_post_meta($post_id, '_notification_template', $_POST['notification_template']);\n }", "function foodpress_save_meta_data($post_id, $post){\n\t\t\tglobal $pagenow;\n\n\t\t\tif ( empty( $post_id ) || empty( $post ) ) return;\n\t\t\tif($post->post_type!='menu') return;\n\t\t\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\t\t// Prevent quick edit from clearing custom fields\n\t\t\tif (defined('DOING_AJAX') && DOING_AJAX) return;\n\t\t\tif ( is_int( wp_is_post_revision( $post ) ) ) return;\n\t\t\tif ( is_int( wp_is_post_autosave( $post ) ) ) return;\n\t\t\t\n\t\t\t// verify this came from the our screen and with proper authorization,\n\t\t\t// because save_post can be triggered at other times\n\t\t\tif( isset($_POST['fp_noncename']) ){\n\t\t\t\tif ( !wp_verify_nonce( $_POST['fp_noncename'], plugin_basename( __FILE__ ) ) ){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t$_allowed = array( 'post-new.php', 'post.php' );\n\t\t\tif(!in_array($pagenow, $_allowed)) return;\n\n\t\t\t/* Get the post type object. */\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\t\n\t\t\t\n\t\t\t// Check permissions\n\t\t\tif ( !current_user_can( $post_type->cap->edit_post, $post_id ) )\n\t\t\t\treturn;\t\n\n\t\t\t\n\t\t\t//save the post meta values\n\t\t\t//$fields_ar =apply_filters();\n\t\t\t\n\t\t\t$meta_fields = $this->foodpress_menu_metabox_array();\t\t\t\n\t\t\t\n\t\t\t// run through all the custom meta fields\n\t\t\tforeach($meta_fields as $mb=>$f_val){\n\t\t\t\t\n\t\t\t\tif(!empty($f_val)){\n\t\t\t\t\tif( $f_val['type']=='multiinput'){\n\t\t\t\t\t\tforeach($f_val['ids'] as $fvals){\n\t\t\t\t\t\t\t$this->fp_individual_post_values($fvals, $post_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->fp_individual_post_values($f_val['id'], $post_id);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//update_post_meta($post_id, 'test', $_POST['fp_menuicons']);\n\t\t\t\n\t\t\t// save user closed meta field boxes\n\t\t\t$fp_closemeta_value = (isset($_POST['fp_collapse_meta_boxes']))? $_POST['fp_collapse_meta_boxes']: '';\n\t\t\t\n\t\t\tfoodpress_save_collapse_metaboxes($post_id, $fp_closemeta_value );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// (---) hook for addons\n\t\t\tdo_action('foodpress_save_meta', $post_id);\t\n\t\t\t\t\n\t\t}", "function save_post($post_id) {\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) \n return;\n ## do nothing if not my post_type\n if (!isset($_POST['post_type']) || $_POST['post_type'] != $this->post_type)\n return;\n ## CSRF (nonce) validation\n if (!wp_verify_nonce($_POST[$this->post_type . '_nonce'], $this->post_type))\n return;\n ## authorization\n if (!current_user_can('edit_post', $post_id))\n return;\n ## format save data\n $data = $this->_normalize_data($_POST['ct']);\n ## data validation\n $ret = $this->_validate_data($data);\n if (count($ret['errors']) > 0) {\n $this->view->form = $ret['form'];\n $this->view->errors = $ret['errors'];\n $msg = $this->view->render('validate-error.php');\n wp_die($msg, 'validation error');\n }\n ## save\n update_post_meta($post_id, $this->post_type, $data);\n return;\n }", "protected function save_meta() {}", "static function save($post_id, $post)\n {\n $class_name = get_called_class();\n\n // Return if the user doesn't have edit permissions.\n if (!current_user_can('edit_post', $post_id)) {\n return $post_id;\n }\n\n // Verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times.\n //if (!isset($_POST['cat_fields']) || !wp_verify_nonce($_POST['cat_fields'], basename(__FILE__))) {\n // return $post_id;\n //}\n\n $meta = [];\n\n // Now that we're authenticated, time to save the data.\n // This sanitizes the data from the field and saves it into an array $meta.\n foreach ($class_name::META as $key){\n if (isset($_POST[$key]))\n $meta[$key] = esc_textarea($_POST[$key]);\n }\n\n // Cycle through the $meta array.\n // Note, in this example we just have one item, but this is helpful if you have multiple.\n foreach ($meta as $key => $value) :\n\n // Don't store custom data twice\n if ('revision' === $post->post_type) {\n return;\n }\n\n if (get_post_meta($post_id, $key, false)) {\n // If the custom field already has a value, update it.\n update_post_meta($post_id, $key, $value);\n } else {\n // If the custom field doesn't have a value, add it.\n add_post_meta($post_id, $key, $value);\n }\n\n if (!$value) {\n // Delete the meta key if there's no value\n delete_post_meta($post_id, $key);\n }\n\n endforeach;\n\n }", "private function PostSaver(){\n if ($this->updateMode){\n $post = Post::find($this->postId);\n } else {\n $post = new Post();\n }\n $post->user_id = Auth::user()->id;\n $post->title = $this->title;\n $post->category_id = (int)$this->categories;\n $post->caption = $this->caption;\n $post->url = $this->imagePath;\n $post->save();\n $post->Tag()->sync($this->tags);\n }", "function textbook_save_data() {\r\n global $post;\r\n update_post_meta($post->ID, 'textbook_pub',\r\n\t\t $_POST['textbook_pub']);\r\n update_post_meta($post->ID, 'textbook_author',\r\n\t\t $_POST['textbook_author']);\r\n update_post_meta($post->ID, 'textbook_date',\r\n\t\t $_POST['textbook_date']);\r\n}", "public function postSave() {}", "function SavePost()\n\t{\n\t\n\t\t// wordpress global\n\t\tglobal $post;\n\t\t\n\t\t// this first check is, I feel, a hack: why should SavePost run on page load?\n\t\tif ( isset( $_POST['tlsp_noncename'] ) )\n\t\t{\n\t\t\n\t\t\t// run the following checks:\n\t\t\tif (\n\t\t\t\t// validate the nonce\n\t\t\t\t( wp_verify_nonce( $_POST['tlsp_noncename'], plugin_basename(__FILE__) ) )\n\t\t\t\t// make sure this is not an autosave\n\t\t\t\t&& ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) == false )\n\t\t\t\t// check user permissions\n\t\t\t\t&& ( current_user_can( 'edit_post', $post_id ) )\n\t\t\t\t// check that the element exists\n\t\t\t\t&& ( isset ( $_POST['tlsp_text'] ) )\n\t\t\t)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// if there is data, update the meta field\n\t\t\t\tif ( $_POST['tlsp_text'] != '' )\n\t\t\t\t{\n\t\t\t\t\tupdate_post_meta( $post->ID, 'tlsp_text', $_POST['tlsp_text'] );\n\t\t\t\t}\n\t\t\t\t// otherwise delete the table row, for a cleaner database\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete_post_meta( $post->ID, 'tlsp_text' );\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t// if the checks fail, return an error\n\t\t\telse\n\t\t\t{\n\t\t\t\t// TODO: This error does not show up yet\n\t\t\t\techo '<div id=\"message\" class=\"error\">Error on saving meta data!</div>';\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "function volpress_save_postdata( $post_id ) {\n\n\t// First we need to check if the current user is authorised to do this action. \n\tif ( 'page' == $_POST['post_type'] ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) )\n\t\t\t\treturn;\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\t\treturn;\n\t}\n\n\t// Secondly we need to check if the user intended to change this value.\n\tif ( ! isset( $_POST['volpress_noncename'] ) || ! wp_verify_nonce( $_POST['volpress_noncename'], plugin_basename( __FILE__ ) ) )\n\t\t\treturn;\n\n\t// Thirdly we can save the value to the database\n\n\t//if saving in a custom table, get post_ID\n\t$post_ID = $_POST['post_ID'];\n\t//sanitize user input\n\t$mydata = sanitize_text_field( $_POST['volpress_new_field'] );\n\n\t// Do something with $mydata \n\t// either using \n\tadd_post_meta($post_ID, '_my_meta_value_key', $mydata, true) or\n\t\tupdate_post_meta($post_ID, '_my_meta_value_key', $mydata);\n\t// or a custom table (see Further Reading section below)\n}", "function save_post()\n \t{\n \t\treturn $this->class_post->save_post();\n \t}", "function _acf_do_save_post($post_id = 0)\n{\n}", "public function before_save_post( $post_data, $post_attr ) {\n\n\t\t// detect autosave\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// security\n\t\tif ( ! isset( $_POST['publisher_post_fields_nonce'] ) ||\n\t\t ! wp_verify_nonce( $_POST['publisher_post_fields_nonce'], 'publisher-post-fields-nonce' ) ||\n\t\t ! $this->current_user_can_edit( $post_attr['ID'], $post_data['post_type'] )\n\t\t) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// Post type supports excerpt\n\t\tif ( ! $this->excerpt && ! post_type_supports( $post_data['post_type'], 'excerpt' ) ) {\n\t\t\treturn $post_data;\n\t\t}\n\n\t\t// Save lead into excerpt\n\t\tif ( isset( $post_attr['bs-post-excerpt'] ) ) {\n\t\t\t$post_data['post_excerpt'] = $post_attr['bs-post-excerpt'];\n\t\t\tunset( $post_attr['bs-post-excerpt'] );\n\t\t}\n\n\t\treturn $post_data;\n\t}", "function wpbm_extra_field_save( $post_id ){\n\n// Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'wpbm_blog_nonce' ] ) && wp_verify_nonce( $_POST[ 'wpbm_blog_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n// Exits script depending on save status\n if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {\n return;\n }\n if ( isset( $_POST[ 'wpbm_extra_option' ] ) ) {\n\n $wpbm_extra = ( array ) $_POST[ 'wpbm_extra_option' ];\n\n $extra_field = $this -> sanitize_array( $wpbm_extra );\n// save data\n update_post_meta( $post_id, 'wpbm_extra_option', $extra_field );\n }\n return;\n }", "public static function on_post_save( $post_id )\n {\n \n // don't auto save custom post items\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;\n\n \t$post = get_post( $post_id );\n \tif( 'property' != $post->post_type ) return $post_id;\n\n \tif ( !wp_verify_nonce($_POST['wp_meta_box_nonce'], NONCE_STRING ) ) return $post_id;\n\n \t// can the user do this? if not, bail...\n \tif ( !current_user_can( 'edit_posts', $post_id ) ) return $post_id;\n\n \tif( count( $_REQUEST ) > 0 ){\n \t apc_delete('get_all_properties_idx');\n \t apc_delete('property_type');\n \t \n \t apc_delete('all_property_type_Rent_ids');\n \t apc_delete('all_property_type_Sale_ids');\n \t \n \t apc_delete( 'idx_post_' . $post_id);\n \t apc_delete('small_genPropertyArray_' . $post_id );\n \t apc_delete('genPropertyArray_' . $post_id );\n \t \n \t // ThemeUtil::mpuke_ta(print_r($_REQUEST, 1)); exit;\n \t // ThemeUtil::log_something(print_r($_REQUEST, 1));\n \t \n \t ThemeAdmin::idx_and_save( $post_id, 'garage', $_REQUEST['garage'] );\n \t ThemeAdmin::idx_and_save( $post_id, 'neighborhood', $_REQUEST['neighborhood'] );\n \t ThemeAdmin::idx_and_save( $post_id, 'part_of_town', $_REQUEST['part_of_town'] );\n \n \t$address \t\t = $_REQUEST['address']; \n \tupdate_post_meta( $post_id, 'address', $address );\n \t\n \t$lat \t\t = $_REQUEST['lat']; \n \tupdate_post_meta( $post_id, 'lat', $lat );\n \t\n \t$lng \t\t = $_REQUEST['lng']; \n \tupdate_post_meta( $post_id, 'lng', $lng );\n \t\n \t// update_post_meta( $post_id, 'city', $_REQUEST['city'] );\n \tThemeAdmin::idx_and_save( $post_id, 'city', $_REQUEST['city'] );\n \t\n \tupdate_post_meta( $post_id, 'state', $_REQUEST['state'] );\n \t\n \tThemeAdmin::idx_and_save( $post_id, 'postal_code', $_REQUEST['postal_code'] );\n \t\n // $occupancy_type = $_REQUEST['occupancy_type']; \n // update_post_meta( $post_id, 'occupancy_type', $occupancy_type );\n ThemeAdmin::idx_and_save( $post_id, 'occupancy_type', $_REQUEST['occupancy_type'] );\n \n \t$featured \t\t = $_REQUEST['featured']; \n \tupdate_post_meta( $post_id, 'featured', $featured );\n \t\n // $square_footage = $_REQUEST['square_footage']; \n // update_post_meta( $post_id, 'square_footage', $square_footage );\n ThemeAdmin::idx_and_save( $post_id, 'square_footage', $_REQUEST['square_footage'] );\n \t\n // $stories = $_REQUEST['stories']; \n // update_post_meta( $post_id, 'stories', $stories );\n ThemeAdmin::idx_and_save( $post_id, 'stories', $_REQUEST['stories'] );\n \t\n \tThemeAdmin::idx_and_save( $post_id, 'hardwood_floors', $_REQUEST['hardwood_floors'] );\n \t\n \t$age \t\t = $_REQUEST['age']; \n \tupdate_post_meta( $post_id, 'age', $age );\n \t// ThemeAdmin::idx_and_save( $post_id, 'stories', $_REQUEST['stories'] );\n \t\n \t$num_beds \t\t = $_REQUEST['num_beds']; \n \tupdate_post_meta( $post_id, 'num_beds', $num_beds );\n \t\n \t$num_baths \t\t = $_REQUEST['num_baths']; \n \tupdate_post_meta( $post_id, 'num_baths', $num_baths );\n \t\n \t$price \t\t = $_REQUEST['price']; \n update_post_meta( $post_id, 'price', $price );\n \n ThemeAdmin::idx_and_save( $post_id, 'parking', $_REQUEST['parking'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'fridge', $_REQUEST['fridge'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'oven', $_REQUEST['oven'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'dwasher', $_REQUEST['dwasher'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'forced_air', $_REQUEST['forced_air'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'central_air', $_REQUEST['central_air'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'central_heat', $_REQUEST['central_heat'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'near_shopping', $_REQUEST['near_shopping'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'near_school', $_REQUEST['near_school'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'near_transit', $_REQUEST['near_transit'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'handicap_accessible', $_REQUEST['handicap_accessible'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'lease_option', $_REQUEST['lease_option'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'aware_compliant', $_REQUEST['aware_compliant'] );\n \n // ThemeAdmin::idx_and_save( $post_id, 'development', $_REQUEST['development'] );\n\t \n\t\tdelete_post_meta($post_id, 'development');\n\t\tif(is_array($_REQUEST['development'])) {\n\t\t\tforeach($_REQUEST['development'] as $d) {\n\t\t\t\tadd_post_meta( $post_id, 'development', $d );\n\t\t\t}\n\t\t}\n \n ThemeAdmin::idx_and_save( $post_id, 'status', $_REQUEST['status'] );\n \t\n \t// ThemeAdmin::idx_and_save( $post_id, 'project', $_REQUEST['project'] );\n \t\n \tThemeAdmin::idx_and_save( $post_id, 'property_type', $_REQUEST['property_type'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'project_type', $_REQUEST['project_type'] );\n \n \t \n \t ThemeAdmin::idx_and_save( $post_id, 'wd_hookup', $_REQUEST['wd_hookup'] );\n \t\n ThemeAdmin::idx_and_save( $post_id, 'laundry', $_REQUEST['laundry'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'balcony', $_REQUEST['balcony'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'deck', $_REQUEST['deck'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'patio', $_REQUEST['patio'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'yard', $_REQUEST['yard'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'cable', $_REQUEST['cable'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'resident_services', $_REQUEST['resident_services'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'playground', $_REQUEST['playground'] );\n\n update_post_meta( $post_id, 'management_company', $_REQUEST['management_company'] );\n \n update_post_meta( $post_id, 'management_phone', $_REQUEST['management_phone'] );\n \n update_post_meta( $post_id, 'management_web', $_REQUEST['management_web'] );\n\n ThemeAdmin::idx_and_save( $post_id, 'pets_allowed', $_REQUEST['pets_allowed'] );\n\n ThemeAdmin::idx_and_save( $post_id, 'senior_community', $_REQUEST['senior_community'] );\n \t \n ThemeAdmin::idx_and_save( $post_id, 'paid_utilities', $_REQUEST['paid_utilities'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'short_term_lease', $_REQUEST['short_term_lease'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'on_site_maintenance', $_REQUEST['on_site_maintenance'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'alarm_system', $_REQUEST['alarm_system'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'tax_incentives', $_REQUEST['tax_incentives'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'first_floor_master', $_REQUEST['first_floor_master'] );\n\n ThemeAdmin::idx_and_save( $post_id, 'dining_room', $_REQUEST['dining_room'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'laundry_room', $_REQUEST['laundry_room'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'basement', $_REQUEST['basement'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'family_room', $_REQUEST['family_room'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'den_office', $_REQUEST['den_office'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'fireplace', $_REQUEST['fireplace'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'corner_lot', $_REQUEST['corner_lot'] );\n \n ThemeAdmin::idx_and_save( $post_id, 'cul_de_sac', $_REQUEST['cul_de_sac'] );\n \n update_post_meta( $post_id, 'lot_size', $_REQUEST['lot_size'] );\n \n // $all_props = \n \t}\n \t\n }", "function sample_save_metabox( $post_id, $post ) {\n\t// Add nonce for security and authentication.\n\t$nonce_name = isset( $_POST['custom_nonce'] ) ? $_POST['custom_nonce'] : '';\n\t$nonce_action = 'custom_nonce_action';\n\n\t// Check if nonce is set.\n\tif ( ! isset( $nonce_name ) ) {\n\t\treturn;\n\t}\n\n\t// Check if nonce is valid.\n\tif ( ! wp_verify_nonce( $nonce_name, $nonce_action ) ) {\n\t\treturn;\n\t}\n\n\t// Check if user has permissions to save data.\n\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\treturn;\n\t}\n\n\t// Check if not an autosave.\n\tif ( wp_is_post_autosave( $post_id ) ) {\n\t\treturn;\n\t}\n\n\t// Check if not a revision.\n\tif ( wp_is_post_revision( $post_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! isset( $_POST['notes'] ) ) {\n\t\treturn;\n\t}\n\n\tupdate_post_meta( $post_id, 'notes', wp_unslash( sanitize_text_field( $_POST['notes'] ) ) );\n}", "function save_meta_box_custompost( $post_id ) {\n if ( defined( 'DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;\n if ( $parent_id = wp_is_post_revision( $post_id ) ) {\n $post_id = $parent_id;\n }\n $fields = ['published_date'];\n foreach ( $fields as $field ) {\n if ( array_key_exists( $field, $_POST ) ) {\n update_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) );\n }\n }\n }", "public function save()\n {\n remove_action('save_post', array($this, 'save'), 999);\n add_filter('wp_save_post_revision_post_has_changed', function () {\n return false;\n }, 99999);\n global $post;\n if (is_a($post, '\\WP_Post')) {\n $postArgs = array(\n 'ID' => $post->ID,\n 'post_content' => $this->content\n );\n wp_update_post($postArgs);\n\n $rev = wp_get_post_revisions($post);\n if (!empty($rev)) {\n $last = current($rev);\n $postArgs = array(\n 'ID' => $last->ID,\n 'post_content' => $this->content\n );\n wp_update_post($postArgs);\n }\n\n do_action('kb.concat.save', $postArgs);\n }\n\n }", "static function save_metabox_data($post_id){\n\t\t\t// If this is an autosave, our form has not been submitted, so we don't want to do anything.\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$keywords = array();\t\t\t\n\t\t\t//now it's safe to save info\n\t\t\tif(isset($_POST['affiliate_keywords'])){\n\t\t\t\tforeach($_POST['affiliate_keywords'] as $key => $value){\n\t\t\t\t\t$keywords[$key] = trim($value);\n\t\t\t\t}\n\t\t\t\tself::save_keywords($post_id, $keywords);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['local_position_enabled'])){\n\t\t\t\tupdate_post_meta($post_id, 'local_position_enabled', 'y');\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupdate_post_meta($post_id, 'local_position_enabled', '');\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['position'])){\n\t\t\t\t$positions = array();\n\t\t\t\tforeach($_POST['position'] as $key => $value){\n\t\t\t\t\t$positions[$key] = $value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tupdate_post_meta($post_id, 'local_positions', $positions);\n\t\t\t}\n\t\t\t\n\t\t\t//saving loal links\n\t\t\tif(isset($_POST['local_links'])){\n\t\t\t\tupdate_post_meta($post_id, 'local_links', $_POST['local_links']);\n\t\t\t}\n\t\t}", "function portfolioism_meta_save( $post_id ) {\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'portfolioism_valid_nonce' ]) && wp_verify_nonce( $_POST['poortfolioism_valid_nonce'], basename(__FILE__) ) ) ? 'true' : 'false';\n \n if ( $is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n if ( isset( $_POST['medium'] ) ) {\n update_post_meta($post_id, 'medium', sanitize_text_field($_POST['medium'] ) );\n }\n\n if ( isset ($_POST['height'] ) ) {\n update_post_meta($post_id, 'height', sanitize_text_field($_POST['height'] ) );\n }\n}", "public function save(Post $post): void;", "function dfd_post_save_postdata( $post_id ) {\n\n /*\n * We need to verify this came from the our screen and with proper authorization,\n * because save_post can be triggered at other times.\n */\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['dfd_post_inner_custom_box_nonce'] ) )\n return $post_id;\n\n $nonce = $_POST['dfd_post_inner_custom_box_nonce'];\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $nonce, 'dfd_post_inner_custom_box' ) )\n return $post_id;\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n return $post_id;\n\n // Check the user's permissions.\n if ( 'page' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) )\n return $post_id;\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) )\n return $post_id;\n }\n\n /* OK, its safe for us to save the data now. */\n\n // Sanitize user input.\n $mydata = $_POST['my_post_image_gallery'];\n\n // Update the meta field in the database.\n update_post_meta( $post_id, '_my_post_image_gallery', $mydata );\n}", "public function onsave() {\n\n\tif( filter_input( INPUT_POST, 'content' ) ) {\n\t global $post;\n do_shortcode( stripslashes( filter_input( INPUT_POST, 'content' ) ) );\n\t if( isset( $this->shortcode['elements'] ) ) {\n $this->assign_repeatable();\n }\n $meta = get_post_meta( $post->ID, 'pwp_form', true );\n $meta['definition'] = $this->shortcode;\n update_post_meta( $post->ID, 'definition', $meta );\n }\n }", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_TOTAL_KEY, $this->total_reports );\n\t}", "function ydd_save_custom_data( $post_id ) {\r\n // verify if this is an auto save routine.\r\n // If it is our form has not been submitted, so we dont want to do anything\r\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\r\n return $post_id;\r\n\r\n // verify this came from the our screen and with proper authorization,\r\n // because save_post can be triggered at other times\r\n if ( !isset( $_POST['ydd_noncename'] ) )\r\n return $post_id;\r\n\r\n if ( !wp_verify_nonce( $_POST['ydd_noncename'], plugin_basename( __FILE__ ) ) )\r\n return $post_id;\r\n \r\n // Check this is the Contact Custom Post Type\r\n if ( 'ydd' != $_POST['post_type'] ) {\r\n return $post_id;\r\n }\r\n \r\n // if our current user can't edit this post, bail\r\n if( !current_user_can( 'edit_ydd' ) ) return $post_id;\r\n\r\n $ydd = new nmmc_ydd_helper();\r\n // OK to save meta data\r\n \r\n $ydd_year_month = sanitize_text_field( $_POST['ydd_year_month'] );\r\n $ydd->save_ydd_year_month($post_id,$ydd_year_month);\r\n\r\n \r\n $ydd_page = sanitize_text_field( $_POST['ydd_page'] );\r\n $ydd->save_ydd_page($post_id,$ydd_page);\r\n \r\n $ydd_id = sanitize_text_field( $_POST['ydd_id'] );\r\n $ydd->save_ydd_id($post_id,$ydd_id);\r\n}", "function meta_boxes_save() {\r\n\t\t\r\n\t\t// Only process if the form has actually been submitted\r\n\t\tif (\r\n\t\t\tisset( $_POST['_wpnonce'] ) &&\r\n\t\t\tisset( $_POST['post_ID'] )\r\n\t\t) {\r\n\t\t\t\r\n\t\t\t// Do nonce security check\r\n\t\t\twp_verify_nonce( '_wpnonce', $_POST['_wpnonce'] );\r\n\t\t\t\r\n\t\t\t// Grab post ID\r\n\t\t\t$post_ID = (int) $_POST['post_ID'];\r\n\t\t\t\r\n\t\t\t// Iterate through each possible piece of meta data\r\n\t\t\tforeach( $this->post_meta as $key => $value ) {\r\n\t\t\t\tif ( isset( $_POST['_' . $key] ) ) {\r\n\t\t\t\t\t$data = esc_html( $_POST['_' . $key] ); // Sanitise data input\r\n\t\t\t\t\tupdate_post_meta( $post_ID, '_' . $key, $data ); // Store the data\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function save_my_meta_box_data2( $post_id ) {\n\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['post_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['post_meta_box_nonce'], 'post_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, it's safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['second_title'] ) ) {\n return;\n }\n // Make sure that it is set.\n if ( ! isset( $_POST['fexid'] ) ) {\n return;\n }\n // Make sure that it is set.\n if ( ! isset( $_POST['po_sources'] ) ) {\n return;\n }\n\n // Sanitize user input.\n $my_sec_title = sanitize_text_field( $_POST['second_title'] );\n $my_post_sources = sanitize_text_field( $_POST['po_sources'] );\n $my_fexid = sanitize_text_field( $_POST['fexid'] );\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'post_second_title', $my_sec_title );\n update_post_meta( $post_id, 'post_sources', $my_post_sources );\n update_post_meta( $post_id, 'post_fexid', $my_fexid );\n}", "function bfa_ata_save_postdata( $post_id ) {\r\n\r\n /* verify this came from the our screen and with proper authorization,\r\n because save_post can be triggered at other times */\r\n// Before using $_POST['value'] \r\nif (isset($_POST['bfa_ata_noncename'])) \r\n{ \r\n\r\n\tif ( !wp_verify_nonce( $_POST['bfa_ata_noncename'], plugin_basename(__FILE__) )) {\r\n\t\treturn $post_id;\r\n\t}\r\n\r\n\tif ( 'page' == $_POST['post_type'] ) {\r\n\t\tif ( !current_user_can( 'edit_page', $post_id ))\r\n\t\t\treturn $post_id;\r\n\t} else {\r\n\t\tif ( !current_user_can( 'edit_post', $post_id ))\r\n\t\t\treturn $post_id;\r\n\t\t}\r\n\r\n\t// Save the data\r\n\t\r\n\t$new_body_title = $_POST['bfa_ata_body_title'];\r\n\t$new_display_body_title = !isset($_POST[\"bfa_ata_display_body_title\"]) ? NULL : $_POST[\"bfa_ata_display_body_title\"];\r\n\t$new_body_title_multi = $_POST['bfa_ata_body_title_multi'];\r\n\t$new_meta_title = $_POST['bfa_ata_meta_title'];\r\n\t$new_meta_keywords = $_POST['bfa_ata_meta_keywords'];\r\n\t$new_meta_description = $_POST['bfa_ata_meta_description'];\r\n\r\n\tupdate_post_meta($post_id, 'bfa_ata_body_title', $new_body_title);\r\n\tupdate_post_meta($post_id, 'bfa_ata_display_body_title', $new_display_body_title);\r\n\tupdate_post_meta($post_id, 'bfa_ata_body_title_multi', $new_body_title_multi);\r\n\tupdate_post_meta($post_id, 'bfa_ata_meta_title', $new_meta_title);\r\n\tupdate_post_meta($post_id, 'bfa_ata_meta_keywords', $new_meta_keywords);\r\n\tupdate_post_meta($post_id, 'bfa_ata_meta_description', $new_meta_description);\r\n\r\n}}", "public function saving(Post $post)\n {\n $post->content_type = 'post';\n \n cache_delete('content');\n }", "public function save_custom_meta_data( $post_id ) {\n\n\t\t$is_valid_nonce = ( isset( $_POST[ $this->nonce ] ) && wp_verify_nonce( sanitize_text_field( $_POST[ $this->nonce ] ), plugin_basename( __FILE__ ) ) );\n\t\t// First, make sure the user can save the post\n\t\tif ( $is_valid_nonce && $this->user_can_save( $post_id ) ) {\n\n\t\t\t// Did the user set an expiry date, or are they clearing an old one?\n\t\t\tif ( ! empty( $_POST['sailthru_post_expiration'] ) && isset( $_POST['sailthru_post_expiration'] ) \n\t\t\t\t|| get_post_meta( $post_id, 'sailthru_post_expiration', true ) ) {\n\n\t\t\t\t$expiry_time = strtotime( sanitize_text_field( $_POST['sailthru_post_expiration'] ) );\n\t\t\t\tif ( $expiry_time ) {\n\t\t\t\t\t$expiry_date = date( 'Y-m-d', $expiry_time );\n\n\t\t\t\t\t// Save the date. hehe.\n\t\t\t\t\tupdate_post_meta( $post_id, 'sailthru_post_expiration', $expiry_date );\n\t\t\t\t}\n\t\t\t} // end if\n\n\t\t\t// Did the user set some meta tags, or are they clearing out old tags?\n\t\t\tif ( ! empty( $_POST['sailthru_meta_tags'] ) && isset( $_POST['sailthru_meta_tags'] )\n\t\t\t\t|| get_post_meta( $post_id, 'sailthru_meta_tags', true ) ) {\n\n\t\t\t\t//remove trailing comma\n\t\t\t\t$meta_tags = rtrim( sanitize_text_field( $_POST['sailthru_meta_tags'] ), ',' );\n\t\t\t\tupdate_post_meta( $post_id, 'sailthru_meta_tags', $meta_tags );\n\n\t\t\t}\n\t\t} // end if\n\n\t}", "function rps_save_custom_meta() {\n\tglobal $post;\n\n\t// Stops WP from clearing post meta when autosaving\n\tif( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {\n\t return $post->ID;\n\t}\n\tif (isset($_POST['rps-url'])) {\n\t\t$clean = esc_url_raw($_POST['rps-url']);\n\t\tupdate_post_meta($post->ID, '_url' , $clean);\n\t}\n\tif (isset($_POST['rps-tagline'])) {\n\t\t$realclean = sanitize_text_field($_POST['rps-tagline']);\n\t\tupdate_post_meta($post->ID, '_tagline' , $realclean);\n\t}\n\n}", "function prfx_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'prfx_nonce' ] ) && wp_verify_nonce( $_POST[ 'prfx_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n \r\n // Checks for input and sanitizes/saves if needed\r\n if( isset( $_POST[ 'meta-text' ] ) ) {\r\n update_post_meta( $post_id, 'meta-text', sanitize_text_field( $_POST[ 'meta-text' ] ) );\r\n }\r\n \r\n}", "public function meta_box_save_postdata( $post_id ) \n\t\t{\n\t\t\tglobal $post;\n\t\t\t\n\t\t\tif( isset($post) ) {\n\t\t\t\t// do not save if this is an auto save routine\n\t\t\t\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n\t\t\t\t\treturn $post_id;\n\t\t\t\t\t\n\t\t\t\tif($post->post_type == 'partners'){\n\t\t\t\t\t\n\t\t\t\t\t$partner_url = isset($_POST[\"partner_url\"]) ? $_POST[\"partner_url\"] : '';\n\t\t\t\t\tupdate_post_meta( $post_id, '_partner_url', $partner_url ); \n\t\t\t\t\t\n\t\t\t\t\t$partner_image = isset($_POST[\"partner_image\"]) ? $_POST[\"partner_image\"] : '';\n\t\t\t\t\tupdate_post_meta( $post_id, '_partner_image', $partner_image ); \n\t\t\t\t}\n\t\t\t}\n\t\t}", "function savePostMeta($post_id)\n\t\t{\n\t\t\t$dataMetas = self::getDataMetas();\n\n\t\t\tforeach ($dataMetas as $key => $meta) {\n\t\t\t\t$nameMeta = $meta['_name_meta_box'];\n\t\t\t\tif ( isset($_POST[$nameMeta]) ) { \n\t\t\t\t\tupdate_post_meta( $post_id, $nameMeta, $_POST[$nameMeta] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "public function save( $post_id ) {\n \n /*\n * We need to verify this came from the our screen and with proper authorization,\n * because save_post can be triggered at other times.\n */\n \n // Check if our nonce is set.\n if ( ! isset( $_POST['myplugin_inner_custom_box_nonce'] ) ) {\n return $post_id;\n }\n \n $nonce = $_POST['myplugin_inner_custom_box_nonce'];\n \n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $nonce, 'myplugin_inner_custom_box' ) ) {\n return $post_id;\n }\n \n /*\n * If this is an autosave, our form has not been submitted,\n * so we don't want to do anything.\n */\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return $post_id;\n }\n \n // Check the user's permissions.\n if ( 'page' == $_POST['post_type'] ) {\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return $post_id;\n }\n } else {\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n }\n \n /* OK, it's safe for us to save the data now. */\n \n // Sanitize the user input.\n $heading_one = sanitize_text_field( $_POST['heading_one'] );\n $heading_two = sanitize_text_field( $_POST['heading_two'] );\n $heading_three = sanitize_text_field( $_POST['heading_three'] );\n $heading_four = sanitize_text_field( $_POST['heading_four'] );\n $heading_five = sanitize_text_field( $_POST['heading_five'] );\n $heading_six = sanitize_text_field( $_POST['heading_six'] );\n \n // Update the meta field.\n update_post_meta( $post_id, '_my_meta_value_key_one', $heading_one );\n update_post_meta( $post_id, '_my_meta_value_key_two', $heading_two );\n update_post_meta( $post_id, '_my_meta_value_key_three', $heading_three );\n update_post_meta( $post_id, '_my_meta_value_key_four', $heading_four );\n update_post_meta( $post_id, '_my_meta_value_key_five', $heading_five );\n update_post_meta( $post_id, '_my_meta_value_key_six', $heading_six );\n\n }", "public function save($post_id);", "public function custom_meta_save( $post_id, $post = false ){\n\t\tif( $this->options->show_on && !in_array( get_the_id(), $this->options->show_on ) ){\n\t\t\treturn false;\n\t\t}\n\n\t\t//Verify the nonce before proceeding.\n\t\tif ( !isset( $_POST[$this->unique_key.'_nonce'] ) || !wp_verify_nonce( $_POST[$this->unique_key.'_nonce'], basename( __FILE__ ) ) ){\n\t\t\treturn false;\n\t\t}\n\n\t\t//Meta Keys to Save\n\t\t$keys = array( $this->unique_key, $this->unique_key.\"_title\" );\n\n\t\tforeach( $keys as $key ){\n\n\t\t\t//Get the posted data and sanitize it for use as an HTML class.\n\t\t\tif( $key == $this->unique_key ){\n\t\t\t\t$new_meta_value = ( isset( $_POST[$key] ) ? sanitize_html_class( $_POST[$key] ) : '' );\n\t\t\t} else {\n\t\t\t\t$new_meta_value = isset( $_POST[$key] ) ? $_POST[$key] : '' ;\n\t\t\t}\n\n\t\t\t//Get the meta value of the custom field key.\n\t\t\t$meta_value = get_post_meta( $post_id, $key, true );\n\n\t\t\t//If a new meta value was added and there was no previous value, add it.\n\t\t\tif ( $new_meta_value && '' == $meta_value ){\n\t\t\t\tadd_post_meta( $post_id, $key, $new_meta_value, true );\n\t\t\t}\n\n\t\t\t//If the new meta value does not match the old value, update it.\n\t\t\telseif ( $new_meta_value && $new_meta_value != $meta_value ){\n\t\t\t\tupdate_post_meta( $post_id, $key, $new_meta_value );\n\t\t\t}\n\n\t\t\t//If there is no new meta value but an old value exists, delete it.\n\t\t\telseif ( '' == $new_meta_value && $meta_value ){\n\t\t\t\tdelete_post_meta( $post_id, $key, $meta_value );\n\t\t\t}\n\n\t\t}\n\n\t}", "public static function save_meta_data($post_id)\n {\n // If it is the post has not been updated, so we don’t want to do anything\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post_id;\n }\n\n // verify this came from the screen and with proper authorization,\n // because save_post can be triggered at other times\n if (!isset($_POST['dxw_content_review_nonce']) || !wp_verify_nonce($_POST['dxw_content_review_nonce'], plugin_basename(__DIR__))) {\n return $post_id;\n }\n\n // Get the post type object.\n global $post;\n $post_type = get_post_type_object($post->post_type);\n\n // Check if the current user has permission to edit the post.\n if (!current_user_can($post_type->cap->edit_post, $post_id)) {\n return $post_id;\n }\n\n if (wp_is_post_revision($post_id)) {\n return $post_id;\n }\n\n $data = array();\n\n $data['_dxw_review_email'] = self::get_emails($_POST['dxw_review_email']);\n $data['_dxw_review_length'] = self::get_value_from_setting($_POST['dxw_review_length'], 'dxw_review_length');\n $data['_dxw_review_action'] = self::get_value_from_setting($_POST['dxw_review_action'], 'dxw_review_action');\n\n foreach ($data as $key => $value) {\n if (!is_wp_error($value)) {\n $current = get_post_meta($post_id, $key, true);\n\n // add/update record (both are taken care of by update_post_meta)\n if ($value && '' == $current) {\n add_post_meta($post_id, $key, $value, true);\n } elseif ($value && $value != $current) {\n update_post_meta($post_id, $key, $value);\n } elseif ('' == $value && $current) {\n delete_post_meta($post_id, $key, $current);\n }\n }\n }\n\n if (!is_wp_error($data['_dxw_review_length'])) {\n self::save_review_date($post_id, $data['_dxw_review_length']);\n }\n }", "function wp_ajax_press_this_save_post()\n {\n }", "function hook_save_post($post_id) {\r\n\t\t// So ignore it unless at least one of our fields is set.\r\n\t\tif (!isset($_POST['mapp_zoom']))\r\n\t\t\treturn;\r\n\r\n\t\tdelete_post_meta($post_id, '_mapp_map');\r\n\t\tdelete_post_meta($post_id, '_mapp_pois');\r\n\r\n\t\t// Process map header fields. Filter out empty strings so as not to affect shortcode_atts() calls later\r\n\t\tif (!empty($_POST['mapp_size']))\r\n\t\t\t$map['size'] = $_POST['mapp_size'];\r\n\t\tif (!empty($_POST['mapp_maptype']))\r\n\t\t\t$map['maptype'] = $_POST['mapp_maptype'];\r\n\t\tif (!empty($_POST['mapp_width']))\r\n\t\t\t$map['width'] = $_POST['mapp_width'];\r\n\t\tif (!empty($_POST['mapp_height']))\r\n\t\t\t$map['height'] = $_POST['mapp_height'];\r\n\t\tif (!empty($_POST['mapp_zoom']))\r\n\t\t\t$map['zoom'] = $_POST['mapp_zoom'];\r\n\t\tif (!empty($_POST['mapp_center_lat']))\r\n\t\t\t$map['center_lat'] = $_POST['mapp_center_lat'];\r\n\t\tif (!empty($_POST['mapp_center_lng']))\r\n\t\t\t$map['center_lng'] = $_POST['mapp_center_lng'];\r\n\r\n\t\tupdate_post_meta($post_id, '_mapp_map', $map);\r\n\r\n\r\n\t\tif (!empty($pois))\r\n\t\t\tupdate_post_meta($post_id, '_mapp_pois', $pois);\r\n\t}", "function bn_meta_save( $post_id ) {\n\tif( isset( $_POST[ 'construction_realestate_posttype_agents_featured' ] )) {\n\t update_post_meta( $post_id, 'construction_realestate_posttype_agents_featured', esc_attr(1));\n\t}else{\n\t\tupdate_post_meta( $post_id, 'construction_realestate_posttype_agents_featured', esc_attr(0));\n\t}\n}", "function save_meta ( $post_id )\n\t{\n\n // Check if nonce is set.\n if ( ! isset( $_POST['metabox_lh_quote'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['metabox_lh_quote'], 'save_metabox_lh_quote' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n\n // If the post key contains the quote_element add it to the array to save\n $quote_breakdown = array();\n foreach ($_POST as $KEY => $VALUE)\n {\n if(strpos($KEY, \"quote_element\") !== false){\n $quote_breakdown[$KEY] = $VALUE;\n }\n }\n\n update_post_meta( $post_id, 'quote_breakdown', $quote_breakdown );\n\n $quote_total = $_POST['quote_total'];\n update_post_meta( $post_id, 'quote_total', $quote_total );\n\n // Save the client ID\n $client_id = $_POST['client_id'];\n update_post_meta( $post_id, 'client_id', $client_id );\n\n // Update quote status\n $quote_status = $_POST['quote_status'];\n update_post_meta( $post_id, 'quote_status', $quote_status );\n\n // Update deposit status\n $deposit_status = $_POST['deposit_status'];\n // check current deposit status. If it's not paid and its being changed add to timeline\n $current_deposit_status = get_post_meta($post_id,'deposit_status',true);\n if($current_deposit_status<>\"paid\" && $deposit_status==\"paid\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Deposit Paid',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'deposit_status', $deposit_status );\n\n // Update materials status\n $materials_status = $_POST['materials_status'];\n // check current status and add to timeline if required\n $current_materials_status = get_post_meta($post_id,'materials_status',true);\n if($current_materials_status<>\"ordered\" && $materials_status==\"ordered\")\n {\n\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Materials Ordered',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'materials_status', $materials_status );\n\n // Update accessories status\n $accessories_status = $_POST['accessories_status'];\n // check current status and add to timeline if required\n $current_accessories_status = get_post_meta($post_id,'accessories_status',true);\n if($current_accessories_status<>\"arrived\" && $accessories_status==\"arrived\")\n {\n // Update the client timeline\n $args = array(\n \"client_id\" => $client_id,\n \"project_id\" => $post_id,\n \"activity_title\" => 'Critical Accessories Arrived',\n \"activity_content\" => '',\n );\n lh_actions::activity_item_add($args);\n }\n update_post_meta( $post_id, 'accessories_status', $accessories_status );\n\n // Update invouce status\n $invoice_sent = $_POST['invoice_sent'];\n update_post_meta( $post_id, 'invoice_sent', $invoice_sent );\n\n // Update invouce paid\n $invoice_paid = $_POST['invoice_paid'];\n update_post_meta( $post_id, 'invoice_paid', $invoice_paid );\n\n // Add Project start Date\n $project_start_date = $_POST['project_start_date'];\n update_post_meta( $post_id, 'project_start_date', $project_start_date );\n\n // Finally see if there is a descret key - if not create one\n $secret = get_post_meta($post_id,'secret',true);\n\n if($secret==\"\")\n {\n $new_secret = lh_crm_utils::generate_secret();\n update_post_meta( $post_id, 'secret', $new_secret );\n }\n\n\t}", "function cinerama_edge_meta_box_save( $post_id, $post ) {\n\t\tglobal $cinerama_edge_global_Framework;\n\n\t\t$nonces_array = array();\n\t\t$meta_boxes = cinerama_edge_framework()->edgtMetaBoxes->getMetaBoxesByScope( $post->post_type );\n\n\t\tif ( is_array( $meta_boxes ) && count( $meta_boxes ) ) {\n\t\t\tforeach ( $meta_boxes as $meta_box ) {\n\t\t\t\t$nonces_array[] = 'cinerama_edge_meta_box_' . $meta_box->name . '_save';\n\t\t\t}\n\t\t}\n\n\t\tif ( is_array( $nonces_array ) && count( $nonces_array ) ) {\n\t\t\tforeach ( $nonces_array as $nonce ) {\n\t\t\t\tif ( ! isset( $_POST[ $nonce ] ) || ! wp_verify_nonce( $_POST[ $nonce ], $nonce ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$postTypes = apply_filters( 'cinerama_edge_filter_meta_box_post_types_save', array( 'post', 'page' ) );\n\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $_POST['_wpnonce'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! in_array( $post->post_type, $postTypes ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $cinerama_edge_global_Framework->edgtMetaBoxes->options as $key => $box ) {\n\n\t\t\tif ( isset( $_POST[ $key ] ) && trim( $_POST[ $key ] !== '' ) ) {\n\n\t\t\t\t$value = $_POST[ $key ];\n\n\t\t\t\tupdate_post_meta( $post_id, $key, $value );\n\t\t\t} else {\n\t\t\t\tdelete_post_meta( $post_id, $key );\n\t\t\t}\n\t\t}\n\t\t\n\t\t// save post link twitter content\n\t\t$is_twitter_post_format = false;\n\t\tif ( $post->post_type == 'post' && $_POST['post_format'] == 'link' && $_POST['edgtf_post_link_link_meta'] != '' ) {\n\t\t\t$link = $_POST['edgtf_post_link_link_meta'];\n\t\t\n\t\t\tif ( defined( 'CINERAMA_TWITTER_FEED_VERSION' ) && strpos( $link, 'twitter.com' ) !== false && strpos( $link, 'status' ) ) {\n\t\t\t\t$status_parts = explode( '/', $link );\n\t\t\t\t$status_id = $status_parts[5];\n\t\t\t\t$twitter_api = CineramaTwitterApi::getInstance();\n\t\t\t\t\n\t\t\t\tif ( $twitter_api->hasUserConnected() ) {\n\t\t\t\t\t$response = $twitter_api->getTweetById( $status_id, array() );\n\t\t\t\t\t$tweet_data = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $response->data as $tweet ) {\n\t\t\t\t\t\t$tweet_data['text'] = $twitter_api->getHelper()->getTweetCleanText( $tweet );\n\t\t\t\t\t\t$tweet_data['author'] = $twitter_api->getHelper()->getTweetAuthor( $tweet );\n\t\t\t\t\t\t$tweet_data['time'] = $twitter_api->getHelper()->getTweetCreatedTime( $tweet );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( count( $tweet_data ) > 0 ) {\n\t\t\t\t\t\tupdate_post_meta( $post_id, 'edgtf_post_link_twitter_data_meta', $tweet_data );\n\t\t\t\t\t\t$is_twitter_post_format = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!$is_twitter_post_format) {\n\t\t\tdelete_post_meta( $post_id, 'edgtf_post_link_twitter_data_meta' );\n\t\t}\n\t}", "function save_postdata( $post_id ) {\n\tglobal $post, $new_meta_boxes;\n\n\tif(isset($post) && $post->post_type=='page'){\n\t\t$new_meta_boxes=$GLOBALS['new_meta_boxes'];\n\t\tpexeto_save_meta_data($new_meta_boxes, $post_id);\n\t}\n}", "function tower_save_form_data($data) {\n // logic for data validation and saving.\n $post_type = 'tower_' . @$data->get_param('type');\n if (! array_key_exists($post_type, TOWER_CUSTOM_POSTS)) return null;\n\n // backend validation\n $fields = array_merge([\n 'name' => 'title',\n 'rules' => 'required',\n ], TOWER_CUSTOM_POSTS[$post_type]['fields']);\n \n // check if the form has any validation errors\n $validation_errors = tower_form_errors($data, $fields);\n\n $post_id = 0; // id for the new post\n \n if (count($validation_errors) == 0) {\n $post_id = wp_insert_post([\n 'post_type' => $post_type,\n 'post_title' => $data->get_param('title')\n ]);\n if ($post_id > 0) {\n foreach ($fields as $field) {\n update_post_meta(\n $post_id, \n $field['name'], \n sanitize_text_field($data->get_param($field['name']))\n );\n }\n }\n }\n \n echo json_encode([\n 'success' => $post_id > 0,\n 'errors' => $validation_errors,\n ]);\n}", "function notes_save_meta_box_data( $post_id ) {\n\n\t/*\n\t * We need to verify this came from our screen and with proper authorization,\n\t * because the save_post action can be triggered at other times.\n\t */\n\n\t// Check if our nonce is set.\n\tif ( ! isset( $_POST['notes_meta_box_nonce'] ) ) {\n\t\treturn;\n\t}\n\n\t// Verify that the nonce is valid.\n\tif ( ! wp_verify_nonce( $_POST['notes_meta_box_nonce'], 'notes_meta_box' ) ) {\n\t\treturn;\n\t}\n\n\t// If this is an autosave, our form has not been submitted, so we don't want to do anything.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tif ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t} else {\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* OK, it's safe for us to save the data now. */\n\t\n\t// Make sure that it is set.\n\tif ( ! isset( $_POST['notes_new_field'] ) ) {\n\t\treturn;\n\t}\n\n\t// Sanitize user input.\n\t$my_data = sanitize_text_field( $_POST['notes_new_field'] );\n\n\t// Update the meta field in the database.\n\tupdate_post_meta( $post_id, '_my_meta_value_key', $my_data );\n}", "function sdpdb_save_postdata( $post_id ) {\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n\n\t$nonce = $_POST['sdpdb_noncename'];\n\tif ( !wp_verify_nonce( $nonce, 'staydry_product_description_bullets' )) {\n\t\treturn $post_id;\n\t}\n\n\t// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want\n\t// to do anything\n\tif ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) \n\t\treturn $post_id;\n\n\t// Check permissions\n\tif ( 'post' == $_POST['post_type'] ) {\n\t\tif ( !current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\t}\n\n // OK, we're authenticated: we need to find and save the data\n\n $meta_data = $_POST['_staydry_product_description_bullets'];\n\n// Do something with $mydata \n // probably using add_post_meta(), update_post_meta(), or \n // a custom table (see Further Reading section below)\n\n\t$meta_key = '_staydry_product_description_bullets';\n \n\tupdate_post_meta($post_id, $meta_key, $meta_data);\n\n\treturn $meta_data;\n}", "function flow_seo_save_postdata($post_id){\n\t\t// verify if this is an auto save routine. \n\t\t// If it is our form has not been submitted, so we dont want to do anything\n\t\tif(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// verify this came from the our screen and with proper authorization,\n\t\t// because save_post can be triggered at other times\n\t\tif (!wp_verify_nonce($_POST['flow_seo_noncename'], basename( __FILE__ ))){\n\t\t\treturn;\n\t\t}\n\n\t\t// Check permissions\n\t\tif('page' == $_POST['post_type']){\n\t\t\tif(!current_user_can('edit_page', $post_id)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\tif(!current_user_can('edit_post', $post_id)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//if saving in a custom table, get post_ID\n\t\t$post_ID = $_POST['post_ID'];\n\t\t$flow_seo_data['flow_seo_title'] = $_POST['flow_seo_title'];\n\t\t$flow_seo_data['flow_seo_description'] = $_POST['flow_seo_description'];\n\t\t$flow_seo_data['flow_post_header_code'] = $_POST['flow_post_header_code'];\n\n\t\t// Do something with $flow_seo_data \n\t\t// probably using add_post_meta(), update_post_meta(), or \n\t\t// a custom table (see Further Reading section below)\n\t\tforeach($flow_seo_data as $key => $value){\n\t\t\t$old = get_post_meta($post_ID, $key, true);\n\t\t\t$new = $value;\n\t\t \n\t\t\tif($new && $new != $old){\n\t\t\t\tupdate_post_meta($post_ID, $key, $new);\n\t\t\t}else if($new == '' && $old){\n\t\t\t\t//delete_post_meta($post_ID, $key, $old); //Old will not work for complex fields for some reason...\n\t\t\t\tdelete_post_meta($post_ID, $key);\n\t\t\t}\n\t\t}\n\t}", "function travel_meta_save( $post_id ) {\n \n // Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'travel_nonce' ] ) && wp_verify_nonce( $_POST[ 'travel_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n \n // Exits script depending on save status\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\n return;\n }\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'travel-logo' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'travel-logo', $_POST[ 'travel-logo' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'travel-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'travel-image', $_POST[ 'travel-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-1-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-image', $_POST[ 'feature-1-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-2-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-image', $_POST[ 'feature-2-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-3-gettingto-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-gettingto-image', $_POST[ 'feature-3-gettingto-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-4-lodging-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-lodging-image', $_POST[ 'feature-4-lodging-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-5-angling-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-angling-image', $_POST[ 'feature-5-angling-image' ] );\n\t\t}\n \n // Checks for input and saves\n\t\tif( isset( $_POST[ 'setthehook-option-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'setthehook-option-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'setthehook-option-checkbox', '' );\n\t\t}\n \n // Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'sth-textarea-1' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'sth-textarea-1', $_POST[ 'sth-textarea-1' ] );\n\t\t}\n\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image1' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image1', $_POST[ 'additional-info-image1' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image1-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image1-link', $_POST[ 'additional-info-image1-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image2' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image2', $_POST[ 'additional-info-image2' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image2-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image2-link', $_POST[ 'additional-info-image2-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image3' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image3', $_POST[ 'additional-info-image3' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image3-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image3-link', $_POST[ 'additional-info-image3-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image4' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image4', $_POST[ 'additional-info-image4' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image4-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image4-link', $_POST[ 'additional-info-image4-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image5' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image5', $_POST[ 'additional-info-image5' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image5-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image5-link', $_POST[ 'additional-info-image5-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image6' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image6', $_POST[ 'additional-info-image6' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image6-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image6-link', $_POST[ 'additional-info-image6-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image7' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image7', $_POST[ 'additional-info-image7' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image7-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image7-link', $_POST[ 'additional-info-image7-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image8' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image8', $_POST[ 'additional-info-image8' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image8-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image8-link', $_POST[ 'additional-info-image8-link' ] );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-1-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-1-video', esc_url( $_POST[ 'feature-1-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-1-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-2-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-2-video', esc_url( $_POST[ 'feature-2-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-2-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-3-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-3-video', esc_url( $_POST[ 'feature-3-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-3-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-4-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-4-video', esc_url( $_POST[ 'feature-4-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-4-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-5-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-5-video', esc_url( $_POST[ 'feature-5-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-5-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-checkbox', '' );\n\t\t}\n}", "function apprenants_save_meta_box_data($post_id)\r\n {\r\n // verify taxonomies meta box nonce\r\n if (!isset($_POST['apprenants_meta_box_nonce']) || !wp_verify_nonce($_POST['apprenants_meta_box_nonce'], basename(__FILE__))) {\r\n return;\r\n }\r\n\r\n // return if autosave\r\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\r\n return;\r\n }\r\n\r\n // Check the user's permissions.\r\n if (!current_user_can('edit_post', $post_id)) {\r\n return;\r\n }\r\n\r\n // store custom fields values\r\n // nom string\r\n if (isset($_REQUEST['nom'])) {\r\n update_post_meta($post_id, '_apprenants_nom', sanitize_text_field($_POST['nom']));\r\n }\r\n\r\n // store custom fields values\r\n // prénom string\r\n if (isset($_REQUEST['prenom'])) {\r\n update_post_meta($post_id, '_apprenants_prenom', sanitize_text_field($_POST['prenom']));\r\n }\r\n\r\n // store custom fields values\r\n // github string\r\n if (isset($_REQUEST['github'])) {\r\n update_post_meta($post_id, '_apprenants_github', sanitize_text_field($_POST['github']));\r\n }\r\n\r\n // store custom fields values\r\n //linkedIn string\r\n if (isset($_REQUEST['linkedIn'])) {\r\n update_post_meta($post_id, '_apprenants_linkedIn', sanitize_text_field($_POST['linkedIn']));\r\n }\r\n\r\n // store custom fields values\r\n //portfolio string\r\n if (isset($_REQUEST['portfolio'])) {\r\n update_post_meta($post_id, '_apprenants_portfolio', sanitize_text_field($_POST['portfolio']));\r\n }\r\n }", "function classiera_save_post_meta($post_id, $post) {\r\n\t\r\n\t// verify this came from the our screen and with proper authorization,\r\n\t// because save_post can be triggered at other times\r\n\tif ( !wp_verify_nonce( isset( $_POST['eventmeta_noncename'] ) ? $_POST['eventmeta_noncename'] : '', plugin_basename(__FILE__) )) {\r\n\treturn $post->ID;\r\n\t}\r\n\r\n\t// Is the user allowed to edit the post or page?\r\n\tif ( !current_user_can( 'edit_post', $post->ID ))\r\n\t\treturn $post->ID;\r\n\r\n\t// OK, we're authenticated: we need to find and save the data\r\n\t// We'll put it into an array to make it easier to loop though.\r\n\t\r\n\t$events_meta['featured_post'] = $_POST['featured_post'];\r\n\t\r\n\t$chk = ( isset( $_POST['featured_post'] ) && $_POST['featured_post'] ) ? '1' : '2';\r\n\tupdate_post_meta( $post_id, 'featured_post', $chk );\r\n\t\r\n\t// Add values of $events_meta as custom fields\r\n\tforeach ($events_meta as $key => $value) { // Cycle through the $events_meta array!\r\n\t\tif( $post->post_type == 'post' ) return; // Don't store custom data twice\r\n\t\t$value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)\r\n\t\tif(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value\r\n\t\t\tupdate_post_meta($post->ID, $key, $value);\r\n\t\t} else { // If the custom field doesn't have a value\r\n\t\t\tadd_post_meta($post->ID, $key, $value);\r\n\t\t}\r\n\t\tif(!$value) delete_post_meta($post->ID, $key); // Delete if blank\r\n\t}\r\n\r\n}", "function rosemary_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'rosemary_nonce' ] ) && wp_verify_nonce( $_POST[ 'rosemary_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n\t\r\n\t// Checks for input and saves\r\n\tif( isset( $_POST[ 'meta-checkbox-fullwidth' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-fullwidth', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-fullwidth', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-page-content' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-page-content', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-page-content', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-blog-slider' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-slider', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-slider', '' );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-checkbox-blog-promo' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-promo', 'yes' );\r\n\t} else {\r\n\t\tupdate_post_meta( $post_id, 'meta-checkbox-blog-promo', '' );\r\n\t}\r\n\t\r\n if( isset( $_POST[ 'meta-text-blog-heading' ] ) ) {\r\n update_post_meta( $post_id, 'meta-text-blog-heading', sanitize_text_field( $_POST[ 'meta-text-blog-heading' ] ) );\r\n }\r\n\tif( isset( $_POST[ 'meta-select-blog-layout' ] ) ) {\r\n\t\tupdate_post_meta( $post_id, 'meta-select-blog-layout', $_POST[ 'meta-select-blog-layout' ] );\r\n\t}\r\n\tif( isset( $_POST[ 'meta-number-posts' ] ) ) {\r\n update_post_meta( $post_id, 'meta-number-posts', sanitize_text_field( $_POST[ 'meta-number-posts' ] ) );\r\n }\r\n\tif( isset( $_POST[ 'meta-blog-category' ] ) ) {\r\n update_post_meta( $post_id, 'meta-blog-category', sanitize_text_field( $_POST[ 'meta-blog-category' ] ) );\r\n }\r\n \r\n}", "public function save()\n {\n $postMapper = new Application_Model_PostsMapper();\n $postMapper->save($this);\n }", "function foool_partner_infos_save_postdata($post_id){\n \n // Check Autosave\n\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;\n\n if (!wp_verify_nonce($_POST['partner_metabox_nonce'], basename(__FILE__))) return $post_id;\n\n // Update Temoignage Author\n $temoignage_author = sanitize_text_field($_POST['partner_url']);\n if (!empty($temoignage_author)) update_post_meta ($post_id, 'partner_url', $temoignage_author);\n else update_post_meta ($post_id, 'partner_url', '');\n\n}", "function save_my_meta_box_data( $post_id ) {\n\n\t// Check if our nonce is set.\n\tif ( ! isset( $_POST['myplugin_meta_box_nonce'] ) ) {\n\t\treturn;\n\t}\n\n\t// Verify that the nonce is valid.\n\tif ( ! wp_verify_nonce( $_POST['myplugin_meta_box_nonce'], 'myplugin_meta_box' ) ) {\n\t\treturn;\n\t}\n\n\n\t// If this is an autosave, our form has not been submitted, so we don't want to do anything.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tif ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\n\t} else {\n\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* OK, it's safe for us to save the data now. */\n\t\n\t// Make sure that it is set.\n\tif ( ! isset( $_POST['video_url'] ) ) {\n\t\treturn;\n\t}\n\n\n\t// Sanitize user input.\n\t$my_data = sanitize_text_field( $_POST['video_url'] );\n\t$my_sec_title = sanitize_text_field( $_POST['second_title'] );\n\n\t// Update the meta field in the database.\n\tupdate_post_meta( $post_id, 'video_url_key', $my_data );\n}", "function Link_box_post_save($post_id){\n //CONTROLE ALS DE AANVRAAG KOMT VAN DIT SCHERM - SAVE POST KAN VAN EEN ANDERE PAGINA KOMEN\n if ( !wp_verify_nonce( $_POST['post_link_box_content_nonce'], plugin_basename(__FILE__) )) {\n return $post_id;\n }\n // Verify if this is an auto save routine. If it is our form has not been submitted, so we dont want\n // to do anything\n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) \n return $post_id;\n // Check permissions to edit pages and/or post\n if ( 'page' == $_POST['post_type'] || 'post' == $_POST['post_type']) {\n if ( !current_user_can( 'edit_page', $post_id ) || !current_user_can( 'edit_post', $post_id ))\n return $post_id;\n } \n // OK, we're authenticated: we need to find and save the data\n //HAAL DATA UIT HET FORMULIER\n $afk = $_POST['Link'];\n // save data in INVISIBLE custom field (note the \"_\" prefixing the custom fields' name\n update_post_meta($post_id, 'Link', $afk); \n }", "public function save( $post_id ) {\n /*\n * We need to verify this came from the our screen and with proper authorization,\n * because save_post can be triggered at other times.\n */\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['sbrb_inner_custom_box_nonce'] ) ) {\n return $post_id;\n }\n\n $nonce = $_POST['sbrb_inner_custom_box_nonce'];\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $nonce, 'sbrb_inner_custom_box' ) ) {\n return $post_id;\n }\n\n /*\n * If this is an autosave, our form has not been submitted,\n * so we don't want to do anything.\n */\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return $post_id;\n }\n\n // Check the user's permissions.\n if ( 'page' == $_POST['post_type'] ) {\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return $post_id;\n }\n } else {\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n }\n\n /* OK, it's safe for us to save the data now. */\n\n // Sanitize the user input.\n $_short_link_slug = sanitize_text_field( $_POST['sbrb_rebrandly_slug'] );\n $_short_link_id = sanitize_text_field( $_POST['sbrb_rebrandly_id'] );\n $_short_link_url = sanitize_text_field( $_POST['sbrb_rebrandly_url'] );\n\n // Communicate with Rebrandly to create short link.\n if( !$_short_link_id ) {\n\n // If there is no short link ID yet, create one and save it to the post meta.\n $rebrandly = create_rebrandly_link( $_short_link_slug, $post_id );\n $_short_link_slug = $rebrandly->slashtag;\n $_short_link_id = $rebrandly->id;\n $_short_link_url = $rebrandly->shortUrl;\n\n } else {\n\n // If there is a short link, check the Rebrandly link data and make adjustments if necessary.\n $rebrandly = check_rebrandly_link($_short_link_id);\n // Get the Rebrandly link slug value if post meta field is empty.\n if( $_short_link_slug == '' ) {\n $_short_link_slug = $rebrandly->slashtag;\n }\n // Check if the link slug has changed, and update Rebrandly & post_meta if necessary.\n if( $_short_link_slug != $rebrandly->slashtag ) {\n $rebrandly_update = update_rebrandly_link( $_short_link_id, $_short_link_slug, $_short_link_url, $post_id );\n $_short_link_url = $rebrandly_update->shortUrl;\n }\n // Check if the post permalink has changed, and update Rebrandly if necessary.\n if( get_permalink($post_id) != $rebrandly->destination ) {\n $rebrandly_update = update_rebrandly_link( $_short_link_id, $_short_link_slug, $_short_link_url, $post_id );\n }\n\n }\n\n // Update the meta fields.\n update_post_meta( $post_id, '_rebrandly_link_slug', $_short_link_slug );\n update_post_meta( $post_id, '_rebrandly_link_id', $_short_link_id );\n update_post_meta( $post_id, '_rebrandly_link_url', $_short_link_url );\n }", "function meta_box_save_func_store($post_id){\n\n\t# Doing autosave then return.\n\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n\t\treturn;\n\n\t# If the nonce is not present there or we can not versify it.\n\tif ( !isset($_POST['product_nonce_name']) || !wp_verify_nonce($_POST['product_nonce_name'], 'product_nonce_action' ))\n\t\treturn;\n\n\t# Save Author Name \n\tif (isset($_POST['author_name']) && ($_POST['author_name'] != '') ) {\n\t \tupdate_post_meta($post_id, 'author_name', esc_html($_POST['author_name']));\n\t } \n\n\t# Save data Product name.\n\tif (isset($_POST['product_name']) && ($_POST['product_name'] != '')) {\n\t\tupdate_post_meta($post_id, 'product_name', esc_html($_POST['product_name']));\n\t}\n\n\t# Save data Product Description.\n\tif (isset($_POST['product_description']) && ($_POST['product_description'] != '')) {\n\t\tupdate_post_meta($post_id, 'product_description', esc_html($_POST['product_description']));\n\t}\n\n\n}", "function construction_realestate_posttype_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n}", "function save_post($post_id){\n \n // vars\n $args = array();\n $name = $this->get_name($post_id);\n \n // Filters\n $args = apply_filters(\"acfe/options_page/save_args\", $args, $name, $post_id);\n $args = apply_filters(\"acfe/options_page/save_args/name={$name}\", $args, $name, $post_id);\n $args = apply_filters(\"acfe/options_page/save_args/id={$post_id}\", $args, $name, $post_id);\n \n if($args === false)\n return;\n \n // Actions\n do_action(\"acfe/options_page/save\", $name, $args, $post_id);\n do_action(\"acfe/options_page/save/name={$name}\", $name, $args, $post_id);\n do_action(\"acfe/options_page/save/id={$post_id}\", $name, $args, $post_id);\n \n }", "public function save()\n\t{\n\t\n\t\tif ($this->id == null) throw new Exception(\"Cannot save. id is null\");\n\t\t\n\t\t//store the data in the content column so that our worker will be searchable.\n\t\t$wp_content = \"\";\n\t\t\n\t\tforeach($this->values as $field=>$value)\n\t\t{\n\t\t\tupdate_post_meta($this->id, $field, $value);\n\t\t\t$wp_content .= \"<div>$value</div>\";\n\t\t}\n\t\t\n\t\t//wp_die($wp_content);\n\n\t\t//save the data entry in wp_posts\n\t\tglobal $wpdb;\n\t\t$wpdb->update(\n\t\t\t$wpdb->posts, \n\t\t\tarray(\n\t\t\t\t\"post_content\" => $wp_content,\n\t\t\t\t\"post_title\" => \"{$this->values['lastname']}, {$this->values['firstname']} {$this->values['middlename']}\" \n\t\t\t),\n\t\t\tarray(\"ID\" => $this->id),\n\t\t\tarray(\"%s\"),\n\t\t\tarray(\"%d\")\n\t\t);\n\t\t\n\t\t\n\t}", "function sp_save_postdata($post_id, $post) {\n\t\n\t// verify this came from the our screen and with proper authorization,\n\t// because save_post can be triggered at other times\n\tif ( !wp_verify_nonce( $_POST['sp_noncename'], plugin_basename(__FILE__) )) {\n\treturn $post->ID;\n\t}\n\n\t// Is the user allowed to edit the post or page?\n\tif ( 'page' == $_POST['post_type'] ) {\n\t\tif ( !current_user_can( 'edit_page', $post->ID ))\n\t\treturn $post->ID;\n\t} else {\n\t\tif ( !current_user_can( 'edit_post', $post->ID ))\n\t\treturn $post->ID;\n\t}\n\n\t// OK, we're authenticated: we need to find and save the data\n\t// We'll put it into an array to make it easier to loop though.\n\t\n\t$mydata['_listing_price'] = $_POST['_listing_price'];\n\t$mydata['_mls'] = $_POST['_mls'];\n\t$mydata['_address'] = $_POST['_address'];\n\t$mydata['_city'] = $_POST['_city'];\n\t$mydata['_state'] = $_POST['_state'];\n\t$mydata['_zip_code'] = $_POST['_zip_code'];\n\t\n\t$mydata['_square_feet'] = $_POST['_square_feet'];\n\t$mydata['_bedrooms'] = $_POST['_bedrooms'];\n\t$mydata['_bathrooms'] = $_POST['_bathrooms'];\n\t$mydata['_basement'] = $_POST['_basement'];\n\t$mydata['_additional_features'] = $_POST['_additional_features'];\n\t\n\t$mydata['_photo_1_thumbnail'] = $_POST['_photo_1_thumbnail'];\n\t$mydata['_photo_1_large'] = $_POST['_photo_1_large'];\n\t$mydata['_photo_2_thumbnail'] = $_POST['_photo_2_thumbnail'];\n\t$mydata['_photo_2_large'] = $_POST['_photo_2_large'];\n\t$mydata['_photo_3_thumbnail'] = $_POST['_photo_3_thumbnail'];\n\t$mydata['_photo_3_large'] = $_POST['_photo_3_large'];\n\t$mydata['_photo_4_thumbnail'] = $_POST['_photo_4_thumbnail'];\n\t$mydata['_photo_4_large'] = $_POST['_photo_4_large'];\n\t$mydata['_photo_5_thumbnail'] = $_POST['_photo_5_thumbnail'];\n\t$mydata['_photo_5_large'] = $_POST['_photo_5_large'];\n\t$mydata['_photo_6_thumbnail'] = $_POST['_photo_6_thumbnail'];\n\t$mydata['_photo_6_large'] = $_POST['_photo_6_large'];\n\t\n\t// Add values of $mydata as custom fields\n\t\n\tforeach ($mydata as $key => $value) { //Let's cycle through the $mydata array!\n\t\tif( $post->post_type == 'revision' ) return; //don't store custom data twice\n\t\t$value = implode(',', (array)$value); //if $value is an array, make it a CSV (unlikely)\n\t\tif(get_post_meta($post->ID, $key, FALSE)) { //if the custom field already has a value\n\t\t\tupdate_post_meta($post->ID, $key, $value);\n\t\t} else { //if the custom field doesn't have a value\n\t\t\tadd_post_meta($post->ID, $key, $value);\n\t\t}\n\t\tif(!$value) delete_post_meta($post->ID, $key); //delete if blank\n\t}\n\n}", "public function save_post($post_id, $post){\n\t\t\n\t\tglobal $post_type;\n\t\t\n\t\t//only save for 'posts'\n\t\tif($post_type == 'post'){\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//check if we have nonce set\n\t\t\tif(!isset($_POST['sc_upcoming_nonce_field'])){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//verify nonce\n\t\t\tif(!wp_verify_nonce($_POST['sc_upcoming_nonce_field'], 'sc_upcoming_nonce')){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//check autosave\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//action, called as we are saving, used to save any custom fields added to the admin\n\t\t\tdo_action('sc_upcoming_post_admin_save', $post_id);\n\t\t\t\n\t\t\t//good to save\n\t\t\t//collect settings\n\t\t\t$upcoming_preview = isset($_POST['upcoming_preview_status']) ? $_POST['upcoming_preview_status'] : '';\n\t\t\t$upcoming_preview_type = isset($_POST['upcoming_preview_type']) ? $_POST['upcoming_preview_type'] : '';\n\t\t\t$upcoming_preview_type_x_words = isset($_POST['upcoming_preview_x_words_number']) ? $_POST['upcoming_preview_x_words_number'] : '';\n\t\t\t\n\t\t\t//update meta\n\t\t\tupdate_post_meta($post_id,'upcoming_preview_status',$upcoming_preview);\n\t\t\tupdate_post_meta($post_id,'upcoming_preview_type',$upcoming_preview_type);\n\t\t\tupdate_post_meta($post_id,'upcoming_preview_x_words_number', $upcoming_preview_type_x_words);\n\t\t}\n\t\n\t}", "function save_postdata( $post_id ) {\n\n \tif ( wp_is_post_revision( $post_id ) )\n \t\treturn;\n\n // verify if this is an auto save routine.\n // If it is our form has not been submitted, so we dont want to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n return;\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n\n if ( !wp_verify_nonce( $_POST['agenda_noncename'], 'save_agenda' ) )\n return;\n\n\n // Check permissions\n if ( 'page' == $_POST['post_type'] )\n {\n\t if ( !current_user_can( 'edit_page', $post_id ) )\n\t return;\n }\n else\n {\n\t if ( !current_user_can( 'edit_post', $post_id ) )\n\t return;\n }\n\n\n $data_inicial = '_pan_data_inicial';\n $data_final = '_pan_data_final';\n\n // Testes com a data\n if ( $_POST[$data_inicial] )\n {\n\n\t $initial_date_pt = explode('/', trim($_POST[$data_inicial]));\n\t $initial_date_en = $initial_date_pt[2].'-'.$initial_date_pt[1].'-'.$initial_date_pt[0];\n\n\t if ($_POST[$data_final]) {\n\t $final_date_pt = explode('/', trim($_POST[$data_final]));\n\t $final_date_en = $final_date_pt[2].'-'.$final_date_pt[1].'-'.$final_date_pt[0];\n\t }\n\t else\n\t $final_date_en = $initial_date_en;\n\n }\n\n // Recebe o contexto / taxonomia da agenda (evento ou reunião)\n $context = $_POST['tax_input']['agenda_tipo'];\n $context_slug = get_term_by( 'id', $context, 'agenda_tipo' )->slug;\n\n foreach ( self::$custom_meta_fields as $field )\n\t\t{\n\t\t\t$old = get_post_meta( $post_id, $field['id'], true );\n\n\t\t\t// Testes para adicionar a data no formato correto\n\t\t\tif ( $field['id'] == $data_inicial )\n\t\t\t\t$new = date( 'Y-m-d h:i', strtotime( $initial_date_en ) );\n\t\t\telseif ( $field['id'] == $data_final )\n\t\t\t\t$new = date( 'Y-m-d h:i', strtotime( $final_date_en ) );\n\t\t\telse\n\t\t\t\t$new = $_POST[$field['id']];\n\n\t\t\tif ( in_array( $context_slug, $field['context'] ) )\n\t\t\t{\n\t\t\t\tif ( empty( $old ) && ! empty( $new ) )\n\t\t\t\t\tadd_post_meta( $post_id, $field['id'], $new, true );\n\t\t\t\telseif ( ! empty( $new ) )\n\t\t\t\t\tupdate_post_meta( $post_id, $field['id'], $new );\n\t\t\t\telse\n\t\t\t\t\tdelete_post_meta( $post_id, $field['id'] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// O post está fora do contexto\n\t\t\t\tdelete_post_meta( $post_id, $field['id'] );\n\t\t\t}\n\n\t }\n }", "function prosody_poem_resources_save_meta_box_data ($post_id=null)\n{\n $post_id = (is_null($post_id)) ? get_post()->ID : $post_id;\n\n /*\n * We need to verify this came from our screen and with proper\n * authorization, because the save_post action can be triggered at other\n * times.\n */\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['prosody_poem_resources_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n $nonce = $_POST['prosody_poem_resources_meta_box_nonce'];\n if ( ! wp_verify_nonce( $nonce, 'prosody_poem_resources_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't\n // want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) &&\n 'prosody_poem' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, its safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['prosody_poem_resources_editor'] ) ) {\n return;\n }\n\n // Sanitize user input. In this case we don't so the html will work.\n $my_data = $_POST['prosody_poem_resources_editor'];\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'Resources', $my_data );\n}", "function _save_post($post_id){\n \n if(!is_numeric($post_id) || get_post_type($post_id) !== $this->post_type)\n return;\n \n $this->save_post($post_id);\n \n }", "function save_custom_fields( $post_id, $post ) {\n if ( !isset($_POST['wpnext_wpnonce']) || !wp_verify_nonce($_POST['wpnext_wpnonce'], 'wpnext') )\n return;\n if ( !current_user_can( 'edit_post', $post_id ) )\n return;\n\n if ( isset($_POST['wpn_post_data']) ) {\n update_post_meta( $post_id, 'wpnext', $_POST['wpn_post_data']);\n } else {\n delete_post_meta( $post_id, 'wpnext');\n }\n }", "public function save( $post_id ) {\n\t\t\tglobal $post, $post_type;\n\t\t\tif ( ! $post_id ) {\n\t\t\t\t$post_id = $post->ID;\n\t\t\t}\n\n\t\t\t$post_type_object = get_post_type_object( $post_type );\n\n\t\t\tif (\n\t\t\t\tempty( $_POST )\n\t\t\t\t|| ! is_object( $post )\n\t\t\t\t|| ( ! in_array( $post_type, $this->_meta_box['pages'] ) ) //check post type\n\t\t\t\t|| ( ! isset( $_POST['post_ID'] ) || $post_id != $_POST['post_ID'] ) //check revision\n\t\t\t\t|| ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) //check autosave\n\t\t\t\t|| ( ! check_admin_referer( 'wm-' . $post_type . '-metabox-nonce', $post_type . '-metabox-nonce' ) ) //check nonce - security\n\t\t\t\t|| ( ! current_user_can( $post_type_object->cap->edit_post, $post_id ) ) //check permission\n\t\t\t\t)\n\t\t\t\treturn $post_id;\n\n\t\t\t//save each meta field separately\n\t\t\t$fields = $this->_fields;\n\t\t\tif ( isset( $this->_meta_box['visual-wrapper-add'] ) && ! empty( $this->_meta_box['visual-wrapper-add'] ) ) {\n\t\t\t\t$fields = array_merge( $this->_meta_box['visual-wrapper-add'], $fields );\n\t\t\t}\n\t\t\twm_save_meta( $post_id, $fields );\n\t\t}", "function meta_box_save( $post_id )\n{\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n \n // if our nonce isn't there, or we can't verify it, bail\n if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'meta_box_nonce' ) ) return;\n \n // if our current user can't edit this post, bail\n //if( !current_user_can( 'edit_post' ) ) return;\n\t\n\t// now we can actually save the data\n $allowed = array(\n 'a' => array( // on allow a tags\n 'href' => array() // and those anchors can only have href attribute\n )\n );\n // Make sure your data is set before trying to save it\n if( isset( $_POST['meta_box_manufacturer'] ) )\n update_post_meta( $post_id, 'meta_box_manufacturer', $_POST['meta_box_manufacturer'] );\n}", "protected function save(){\n $this->getTags();\n foreach ($this->posts as $post){\n $createdPost = Post::create(['habr_id' => $post['postId'],\n 'post' => $post['full'],\n 'unix_time' => $post['time']]);\n $this->attachPostTags($createdPost,$post['tags']);\n }\n }", "function ecals_save_postdata( $post_id ) {\n\n // verify this came from the our screen and with proper authorization,\n // because save_post can be triggered at other times\n\n if ( !wp_verify_nonce( $_POST['ecals_noncename'], plugin_basename(__FILE__) )) {\n return $post_id;\n }\n\n if ( !current_user_can( 'edit_post', $post_id )){\n return $post_id;\n }\n\n // OK, we're authenticated: we need to find and save the data\n if ($_POST[\"ecals_post_has_deadline\"]==1){\n \t$mydata = $_POST['dl_mm'].\"/\".$_POST['dl_jj'].\"/\".$_POST['dl_yy'];\n\n\t// Save ecals_post_deadline as custom field\n\t add_post_meta($post_id, 'ecals_post_deadline', date(\"Y-m-d H:i:s\", strtotime($mydata)), true) or update_post_meta($post_id, 'ecals_post_deadline', date(\"Y-m-d H:i:s\", strtotime($mydata)));\n \n } else {\n \tdelete_post_meta($post_id, 'ecals_post_deadline');\n }\n}", "function mredir_save_meta_box_data( $post_id ){\n\t\t\tif ( !isset( $_POST['mredir_metabox_nonce'] ) || !wp_verify_nonce( $_POST['mredir_metabox_nonce'], basename( __FILE__ ) ) ){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// return if autosave\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){\n\t\t\t\treturn;\n\t\t\t}\n\t\t // Check the user's permissions.\n\t\t\tif ( ! current_user_can( 'edit_post', $post_id ) ){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['country_id'] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'country_id', sanitize_text_field( $_POST['country_id'] ) );\n\t\t\t}\n\t\t\tif ( isset( $_REQUEST['target_url'] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'target_url', sanitize_text_field( $_POST['target_url'] ) );\n\t\t\t}\n\t\t}", "public function save_metabox_data( $post_id, $post ) {\n if ( ! isset( $_POST['xvr_br_nonce'] ) || ! wp_verify_nonce( $_POST[ 'xvr_br_nonce' ], basename( __FILE__ ) ) ) {\n return;\n }\n\n $data[ $this->keys['author'] ] = isset( $_POST['xvr-book-author'] ) ? sanitize_text_field( $_POST['xvr-book-author'] ): '';\n $data[ $this->keys['price'] ] = isset( $_POST['xvr-book-price'] ) ? sanitize_text_field( $_POST['xvr-book-price'] ) : '';\n $data[ $this->keys['description'] ] = isset( $_POST['xvr-book-description'] ) ? sanitize_text_field( $_POST['xvr-book-description'] ) : '';\n\n update_post_meta( $post_id, $this->keys['info'], $data);\n }", "function save_meta_options( $postID ){\n\t\t$post = $_POST;\n\t\tif((isset($post['update']) || isset($post['save']) || isset($post['publish']))){\n\n\n\t\t\t$user_template = (isset($post['pagelines_template'])) ? $post['pagelines_template'] : '';\n\n\t\t\tif($user_template != ''){\n\n\t\t\t\t$set = pl_meta($postID, PL_SETTINGS);\n\t\t\t\t\n\t\t\t\t$set['draft']['page-template'] = $user_template; \n\t\t\t\t$set['live']['page-template'] = $user_template; \n\t\t\t\t\n\t\t\t\tpl_meta_update($postID, PL_SETTINGS, $set);\n\t\t\t}\n\n\n\t\t}\n\t}", "function save($post_id) {\n\t \t/**\n\t\t * Verify Nonce.\n\t\t */\n if ( !isset( $_POST['weddingvendor_meta_box_nonce'] ) || !wp_verify_nonce($_POST['weddingvendor_meta_box_nonce'] , basename(__FILE__))) {\n return $post_id;\n }\n\t\t/**\n\t\t * Check Autosave.\n\t\t */\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post_id;\n }\n /**\n\t\t * Check Permissions.\n\t\t */\n if ('page' == $_POST['post_type']) {\n if (!current_user_can('edit_page', $post_id)) {\n return $post_id;\n }\n } elseif (!current_user_can('edit_post', $post_id)) {\n return $post_id;\n }\n /**\n\t * Set Field & Update meta.\n\t\t */\n foreach ($this->_meta_box['fields'] as $field) {\t\t\t\n $old = get_post_meta($post_id, $field['id'], true);\n $new = isset( $_POST[$field['id']] ) ? $_POST[$field['id']] : '' ;\n \n if ( $new && $new != $old) {\n update_post_meta($post_id, $field['id'], $new);\n } elseif ('' == $new && $old) {\n delete_post_meta($post_id, $field['id'], $old);\n }\n }\n }", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "function hr_visual_feedback_save_post($post_id, $post) {\n // Verify the nonce before proceeding.\n if (!isset($_POST['hr_visual_feeback_nonce']) || !wp_verify_nonce($_POST['hr_visual_feeback_nonce'], 'hr_visual_feeback_source')) {\n return $post_id;\n }\n // Get the post type object.\n $post_type = get_post_type_object($post->post_type);\n\n // Check if the current user has permission to edit the post.\n if (!current_user_can($post_type->cap->edit_post, $post_id)) {\n return $post_id;\n }\n\n // Get the posted data and sanitize it for use as an HTML class.\n $new_source_url = (isset($_POST['hr_visual_feedback_source']) ? sanitize_html_class($_POST['hr_visual_feedback_source']) : '');\n\n // Get the meta key.\n $source_key = 'hr_visual_feedback_source';\n\n // Get the meta value of the custom field key.\n $source_url = get_post_meta($post_id, $source_key, TRUE);\n\n // If a new meta value was added and there was no previous value, add it.\n if ($new_source_url && '' == $source_url) {\n add_post_meta($post_id, $source_key, $new_source_url, TRUE);\n }\n // If the new meta value does not match the old value, update it.\n elseif ($new_source_url && $new_source_url != $source_url) {\n update_post_meta($post_id, $source_key, $new_source_url);\n }\n // If there is no new meta value but an old value exists, delete it.\n elseif ('' == $new_source_url && $source_url) {\n delete_post_meta($post_id, $source_key, $source_url);\n }\n}", "public function save_post($post_id)\n \t{\n // verify if this is an auto save routine. \n // If it is our form has not been submitted, so we dont want to do anything\n if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n {\n return;\n }\n \n \t\tif(isset($_POST['post_type']) && $_POST['post_type'] == self::POST_TYPE && current_user_can('edit_post', $post_id))\n \t\t{\n \t\t\tforeach($this->_meta as $field_name)\n \t\t\t{\n \t\t\t\t// Update the post's meta field\n \t\t\t\tupdate_post_meta($post_id, $field_name, $_POST[$field_name]);\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\treturn;\n \t\t} // if($_POST['post_type'] == self::POST_TYPE && current_user_can('edit_post', $post_id))\n \t}", "function sm_meta_save( $post_id ) {\r\n \r\n // Checks save status\r\n $is_autosave = wp_is_post_autosave( $post_id );\r\n $is_revision = wp_is_post_revision( $post_id );\r\n $is_valid_nonce = ( isset( $_POST[ 'sm_nonce' ] ) && wp_verify_nonce( $_POST[ 'sm_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\r\n \r\n // Exits script depending on save status\r\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\r\n return;\r\n }\r\n \r\n // Checks for input and saves\r\nif( isset( $_POST[ 'meta-checkbox' ] ) ) {\r\n update_post_meta( $post_id, 'meta-checkbox', 'featured' );\r\n} else {\r\n update_post_meta( $post_id, 'meta-checkbox', '' );\r\n}\r\n \r\n}", "function prosody_poem_author_save_meta_box_data ($post_id=null)\n{\n $post_id = (is_null($post_id)) ? get_post()->ID : $post_id;\n\n /*\n * We need to verify this came from our screen and with proper\n * authorization, because the save_post action can be triggered at other\n * times.\n */\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['prosody_poem_author_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n $nonce = $_POST['prosody_poem_author_meta_box_nonce'];\n if ( ! wp_verify_nonce( $nonce, 'prosody_poem_author_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't\n // want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) &&\n 'prosody_poem' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, its safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['prosody_poem_author'] ) ) {\n return;\n }\n\n // Sanitize user input. In this case we don't so the transform will work.\n $my_data = sanitize_text_field( $_POST['prosody_poem_author'] );\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'Author', $my_data );\n}", "function wm_portfolio_cp_save_meta( $post_id ) {\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\t\treturn $post_id;\n\t\t//If the nonce isn't there, or we can't verify it, return\n\t\tif ( ! isset( $_POST['wm_portfolio-metabox-nonce'] ) || ! wp_verify_nonce( $_POST['wm_portfolio-metabox-nonce'], 'wm_portfolio-metabox-nonce' ) )\n\t\t\treturn $post_id;\n\t\t//If current user can't edit this post, return\n\t\tif ( ! current_user_can( 'edit_post' ) )\n\t\t\treturn $post_id;\n\n\t\t//Save each meta field separately\n\t\t$metaFields = wm_portfolio_meta_fields();\n\n\t\twm_save_meta( $post_id, $metaFields );\n\t}", "public function ecf_save_meta_box( $post_id ) {\r\n\t\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\r\n\t\t\tif ( $parent_id = wp_is_post_revision( $post_id ) ) {\r\n\t\t\t\t$post_id = $parent_id;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$fields = array();\r\n\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tarray_push( $fields, $customField['name'] );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach ( $fields as $field ) {\r\n\t\t\t\tif ( array_key_exists( $field, $_POST ) ) {\r\n\t\t\t\t\tupdate_post_meta( $post_id, $field, sanitize_text_field( $_POST[$field] ) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function vw_mobile_app_pro_posttype_ex_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n // Save designation\n if( isset( $_POST[ 'meta-designation' ] ) ) {\n update_post_meta( $post_id, 'meta-designation', esc_html($_POST[ 'meta-designation' ]) );\n }\n}", "function toolbox_portfolio_save_info( $post_id, $post ) {\n\n /* Verify the nonce before proceeding */\n if ( !isset( $_POST['toolbox_portfolio_post_nonce'] ) || !wp_verify_nonce( $_POST['toolbox_portfolio_post_nonce'], basename( __FILE__ ) ) )\n return $post_id;\n\n /* Get the post type object */\n $post_type = get_post_type_object ( $post->post_type );\n\n /* Check if the current user has permission to edit the post. */\n if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )\n return $post_id;\n\n /* Portfolio Year Field */\n /* Get the posted data and sanitize it for use as a date value. */\n $new_meta_value = ( isset( $_POST['toolbox_portfolio_year_field'] ) ? sanitize_text_field($_POST['toolbox_portfolio_year_field'] ) : '' );\n\n /* Get the meta key. */\n $meta_key = 'toolbox_portfolio_year_field';\n\n /* Get the meta value of the custom field key. */\n $meta_value = get_post_meta ($post_id, $meta_key, true );\n\n update_post_meta( $post_id, $meta_key, $new_meta_value, $meta_value );\n}", "function base_price_box_save( $post_id, $post ) {\n \tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n \t\treturn $post_id;\n \t}\n \t// Verify this came from the our screen and with proper authorization,\n \t// because save_post can be triggered at other times.\n \tif ( ! isset( $_POST['base_price'] ) || ! wp_verify_nonce( $_POST['base_price_box_content_nonce'], basename(__FILE__) ) ) {\n \t\treturn $post_id;\n \t}\n \t// Now that we're authenticated, time to save the data.\n \t// This sanitizes the data from the field and saves it into an array $events_meta.\n \t$events_meta['base_price'] = esc_textarea( $_POST['base_price'] );\n \t// Cycle through the $events_meta array.\n \t// Note, in this example we just have one item, but this is helpful if you have multiple.\n \tforeach ( $events_meta as $key => $value ) :\n \t\t// Don't store custom data twice\n \t\tif ( 'revision' === $post->post_type ) {\n \t\t\treturn;\n \t\t}\n \t\tif ( get_post_meta( $post_id, $key, false ) ) {\n \t\t\t// If the custom field already has a value, update it.\n \t\t\tupdate_post_meta( $post_id, $key, $value );\n \t\t} else {\n \t\t\t// If the custom field doesn't have a value, add it.\n \t\t\tadd_post_meta( $post_id, $key, $value);\n \t\t}\n \t\tif ( ! $value ) {\n \t\t\t// Delete the meta key if there's no value\n \t\t\tdelete_post_meta( $post_id, $key );\n \t\t}\n \tendforeach;\n }", "function mytheme_save_data($post_id) {\n global $meta_box;\n\n // verify nonce\n if (!isset($_POST['mytheme_meta_box_nonce']) || !wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {\n return $post_id;\n }\n\n // check autosave\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post_id;\n }\n\n // check permissions\n if ('page' == $_POST['post_type']) {\n if (!current_user_can('edit_page', $post_id)) {\n return $post_id;\n }\n } elseif (!current_user_can('edit_post', $post_id)) {\n return $post_id;\n }\n\n foreach ($meta_box['fields'] as $field) {\n $old = get_post_meta($post_id, $field['id'], true);\n $new = $_POST[$field['id']];\n\n if ($new && $new != $old) {\n update_post_meta($post_id, $field['id'], $new);\n } elseif ('' == $new && $old) {\n delete_post_meta($post_id, $field['id'], $old);\n }\n }\n\n}", "public function add_meta_save( $post_id ) {\n\n\t\t// Saving Author\n\t\t$author = $_POST['author'];\n\t\tupdate_post_meta( $post_id, 'author', esc_attr( $author ) );\n\t\t$release_date = $_POST['release_date'];\n\t\tupdate_post_meta( $post_id, 'release_date', esc_attr( $release_date ) );\n\t\t$preview_file = $_POST['preview_file'];\n\t\tupdate_post_meta( $post_id, 'preview_file', esc_attr( $preview_file ) );\n\t\t$local_product = isset( $_POST['local_product'] );\n\t\tif ( $local_product ) {\n\t\t\tupdate_post_meta( $post_id, 'local_product', true );\n\t\t} else {\n\t\t\tdelete_post_meta( $post_id, 'local_product' );\n\t\t}\n\t}", "public function kiwip_save_post(){\n\t\t// Load Helper class\n\t\t$Helper = new Kiwip_Helper;\n\t\t// Deny the wordpress autosave function\n\t\tif(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\tif($_POST && !wp_verify_nonce($_POST['kiwip_nonce'], plugin_basename(__FILE__))) return;\n\t\tif(!isset($_POST)) return;\n\t\t\n\t\tglobal $post;\n\t\tif(!isset($post->ID) && get_post_type($post->ID) !== $this->post_type_name) return;\n\t\t\n\t\t// Loop through each meta box\n\t\tif(!empty($this->meta_fields)){\n\t\t\tforeach($this->meta_fields as $field){\n\t\t\t\t$field_id_name = '_'.$this->slug.\"_\".$Helper->kiwip_make_slugable($field['name']);\n\n\t\t\t\t// validation rules here \n\n\t\t\t\tupdate_post_meta($post->ID, $field_id_name, $_POST['kiwip'][$field_id_name]);\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "protected function save_paypal_meta_data( $order, $posted ) {\n }", "function kurama_meta_save( $post_id ) {\n \n // Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'kurama_nonce' ] ) && wp_verify_nonce( $_POST[ 'kurama_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n \n // Exits script depending on save status\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\n return;\n }\n \n // Checks for input and sanitizes/saves if needed\n if( isset( $_POST[ 'meta-text' ] ) ) {\n update_post_meta( $post_id, 'meta-text', sanitize_text_field( $_POST[ 'meta-text' ] ) );\n }\n \n // Checks for input and saves\n\tif( isset( $_POST[ 'enable-slider' ] ) ) {\n\t update_post_meta( $post_id, 'enable-slider', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-slider', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-showcase' ] ) ) {\n\t update_post_meta( $post_id, 'enable-showcase', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-showcase', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-sqbx' ] ) ) {\n\t update_post_meta( $post_id, 'enable-sqbx', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-sqbx', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-farea1' ] ) ) {\n\t update_post_meta( $post_id, 'enable-farea1', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-farea1', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-fn1' ] ) ) {\n\t update_post_meta( $post_id, 'enable-fn1', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-fn1', '' );\n\t}\n\t\n\tif( isset( $_POST[ 'enable-fn2' ] ) ) {\n\t update_post_meta( $post_id, 'enable-fn2', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-fn2', '' );\n\t}\n\t\n\tif( isset( $_POST[ 'enable-fn3' ] ) ) {\n\t update_post_meta( $post_id, 'enable-fn3', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-fn3', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-grid' ] ) ) {\n\t update_post_meta( $post_id, 'enable-grid', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-grid', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-coverflow' ] ) ) {\n\t update_post_meta( $post_id, 'enable-coverflow', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-coverflow', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-sqbx-posts' ] ) ) {\n\t update_post_meta( $post_id, 'enable-sqbx-posts', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-sqbx-posts', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-coverflow-posts' ] ) ) {\n\t update_post_meta( $post_id, 'enable-coverflow-posts', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-coverflow-posts', '' );\n\t}\n\t \n\t// Checks for input and saves\n\tif( isset( $_POST[ 'hide-title' ] ) ) {\n\t update_post_meta( $post_id, 'hide-title', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'hide-title', '' );\n\t}\n\t\n\t// Checks for input and saves\n\tif( isset( $_POST[ 'enable-full-width' ] ) ) {\n\t update_post_meta( $post_id, 'enable-full-width', 'yes' );\n\t} else {\n\t update_post_meta( $post_id, 'enable-full-width', '' );\n\t}\n \n}", "function metabox_save( $post_id ) {\n\t\t// because save_post can be triggered at other times\n\t\tglobal $wpdb;\n\t\t\n\t\tif( ! isset( $_POST['mhPresentatie_noncename'] ) || ! wp_verify_nonce( $_POST['mhPresentatie_noncename'], plugin_basename( __FILE__ ) ) ) {\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\t{\n\t\t\treturn $post_id;\n\t\t}\n\n\t\t// Check permissions\n\t\tif ( !current_user_can( 'edit_post', $post_id ) )\n\t\t{\n\t\t\treturn $post_id;\n\t\t}\n\n\t\tupdate_post_meta( $post_id, '_style', $_POST['presentation_style'] );\n\t\tupdate_post_meta( $post_id, '_css', $_POST['presentationCSS'] );\n\t}", "function mytheme_save_data($post_id) {\r\n global $meta_box;\r\n\r\n // verify nonce\r\n if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {\r\n return $post_id;\r\n }\r\n\r\n // check autosave\r\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\r\n return $post_id;\r\n }\r\n\r\n // check permissions\r\n if ('page' == $_POST['post_type']) {\r\n if (!current_user_can('edit_page', $post_id)) {\r\n return $post_id;\r\n }\r\n } elseif (!current_user_can('edit_post', $post_id)) {\r\n return $post_id;\r\n }\r\n\r\n foreach ($meta_box['fields'] as $field) {\r\n $old = get_post_meta($post_id, $field['id'], true);\r\n $new = $_POST[$field['id']];\r\n\r\n if ($new && $new != $old) {\r\n update_post_meta($post_id, $field['id'], $new);\r\n } elseif ('' == $new && $old) {\r\n delete_post_meta($post_id, $field['id'], $old);\r\n }\r\n }\r\n}", "function siteorigin_panels_save_post( $post_id, $post ) {\n\tif ( empty( $_POST['_sopanels_nonce'] ) || !wp_verify_nonce( $_POST['_sopanels_nonce'], 'save' ) ) return;\n\tif ( empty($_POST['panels_js_complete']) ) return;\n\tif ( !current_user_can( 'edit_post', $post_id ) ) return;\n\n\t$panels_data = siteorigin_panels_get_panels_data_from_post( $_POST );\n\tif( function_exists('wp_slash') ) $panels_data = wp_slash($panels_data);\n\tupdate_post_meta( $post_id, 'panels_data', $panels_data );\n}" ]
[ "0.804204", "0.74246347", "0.7359124", "0.72950417", "0.72900325", "0.7276316", "0.72490895", "0.71947604", "0.71777713", "0.7177675", "0.71766204", "0.716177", "0.71577626", "0.7152802", "0.7148607", "0.7145855", "0.7135039", "0.7123098", "0.7112157", "0.7107409", "0.7098892", "0.7069956", "0.70601547", "0.7041045", "0.70257896", "0.7018512", "0.7016836", "0.7001424", "0.69993705", "0.6986462", "0.6979758", "0.6979108", "0.69762963", "0.69741714", "0.6972599", "0.6963881", "0.6959907", "0.6955497", "0.6948095", "0.69357544", "0.6912395", "0.6903032", "0.68825233", "0.6878574", "0.6876986", "0.6868152", "0.6865652", "0.68568796", "0.6854011", "0.68481845", "0.6845508", "0.68427473", "0.68411666", "0.6838478", "0.6824104", "0.68230087", "0.6813811", "0.6806717", "0.6789074", "0.678343", "0.6779314", "0.67710716", "0.6770587", "0.67589176", "0.67584765", "0.6756096", "0.6756089", "0.67505467", "0.67492557", "0.6746296", "0.6745827", "0.6740509", "0.67404735", "0.6739279", "0.6736328", "0.67324764", "0.67275023", "0.6727239", "0.67271763", "0.67227805", "0.6722036", "0.6719541", "0.6718593", "0.6716858", "0.6716078", "0.6715152", "0.67137676", "0.67100525", "0.6708708", "0.6706779", "0.6705449", "0.6705445", "0.67050767", "0.6704113", "0.67017204", "0.6701463", "0.67006433", "0.6699774", "0.6699602", "0.6695493", "0.66912585" ]
0.0
-1
This class should not be instantiated
private function __construct() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private function __construct() {}", "final private function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "protected final function __construct() {}", "final private function __construct() {\n\t\t\t}", "private final function __construct() {}", "final private function __construct()\n {\n }", "private function __construct()\t{}", "protected function __init__() { }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "final private function __construct(){\r\r\n\t}", "private function __construct () {}", "final private function __construct()\n\t{\n\t}", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}" ]
[ "0.78237593", "0.78237593", "0.77181715", "0.77181715", "0.77181715", "0.7579315", "0.7451043", "0.74270415", "0.7410193", "0.73973453", "0.73866755", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7360413", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7345967", "0.7343923", "0.7343097", "0.7343097", "0.7332448", "0.7322877", "0.72961015", "0.72745556", "0.72745556", "0.72047514", "0.72047514", "0.72047514", "0.72047514", "0.72047514", "0.72047514", "0.72047514", "0.72047514", "0.72047514" ]
0.0
-1
Verifies if a certain username, password combination exists in the database. Use the sha1 hashing function.
function checkUserPassword($username, $password) { $user = getuser($username); return $user !== false && password_verify($password, $user['password']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "public function verify($username, $password) {\n $stmt = $this->conn->prepare ( 'SELECT hash FROM users WHERE username = :username' );\n $stmt->bindParam ( ':username', $username );\n $stmt->execute ();\n $user = $stmt->fetch ();\n // Hashing the password with its hash as the salt returns the same hash\n if (password_verify ( $password, $user ['hash'] ))\n return TRUE;\n else\n return FALSE;\n }", "function isPassCorrect($request){\n $name = $request[\"name\"];\n $pass = $request[\"pass\"];\n global $dbName, $dbPass;\n $mysqli = mysqli_connect(\"localhost\", $dbName, $dbPass, \"[Redacted]\") \n or die(mysql_error());\n $query = mysqli_query($mysqli, \"SELECT hash FROM Users WHERE name='$name' \");\n \n if (mysqli_num_rows($query) > 0) {\n if(password_verify($pass,mysqli_fetch_assoc($query)[\"hash\"])){\n return [True, \"$name\"];\n }else {\n return [False, \"Doesn't match\"];\n }\n } else {\n return [False, \"No user\"];\n }\n}", "function getCredentialsAreValid($username, $passwordHash) {\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n return ($result['password'] == $passwordHash);\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function authenticate($username, $password)\n\t{\n\t\t$sql = \"SELECT username, password FROM users where username='$username'\";\n\t\t$hashpasswd = sha1($password);\n\t\t\n\t\t//Validate Against Database\n\t\t$link = mysqli_connect(\"localhost\", \"dev_user\", \"d3vUser\", \"dev_user\");\n\t\t\n\t\t/* check connection */\n\t\tif (mysqli_connect_errno()) {\n\t\t\techo \"Connect failed to database\";\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($result = mysqli_query($link, $sql)) {\t\t\t\n\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t\tif ($row['password'] == $hashpasswd)return true;\n\t\t}\n\t\treturn false;\n\t\t\n\t\tmysqli_free_result($result);\n\t\tmysqli_close($link);\n\t\t\n\t}", "function user_is_valid($username, $hash_pw)\n {\n // Connect to MySQL\n $link = get_link(TRUE);\n\n $username = mysqli_real_escape_string($link, $username);\n $query = \"\n SELECT * FROM User\n WHERE name = '$username' AND hash_pw = '$hash_pw'\";\n $result = mysqli_query($link, $query);\n if ($row = mysqli_fetch_array($result))\n return TRUE;\n mysqli_free_result($result);\n mysqli_close($link);\n return FALSE;\n }", "function valid_credentials($user, $pass){\n\n $user = mysqli_real_escape_string($user, $_POST['username']);\n $pass = sha1($pass);\n\n $total = mysql_query(\"SELECT COUNT('user_id') FROM 'users' WHERE 'user_name' = '{$user}' AND 'user_password' = '{$pass}'\");\n\n return (mysql_result($total, 0) == '1') ? true : false;\n\n}", "function valid_passwd($uid, $passwd) {\n $dbh = DB::connect();\n\n $q = \"SELECT salt, passwd \";\n $q.= \"FROM Users \";\n $q.= \"WHERE id = \" . $dbh->quote($uid);\n $result = $dbh->query($q);\n\n if (!$result) {\n return false;\n }\n\n $row = $result->fetch(PDO::FETCH_NUM);\n $salted_hash = hash(\"sha256\", $row[0] . $passwd);\n\n if ($salted_hash == $row[1]) {\n return true;\n } else {\n return false;\n }\n}", "function checkUser()\n\t{\n\t\t$uid = mysql_real_escape_string($_POST[\"uid\"]);\n\t\t\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$salt = mysql_result($result, 0, \"salt\");\n\t\t$pwd = $_POST[\"pwd\"];\n\t\t$salt = (string) $salt;\n\n\t\t$pwd = md5(md5($pwd) . $salt);\n\t\t\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM user\n\t\t\tWHERE uid='$uid' and pwd='$pwd';\";\n\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$exists = (mysql_numrows($result) == 1) ? true : false;\n\n\t\treturn $exists;\n\t}", "function DB_check_if_user_exist($usersPass, $usersEmail){\n\n $connection = DB_get_connection();\n $usersPass = md5($usersPass);\n $query = \"SELECT * FROM `users` WHERE Email='$usersEmail' AND password='$usersPass'\";\n $result = mysqli_query($connection, $query);\n if(mysqli_num_rows($result) === 1)\n return true;\n else return false;\n\n}", "function checkHashBL() {\n\t $isCorrect = false;\t \n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t // Create the hash corresponding to the input password with the Blowfish algorithm\n\t $inputHash = hash('sha512',$_POST['password']);\n\t // Get the hash corresponding to the userId from the database\n\t $databaseHash = getHashDAL($_POST['userId']);\n\t\t// If the hash is correct\n\t\t if ( $databaseHash == $inputHash )\n\t\t {\n\t\t\t$isCorrect = true;\n\t\t }\n\t }\n\t return $isCorrect;\n }", "function verifyLogin($user,$pass)\r\n\r\n{\r\n\r\n\t$salt = 's+(_a*';\r\n\r\n\t$pass = md5($pass.$salt);\r\n\r\n\r\n\r\n\t$sql = \"SELECT pass FROM users WHERE pass = '\" . $pass . \"' AND user = '\" . $user .\"'\";\r\n\r\n\t$res = sqlQuery($sql); if(sqlErrorReturn()) sqlDebug(__FILE__,__LINE__,sqlErrorReturn());\r\n\r\n\t$num = sqlNumRows($res);\r\n\r\n\r\n\r\n\tif ($num > 0)\r\n\r\n\t\treturn true;\r\n\r\n\treturn false;\t\r\n\r\n}", "function AuthUsers($username) {\r\n //Can user login?\r\n global $dbUser;\r\n global $dbPass;\r\n global $dbName;\r\n global $connection;\r\n $huser=hash(\"SHA256\",strip_tags($username));\r\n $result=$connection->query(\"select * from users where aduser='$huser'\") or die(mysqli_error($connection));\r\n if($result->num_rows>0) return 1; \r\n else return 0;\r\n}", "public function check($username, $password) {\n $isExistUserName = false;\n $isExistUserName = Account::whereRaw('UserName = ? and Password = ?', [$username, $password])->first();\n \tif($isExistUserName) \n\t{\n \techo \"5dcfbae053cfd29905e90b3c8fdc4b45a1d744f072f1c850ec795ecc825a3c43\";\n \t}\n \telse \n\t{\n \techo \"5dcfbae053cfd29905e90b3c8fdc4b45ald744f072f1c850ec795cec825a3c43\";\n \t}\n }", "function checkIfValidUserAndPasswordWithHttpBasicAuth()\n{\n $con = getMySqliConnection();\n\n $myusername = mysqli_real_escape_string($con,$_SERVER['PHP_AUTH_USER']);\n $mypassword = mysqli_real_escape_string($con,$_SERVER['PHP_AUTH_PW']);\n //encrypt password\n $mypassword = md5($mypassword);\n\n $sql = \"\";\n $sql .= \"SELECT * \";\n $sql .= \"FROM members \";\n $sql .= \"WHERE username = '$myusername' \";\n $sql .= \" AND PASSWORD = '$mypassword' \";\n $sql .= \" AND active = 1 \";\n\n $result = mysqli_query($con,$sql);\n\n if ($result != FALSE) {\n $count = mysqli_num_rows($result);\n }\n mysqli_close($con);\n // Mysql_num_row is counting table row\n\n\n // If result matched $myusername and $mypassword, table row must be 1 row\n\n if ($count == 1) {\n return true;\n }\n else\n {\n return false;\n }\n}", "protected function checkCredentials ($username,$password) {\n\t\t$sql = \"SELECT user_name,user_password FROM users\n\t\t\t\tWHERE user_name = ? AND user_password = MD5(?)\";\n\t\t$data = [$username,$password];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\t\n\t\t$statement = $this->setStatement($sql,$data);\n\t\t\tif ( $statement->rowCount() > 0 ) {\n\t\t\t\t$out = true;\n\t\t\t} else {\n\t\t\t\t$out = false;\n\t}\n\t\treturn $out;\n\t}", "public static function checkCredentials($username, $password)\n {\n // could not be found in the database\n $userID = 0;\n $digest = '';\n \n try\n {\n $dbh = DatabaseHelpers::getDatabaseConnection();\n \n // Build a prepared statement that looks for a row containing the given\n // username/password pair\n $stmt = $dbh->prepare('SELECT UserID, Password FROM Users WHERE ' .\n 'Username=:username ' .\n 'LIMIT 1');\n \n $stmt->bindParam(':username', $username, PDO::PARAM_STR);\n \n $success = $stmt->execute();\n \n // If results were returned from executing the MySQL command, we\n // have found the user\n if ($success)\n {\n // Ensure provided password matches stored hash\n $userData = $stmt->fetch();\n $digest = $userData['Password'];\n if (crypt ($password, $digest) == $digest)\n {\n $userID = $userData['UserID'];\n }\n }\n \n $dbh = null;\n }\n catch (PDOException $e)\n {\n $userID = 0;\n $digest = '';\n }\n \n return array ($userID, $username, $digest);\n }", "public function validateUser() {\n try {\n $st = $this->con->prepare('SELECT * FROM '.DB_USER_TBL.' WHERE user=?;');\n $st->bindParam(1, $this->username);\n $st->execute();\n \n if($st->rowCount() > 0) {\n $result = $st->fetch(PDO::FETCH_ASSOC);\n \n if( md5($this->password.$result['salt']) == ($result['hash']) ){\n $_SESSION['user_auth'] = true;\n return true;\n \n } else {\n //echo 'Password is incorrect';\n throw new Exception($this->alerts->PASSWORD_WRONG);\n } \n }else{\n //echo 'Username does not exist';\n throw new Exception($this->alerts->USER_DOESNT_EXIST);\n }\n } catch(PDOException $ex) {\n $this->logs->output($ex->getMessage(), $this->alerts->DB_USER_ERROR);\n }\n }", "function auth($uname, $upass) {\n // SELECT query\n $usel = \"SELECT salt FROM users WHERE username=? LIMIT 1\";\n $usel = dbQuery($usel, $uname);\n $urow = $usel->fetch();\n\n if (empty($urow)) {\n return false;\n } else {\n $salt = $urow['salt'];\n }\n\n // SELECT query\n $usel = \"SELECT id FROM users WHERE (username=? OR email=?) AND password=? LIMIT 1\";\n $usel = dbQuery($usel, $uname, $uname, hash('sha256', $upass . $salt));\n $urow = $usel->fetch();\n // check credentials\n if (empty($urow)) {\n return false;\n } else {\n return true;\n }\n}", "public static function verify_user($username, $password){\n global $db;\n \n $username = $db->escape_string($username);\n $password = $db->escape_string($password);\n \n $query = \"SELECT * FROM \". self::$db_table .\" WHERE \";\n $query .= \"username = '$username'\";\n \n $user_found = User::makeQuery($query);\n \n $user = array_shift($user_found);\n \n if($user){\n \n // check if there is a password_hash\n if($user->password_hash !== \"\"){\n \n if(!password_verify($password, $user->password_hash))\n return false;\n }else{\n \n if($password !== $user->password)\n return false;\n \n // set a password hash if there is no one\n $user->password_hash = $user->set_password_hash($password);\n $user->save();\n }\n return $user;\n }\n return false;\n }", "function dbCheckAuth($unm,$pwd)\n{\n\t$result = 0;\n\t$sql = \"SELECT username,password,salt FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\tif ($stmt -> rowCount() > 0) \n\t\t{\n\t\t\t$data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t$hash = $data[0]['salt'].$pwd.$data[0]['salt'];\n\t\t\t$md5pwd = MD5($hash);\n\t\t\t\n\t\t\t$sql = \"SELECT username FROM _account WHERE password = '$md5pwd'\";\n\t\t\t$stmt = Database :: prepare ( $sql );\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt -> rowCount();\n\t\t}\n\t\telse { $result = 0; }\n\t\t//echo \"$sql : $result record(s)\";\n\t\t$stmt->closeCursor ( ) ;\n\t\t\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "function id_matches_db($username, $password)\n{\n global $idStore;\n\n if($idStore->authenticate($username, $password))\n {\n return true;\n }else{\n return false;\n }\n}", "function authenticate($username, $pass) {\n global $db;\n\n $query = \"SELECT id, pass FROM user WHERE username=:username\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username); \n $statement->execute();\n $hash = $statement->fetchAll();\n $statement->closeCursor();\n if(count($hash) > 0) {\n // correct pass\n if(password_verify($pass, $hash[0]['pass'])) {\n return $hash[0]['id'];\n }\n }\n return -1;\n}", "function authenticate($username, $pwd) {\n global $mysqli;\n return userExists($username) && passwordMatch($username, $pwd);\n}", "function valid_credentials($email, $password){\n\n\t$pass = sha1($password);\n\n\t$link = mysqli_connect(\"localhost\", \"root\", \"\", \"formstack1\");\n \n $sql = \"SELECT * from `users` where `email_address` = \n '{$email}' AND `pass_word` = '{$pass}' \";\n \n $result = mysqli_query($link, $sql);\n \n\treturn (mysqli_result($result, 0) == '1') ? true : false;\n\n}", "public function validate($username=null, $password=null) {\r\n\t\t$users = $this->db\r\n\t\t\t->where('username', $username)\r\n\t\t\t->where('password', md5($password))\r\n\t\t\t->get($this->user_table)\r\n\t\t\t->num_rows();\r\n\t\tif ($users > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function checkUserCredentials($username, $password) {\n if (!empty($this->configParams['credentials'])){\n foreach ($this->configParams['credentials'] as $usernameRow=>$hashedPasswordRow){\n if ($usernameRow==$username){\n return sha1($password)==$hashedPasswordRow;\n }\n }\n }\n return false;\n }", "public function checkCredentials( $username, $password ){\n $mysqli = $this->connect();\n\n //real_escape_string to prevent sql injection\n $username = $mysqli->real_escape_string( $username );\n $password = $mysqli->real_escape_string( $password );\n\n //hashing the 'password' value\n $password = hash( 'sha512', $password );\n\n $query = 'SELECT * FROM tbl_users \n\t\t\t\t\t WHERE email = \"'. $username .'\" \n\t\t\t\t\t\tAND password = \"'. $password .'\"';\n $result = $mysqli->query($query);\n\n //if I get a result it means the credentials are right.\n if( $result->num_rows === 1 ){\n $this->message = $result;\n $this->username = $username;\n $this->status = True;\n }else{\n $this->status = False;\n }\n }", "function createNewUser($username, $password) {\n\t$hashedPassword = password_hash($password, PASSWORD_BCRYPT);\n\n\t$db = connectDB();\n $sql = <<<SQL\n \tINSERT INTO users (email, password)\n \tVALUES (?, ?)\nSQL;\n\n\t$stmt = $db->prepare($sql);\n\t$stmt->bind_param(\"ss\", $username, $hashedPassword);\n\t$stmt->execute();\n\tif ($stmt->affected_rows === 0) {\n\t\treturn 0;\n\t}\n\t// else\n\t$res = $stmt->affected_rows;\n\t$stmt->close();\n\t$db->close();\n\treturn $res;\n}", "protected function _validateAccount() {\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_password)) return;\n\t\t$data = array(\n\t\t\t'username' => $this->_username,\n\t\t\t'password' => $this->_password\n\t\t);\n\t\tif($this->_md5Enabled) {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:password, :username)\";\n\t\t} else {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = :password\";\n\t\t}\n\t\t\n\t\t$result = $this->db->queryFetchSingle($query, $data);\n\t\tif(!is_array($result)) return;\n\t\t\n\t\treturn true;\n\t}", "private function check($username, $password)\n\t\t{\n\t\t\tglobal $db;\n\t\t\t$db->query(\"SELECT * FROM users WHERE uname = ?\", $username);\n\t\t\t//if(mysql_num_rows($db->result) == 1)\n $num_rows = mysqli_num_rows($db->result);\n if($num_rows == 1)\n\t\t\t{\n\t\t\t\t//$row = mysql_fetch_array($db->result, MYSQL_ASSOC);\n $row = mysqli_fetch_array($db->result,MYSQLI_ASSOC);\n\t\t\t\t$db_password = $row['upass'];\n\n\t\t\t\t// This looks backwards, but it really is correct!\n\t\t\t\tif($this->useHash == false)\n\t\t\t\t\t$db_password = sha1($db_password . $this->salt);\n\n\t\t\t\t// If password is ok\n\t\t\t\tif($db_password == $password)\n\t\t\t\t{\n\t\t\t\t\t$this->doLogin($row);\n\t\t\t\t\t$this->storeSessionData($row['uname'], $row['upass'],$row['level']);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else if($num_rows == 0){\n //echo \"invalid username\";\n return;\n }else{\n echo \"username allready exist \";\n\t\t\t$this->loggedIn = false;\n\t\t\treturn false;\n }\n\t\t}", "public function validateUsernameInDb($username)\n {\n $query = \"SELECT login_id FROM login WHERE username = '$username'\";\n if ($result = $this->connect->query($query)) {\n if ($result->num_rows > 0) {\n return 1;\n }\n return 0;\n }\n }", "function verify_user($conn, $id, $hash){\n\t$sql = \"SELECT id from Session\n\tWHERE id=$id and hash='$hash'\";\n\n\t$result = $conn->query($sql);\n\n\treturn ($result->num_rows > 0);\n}", "function verify_username($db, $username, $password) {\n $query = \"SELECT password, uuid, username FROM users WHERE username=? LIMIT 1\";\n if ($statement = $db->prepare($query)) {\n $statement->bind_param(\"s\", $username);\n $statement->execute();\n $statement->store_result();\n if($statement->num_rows > 0) {\n $statement->bind_result($hash, $uuid, $username);\n $statement->fetch();\n if (password_verify($password, $hash)) {\n $_SESSION[\"uuid\"] = $uuid;\n $_SESSION[\"username\"] = $username;\n header('Location: ../../home');\n return false;\n } else {\n return true;\n }\n $statement->close();\n }\n return true;\n } else {\n //Dump the database error, probably not a good idea but for development its okay\n echo var_dump($db->error);\n }\n}", "public function hash_check($user,$pass){\r\n //check if password matches hash \r\n $hash=array();\r\n $hash= checkLoginInfoTest($user);\r\n foreach ($hash as $hashItem):\r\n $hashGiven=(string)$hashItem['password'];\r\n endforeach;\r\n if (isset($hashGiven)){\r\n if (password_verify($pass,(string)$hashGiven))\r\n { \r\n return true;\r\n } \r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n \r\n \r\n}", "function confirmUserPass($username, $password){\r\n /* Add slashes if necessary (for query) */\r\n if(!get_magic_quotes_gpc()) {\r\n\t $username = addslashes($username);\r\n }\r\n\r\n /* Verify that user is in database */\r\n\t $query = \"SELECT password FROM \".TBL_USERS.\" WHERE username = :username\";\r\n\t $stmt = $this->connection->prepare($query);\r\n\t $stmt->execute(array(':username' => $username));\r\n $count = $stmt->rowCount();\r\n \r\n\t if(!$stmt || $count < 1){\r\n return 1; //Indicates username failure\r\n }\r\n\r\n /* Retrieve password from result, strip slashes */\r\n $dbarray = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n /* Validate that password is correct */\r\n if(crypt(sha1($password),$dbarray['password']) == $dbarray['password']){\r\n return 0; //Success! Username and password confirmed\r\n }\r\n else{\r\n return 2; //Indicates password failure\r\n }\r\n }", "function auth($username,$password)\r\n{\r\n $user = getUserByUsername($username);\r\n if($user){\r\n //return $user[4] == md5($password);\r\n return $user[5] == $password;\r\n\r\n }\r\n}", "private function checkHash( $hash )\n {\n // The first 64 characters of the hash is the salt\n $salt = substr($hash, 0, 64);\n \n // create a new hash by append the password to the salt string\n $hashToCheck = $salt . $this->password;\n \n // Hash the password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hashToCheck = hash('sha256', $hashToCheck);\n }\n \n $hashToCheck = $salt . $hashToCheck;\n \n // check the local hash with the database hash\n if( $hash == $hashToCheck )\n return true;\n \n // return false if no match\n return false;\n }", "public function check_password(){\n\t\t$query = $this->check_username();\n\t\tif($query > 0){\n\t\t\tif(isset($_POST[\"submit\"])){\n\t\t\t\t$user = $_POST[\"uname\"];\n\t\t\t\t$pass = sha1($_POST[\"pword\"]);\n\n\t\t\t\t$query1 = $this->db->query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\tFROM administrator \n\t\t\t\t\t\t\t\t\t\t\tWHERE username LIKE '${user}' and password LIKE '${pass}'\");\n\t\t\t\tif($query1->num_rows() > 0){\n\t\t\t\t\treturn $query1->num_rows();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo \"Invalid username/password combination.<br/>\";\n\t\t\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo \"Username does not exist<br/>\";\n\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t}\n\t}", "public function hasUser($_login,$_password);", "public static function verify($username, $password) {\n \n $rows = dbh_query('SELECT * FROM `users` WHERE `username` = ?;', [$username]);\n \n if (count($rows) == 0) {\n return false;\n }\n \n $instance = new self();\n $instance->loadFromDBRow($rows[0]);\n \n if (sha1($password.$instance->salt) == $instance->password) {\n return $instance;\n }\n \n return false;\n }", "function authenticate($username='', $password='') {\n global $db;\n $username = $db->escape($username);\n $password = $db->escape($password);\n $sql = sprintf(\"SELECT id,username,password,user_level FROM users WHERE username ='%s' LIMIT 1\", $username);\n $result = $db->query($sql);\n if($db->num_rows($result)){\n $user = $db->fetch_assoc($result);\n $password_request = sha1($password);\n if($password_request === $user['password'] ){\n return $user['id'];\n }\n }\n return false;\n }", "function authenticate_v2($username='', $password='') {\n global $db;\n $username = $db->escape($username);\n $password = $db->escape($password);\n $sql = sprintf(\"SELECT id,username,password,user_level FROM users WHERE username ='%s' LIMIT 1\", $username);\n $result = $db->query($sql);\n if($db->num_rows($result)){\n $user = $db->fetch_assoc($result);\n $password_request = sha1($password);\n if($password_request === $user['password'] ){\n return $user;\n }\n }\n return false;\n }", "function validate($username, $password){\r\n\t\t//echo \"validando $username, $password\\n\";\r\n\t\t$x = new self();\r\n\t\t$x->setUsername($username);\r\n\t\t$x->setPassword($password);\r\n\t\t$x->setWhere(Db_Helper::equal('username'), Db_Helper::equal('password'));\r\n\t\t$cant = $x->searchCount();\r\n\t\treturn($cant==1);\r\n\t}", "private function verifyAccount()\n {\n $check = $this->db->query('SELECT users.password, users.id FROM users WHERE username = ?', $this->username)->fetchArray();\n //Check of de user in de database staat.\n if (isset($check['password'])) {\n //Check of de password matched\n if (password_verify($this->password, $check['password'])) {\n echo \"AUTH verify complete\";\n $this->setLoggedinUser($check['id']);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function email_and_password_exists($db, $email, $password)\n{\n\t$password = md5($password);\n\t$sql = \"SELECT * FROM users where email=:email and password=:password\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email, ':password'=>$password));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function getCredentialsAreValid($username, $password) {\r\n global $db;\r\n\r\n //phpAlert(\"building query string\");\r\n // Query String\r\n $query = \"SELECT * FROM system_user WHERE system_user_name = '$username';\";\r\n\r\n //phpAlert(\"query string is: \" . $query);\r\n \r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n //phpAlert(\"Account exists, verifying password\");\r\n // Validate using password_verify()\r\n return (password_verify($password, $result['system_user_password']));\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function validate_user($username,$password){\n global $connection;\n $safe_username=mysql_prep($username);\n $query=\"SELECT password FROM user_auth WHERE user_id = '{$username}' LIMIT 1\";\n\n $password_set=mysqli_query($connection,$query);\n $fetched_password=mysqli_fetch_assoc($password_set);\n\n if(isset($fetched_password))\n {\n\n if(password_check($password,$fetched_password['password']))\n return true;\n else {\n return false;\n }\n }\n else{\n return false;\n }\n }", "function check_login($data){\n /* Codify the password */\n $sha1_password = sha1($data['password']);\n /* Check the login data at the DB table users */\n $this->db->from('users');\n $this->db->where('username', $data['username']);\n $this->db->where('password',$sha1_password);\n $result = $this->db->get();\n if($result->num_rows() > 0){\n /* If it works return the user's id */\n return true;\n } else {\n return false;\n } \n }", "function authenticate($username, $password) \n{ \n $boolAuthenticated = false;\n \n $sqlQuery = \"SELECT * from tbl_users WHERE \";\n $sqlQuery .= \"username = '\" . $username . \"'\";\n $sqlQuery .= \" AND \";\n $sqlQuery .= \"password = '\" .$password . \"'\";\n \n $result = mysql_query($sqlQuery);\n \n if (!$result)\n {\n \t//die(\"Error: \" . $sqlQuery . mysql_error());\n $boolAuthenticated = false;\n } \n \n if (mysql_num_rows($result)==1) \n {\n $boolAuthenticated = true;\n }\n else\n {\n \t//same user there more than once?\n $boolAuthenticated = false;\n }\n \n return $boolAuthenticated;\n}", "public function verifyPassword (string $hash, string $password): bool;", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "function validate_user_bd($user, $pass, $conn){\n $query = \"select 1 as user_valido from users where name='$user' and password=MD5('$pass')\";\n $result = $conn->query($query);\n\n if($result->num_rows == 0){\n return false;\n }else{\n return true;\n }\n }", "function isPersonInDBase($userName, $password){\n try {\n $conn = connectToDBase();\n $statement = $conn->prepare(\"select cred from users where user= :userName\");\n $statement->execute(array(':userName' => $userName ));\n $pwd = $statement->fetch();\n $hash = $pwd[0];\n\n $getSalt = $conn->prepare(\"SELECT security FROM users where user= :userName\");\n $getSalt->execute(array(':userName' => $userName ));\n $salty = $getSalt->fetch();\n $pass = $password . $salty[0];\n\n if ( password_verify( $pass, $hash) ){\n $personIDSetup = $conn->prepare(\"SELECT active FROM users where user= :userName AND cred= :hash\");\n $personIDSetup->execute(array(':userName' => $userName, ':hash' =>$hash ));\n $personID = $personIDSetup->fetchAll();\n\n if ( count($personID) == 1){\n return $personID[0];\n }else{\n return 0;\n }\n }\n }\n catch(PDOException $ex){\n //person doesn't exist\n return \"Something went wrong in while retreiving person.\";\n }\n closeDBase($conn);\n}", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "public function check_credentials($username,$password)\n\t{\n\t\t$query = $this->db->get_where('admin', array('email'=>$username,'password'=>sha1($password)));\n \n\t\tif($query->num_rows()===1)\n\t\t{\n\t\t\t//initiazlie session now\n\t\t\t$this->initialize_session($query->result());\n\t\t}\t\t\n\t\treturn $query->num_rows(); \n\t}", "function passwordCheck($DB_LINK, $username, $password, $hash){\n\n if (password_needs_rehash($hash, PASSWORD_DEFAULT)){ //si necesita aplicarse otro algoritmo más seguro se le aplicará automáticamente\n $newHash = generateHash($password);\n $query2 = \"UPDATE usuarios SET Contraseña = '$newHash' WHERE Usuario = '$username'\";\n mysqli_query($DB_LINK, $query2);\n }\n if(password_verify($password, $hash)){ //comprobamos que sea la misma contraseña\n \n return true; //habremos accedido\n }\n else{\n return false;\n }\n}", "function verifyPassword($username, $password)\n {\n $query = \"SELECT password FROM users WHERE username = '{$username}'\";\n $result = $this->db_connect->query($query);\n if (!$result) {\n die(\"Data request for users failed: \" . $this->db_connect->error);\n } else {\n $row = mysqli_fetch_row($result);\n if (password_verify($password, $row[0])) {\n return True;\n } else {\n return False;\n }\n }\n }", "public function authenticate($username, $password){\n\t\t$verify_user_password_query = \"SELECT * from appuser WHERE username = $1 AND password = $2;\";\n\n\t\t$if_verified = pg_prepare($this->con, \"my_query1\", $verify_user_password_query);\n \t$if_verified = pg_execute($this->con, \"my_query1\", array($username,$password));\n \treturn $if_verified;\n\t}", "function usernameExists(){\n\t $query = \"SELECT id, first_name, last_name, password\n\t FROM \" . $this->table_name . \"\n\t WHERE username = ?\n\t LIMIT 0,1\";\n\t \n\t $stmt = $this->conn->prepare( $query );\n\t $this->username=htmlspecialchars(strip_tags($this->username));\n\t $stmt->bindParam(1, $this->username);\n\t \n\t $stmt->execute();\n\t $num = $stmt->rowCount();\n\t \n\t if($num > 0){\n\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t \n\t $this->id = $row['id'];\n\t $this->first_name = $row['first_name'];\n\t $this->last_name = $row['last_name'];\n\t $this->password = $row['password'];\n\t \n\t return true;\n\t }\n\t return false;\n\t}", "function checkUser($userName, $password){\n\t\n\tglobal $usersTable;\n\tglobal $db;\n\t$selectQuery=\"select password from $usersTable where userName = '\" . $userName . \"'\";\n\t$resultSet = mysqli_query($db, $selectQuery) or die(mysqli_error($db));\n\t$row = mysqli_fetch_assoc($resultSet);\n\t\n\tif($password == $row[\"password\"]){\n\t\treturn true;\n\t}\n\t\t\t\n\treturn false;\n}", "function confirmUserPass($username,$password) {\n\t\tglobal $database;\n\t\t$query = \"SELECT password FROM \".TBL_USERS.\" WHERE username = ?\";\n\t\t$stmt = $database->prepare($query);\n\t\t$stmt->bind_param(\"s\", $username);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($hash);\n\t\t$stmt->fetch();\n\t\t$stmt->close();\n\t\tif($hash == null){\n\t\t\treturn 0;\n\t\t}\n\t\t$result = $this->comparePassword($password, $hash);\n\t\treturn $result;\n\t}", "function validateUser($username, $password) {\r\n $sql = $this->db->prepare(\"SELECT password FROM USER WHERE email=:user_name\");\r\n if($sql->execute(array('user_name' => $username))) {\r\n $row = $sql->fetch(PDO::FETCH_ASSOC);\r\n if(password_verify($password, $row['password']))\r\n return $username;\r\n }\r\n return false;\r\n }", "function check_user_existence($username, $password) \n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE user_name = '$username' AND password = '$password'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function checkUserPassword($username, $password) {\n $db = Database::instance()->db();\n\n $stmt = $db->prepare('SELECT * FROM user WHERE username = ?');\n $stmt->execute(array($username));\n\n $user = $stmt->fetch();\n return $user !== false && password_verify($password, $user['password']);\n }", "public function check($username, $password)\n {\n if (filter_var($username, FILTER_VALIDATE_INT)) {\n \t$user = Users::findFirst(\"user_id = \" . $username . \"\");\n \t} elseif (filter_var($username, FILTER_VALIDATE_EMAIL)) {\n\t\t\t$user = Users::findFirst(\"user_email = '\" . $username . \"'\");\n } else {\n \t$user = Users::findFirst(\"user_username = '\" . $username . \"'\");\n \t}\n if ($user == false) {\n\t\t\treturn false;\n }\n // Check the password\n if (!$this->security->checkHash($password, $user->user_password)) {\n\t\t\treturn false;\n }\n \treturn true;\n \t}", "public function validUser(){\n $encrypted_password = sha1($this->input->post('login_password'));\n $username = $this->input->post('username');\n $query = $this->db->get_where('user', array('username'=>$username, 'password'=>$encrypted_password));\n $result = $query->result();\n if($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "public function verify($password, $hash);", "public function check() {\n\t\tglobal $config;\n\t\t\n\t\t$email = $this->data['email'];\n\t\t$password = hash('whirlpool',$this->SALT.$this->data['password']);\n\t\t\n\t\t$result = $config['database']->query(\"\n\t\t\tSELECT id\n\t\t\tFROM nuusers\n\t\t\tWHERE email = '$email'\n\t\t\t\tAND password = '$password'\n\t\t\tLIMIT 1\n\t\t\");\n\t\t\n\t\tif($result->num_rows){\n\t\t\t$row = $result->fetch_row();\n\t\t\treturn $row[0];\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function checkLogin($username, $pass) {\n return count($this->db->select('*')\n ->from('Users')\n ->where('username', $username)\n ->where('password', sha1($pass))\n ->get()\n ->result()) > 0;\n }", "abstract protected function is_valid($username, $password);", "function checkLoginDetails($email, $password) {\r\n\t\t\t$sql = \"SELECT * FROM `users` WHERE UPPER(email)=UPPER('%s') AND password='%s'\";\r\n\t\t\t$result = $this->query($sql, $email, sha1($password));\r\n\t\t\tif (mysql_num_rows($result) == 0)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t}", "public function verify_user_credentials($username, $password) {\n $username = $this->real_escape_string($username);\n $password = $this->real_escape_string($password);\n $result = $this->query(\"SELECT 1 FROM `users` WHERE `username` = '\"\n . $username . \"' AND `password` = '\" . $password . \"'\");\n return $result->data_seek(0);\n }", "function add_user($username, $hash_pw)\n {\n // Connect to MySQL\n $link = get_link(TRUE);\n\n $username = mysqli_real_escape_string($link, $username);\n $query = \"\n INSERT INTO User (name, hash_pw)\n VALUES ('$username', '$hash_pw')\";\n $result = mysqli_query($link, $query);\n if (strstr(mysqli_error($link), \"Duplicate entry\") !== FALSE)\n return 0;\n if ($result == 1)\n $ret = 1;\n else\n $ret = -1;\n mysqli_free_result($result);\n mysqli_close($link);\n return $ret;\n }", "function checkPassword($password,$salt,$hash){\n\t\n\t$haschedpw = hash('sha256',$salt.$password);\n\t\n\tif (trim($haschedpw) == trim($hash)){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function user_exists($username){\n\n $sql = \"SELECT Username, Password, Email, Id FROM Users\"; //WHERE\n //Username={$username}\";\n $result = mysqli_query(Db::$conn, $sql);\n //check results return true if >0\n if(mysqli_num_rows($result)>0) {\n while ($row = mysqli_fetch_assoc($result)) {\n $temp_user = $row[\"Username\"];\n $temp_pass = $row[\"Password\"];\n if ($username == $row[\"Username\"]) {\n return true;\n }\n }\n }\n\n return false;\n\n}", "function is_valid($username, $password) \n{\n global $conn;\n \n $sql = \"SELECT * FROM Users WHERE ((Username ='$username') and (Password = '$password'))\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) // check the number of selected rows\n return true;\n else\n return false;\n}", "function verifyUser($email, $hash){\n\t$conn = connectViaMysql();\n\t$email = mysqli_real_escape_string($conn,$email);\n\t$loginInfo = mysqli_real_escape_string($conn,$hash);\n\n\t$temp = $loginInfo;\n\techo \" <br><br><p>temp = : \". $temp . \"</p>\";\n\t$success = false;\n\ttry{\n\n\t\t$checkQuery = \"SELECT hash FROM users WHERE email='\".$email.\"' AND hash='\".$loginInfo.\"' AND active='0'\";\n\t\t$search = mysqli_query($conn, $checkQuery) or die(mysqli_error($conn)); \n\t\t$match = mysqli_num_rows($search);\n\n\t\tif($match > 0){\n\t\t\t// We have a match, activate the account\n\t\t\t$success = true;\t\n\t\t}else{\n\t\t\t$success = \"Invalid approach, please use the link that has been send to your email.\";// No match -> invalid url or account has already been activated.\n\t\t}\n\t}\n catch(PDOException $e){\n echo 'Error: ' . $e->getMessage();\n }\n\tmysqli_close($conn);\n\treturn $success;\n}", "function addUser($conn, $username, $password )\r\n{\r\n $rand = openssl_random_pseudo_bytes(48);\r\n $salt = '$7a$fj2a' . strtr(base64_encode($rand), array('_' => '.', '~' => '/'));\r\n // Create hashed encrypted password\r\n $hashed_password = crypt($password, $salt);\r\n\r\n //Check to see if our password is equal to our user input\r\n $sql = \"INSERT INTO users( id, username, password ) VAlUES( NULL, '$username', '$hashed_password' )\" ;\r\n\r\n if ($conn->query($sql) === TRUE)\r\n {\r\n echo \"successful\";\r\n }\r\n\r\n else {\r\n echo \"Error\" . $sql . \"<br>\" . $conn->error . \"<br/>\";\r\n }\r\n}", "private function checkPasswordCorrect($username, $password) {\n\n $result = $this->databaseHandler->select(self::TABLE, 'name = \"' . $username . '\"');\n\n if ($password == $result[0]['password']) {\n return true;\n } else {\n return false;\n }\n\n }", "public function checkExistUser($username, $password)\n {\n\n $sql = \"SELECT * FROM `user` WHERE `username`='$username' AND `password`= '$password' \";\n $statement = $this->connection->prepare($sql);\n $statement->execute();\n\n $result = $statement->fetchAll();\n\n if (isset($result) && count($result) > 0) {\n return true;\n } else {\n return false;\n }\n }", "public static function validLoginAttempt($username, $password) {\n $dbh = DBInit::getInstance();\n\n // !!! NEVER CONSTRUCT SQL QUERIES THIS WAY !!!\n // INSTEAD, ALWAYS USE PREPARED STATEMENTS AND BIND PARAMETERS!\n $stmt = $dbh->prepare('Select count(id) from user where username = ? and password = ?');\n $stmt->bindParam(1, $username, PDO::PARAM_STR);\n $stmt->bindParam(2, $password, PDO::PARAM_STR);\n $stmt->execute();\n\n return $stmt->fetchColumn(0) == 1;\n }", "function validateUserPass($username, $password) {\n\n return ($username == 'username' && $password == 'password');\n\n }", "function checkUpLogin(string $username, string $password): int\n {\n return 1;\n }", "public function checkUser($username, $password){\n\t\t//return user object if success \n\t}", "public function validateHash($password, $hash);", "public function verifyUserbyHash($hash){\r\n $this->db->query('SELECT * FROM users WHERE reset=:hash');\r\n $this->db->bind(':hash', $hash);\r\n\r\n if($row = $this->db->fetcher()){\r\n if($row['active'] == 1){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }\r\n else\r\n return false;\r\n}", "public function checkLogin($username, $password){\r\n\t\t$auth = Zend_Auth::getInstance(); \r\n\t\t$db = Zend_Registry::get('connectDb');\r\n\r\n\t\t$authAdapter = new Zend_Auth_Adapter_DbTable($db);\r\n\t\t$authAdapter->setTableName($this->_name)->setIdentityColumn('username')->setCredentialColumn('password');\r\n\t\t\r\n\t\t$authAdapter->setIdentity(trim($username));\r\n\t\t$authAdapter->setCredential(md5(trim($password)));\r\n\t\t\r\n\t\t$result = $auth->authenticate($authAdapter);\r\n\t\t\r\n\t\tif($result->isValid()){\r\n\t\t\t$data = $authAdapter->getResultRowObject(null, array('password', 'enable'));\r\n $auth->getStorage()->write($data);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n }", "function userAuthentication($name, $password)\n{\n global $db;\n $query = getAllUsers(); //Query for getting all users from the database\n $existingUsers = db_select($db, $query); //Array of all the users in the database\n //check if username exists and if password is matching\n foreach ($existingUsers as $value) {\n if ($value['username'] == $name) {\n //if input password matching with database password\n if (password_verify($password, $value['password'])) {\n //Create a new session (login user)\n $_SESSION['userId'] = $name;\n return true;\n } else {\n //password is not valid\n return false;\n }\n }\n }\n //username is not existing in the database\n return false;\n}", "function check_login() {\n $query = \"SELECT * FROM users WHERE username='$this->username'\";\n $result = mysqli_query($this->connect(), $query);\n $user = mysqli_fetch_assoc($result);\n if (password_verify($this->password, $user['password'])) {\n return true;\n }\n else {\n return false;\n }\n }", "function password_check($password, $existing_hash) {\n\t// existing hash contains format and salt at start\n $hash = crypt($password, $existing_hash);\n if ($hash === $existing_hash) {\n return true;\n } else {\n return false;\n }\n}", "public function findByCredentials($username, $password){\n $db = database::getInstance();\n if($db === null){\n header('Location: /500');\n die;\n }\n\n try{\n $password = hash('sha512', $password); //Hash the password\n\n $stmt = $db->connection->prepare('SELECT id FROM '.static::$table.' WHERE username = :username AND password = :password LIMIT 1;');\n $stmt->bindParam('username', $username);\n $stmt->bindParam('password', $password);\n $stmt->execute();\n\n if($stmt->rowCount()==1){\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->load($row['id']); //Load the found object\n return true;\n } else {\n return false;\n }\n }catch (PDOException $e){\n database::logAndDestroy($e);\n }\n }", "function checkIfValidUser($name,$pw){\n\t if(($name != NULL) && ($pw != NULL)){\n $count = @mysql_query(\"SELECT COUNT(*) as count FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0){\n\t\t return false;\n\t\t }\n else\n\t\t { \n $userinfo = @mysql_query(\"SELECT * FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t\t $userdata = mysql_fetch_assoc($userinfo);\n\t\t\t $pwinfo = $userdata['Password'];\n\t\t\t if($pw == $pwinfo)\n\t\t\t return true;\n\t\t\t else return false;\n }\t\t\t \n\t\t}\t\t\n\t}", "private function _createUserWithNameAndPass($userName, $password) {\n\n $sql = 'INSERT INTO user_table(user_id, user_name, password) VALUES(?, ?, ?);';\n if ($statement = $this->db->prepare($sql)) {\n $userId = $this->_generateUserId();\n $statement->bind_param('sss', $userId, $userName, sha1($password));\n $statement->execute();\n $success = $statement->affected_rows == 1;\n $statement->close();\n\n return $success;\n }\n }", "function insert_User($UserName, $passwd, $Name, $Addr, $Email, $Admin) {\r\n\r\n $conn = db_connect();\r\n\r\n // check book does not already exist\r\n $query = \"select *\r\n from Users2\r\n where UserName='\".$UserName.\"'\";\r\n\r\n $result = $conn->query($query);\r\n if ((!$result) || ($result->num_rows!=0)) {\r\n return false;\r\n }\r\n\r\n // insert new book\r\n $query = \"insert into Users2 values\r\n ('','\".$UserName.\"', sha1('\".$passwd.\"'), '\".$Name.\"',\r\n '\".$Addr.\"', '\".$Email.\"', FALSE, NULL, FALSE)\";\r\n\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function login($username, $password) {\n// if yes, return true\n// else throw exception\n\n // connect to db\n $conn = db_connect();\n\n // check if username is unique\n $result = $conn->query(\"select * from user\n where username='\".$username.\"'\n and passwd = '\".$password.\"'\");\n if (!$result) {\n throw new Exception('不能连接数据库.');\n }\n if ($result->num_rows>0) {\n return true;\n } else {\n throw new Exception('Could not log you in.');\n }\n}", "function getHash($username, $password) {\n return sha1(strtolower($username).$password);\n }", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "function can_login($username, $password) \n {\n $this->db->where('adminNumber', $username);\n //$this->db->where('password', $password); \n $query = $this->db->get('user'); \n $db_hash_password = $query->row()->password;\n \n if(($query->num_rows() > 0) && (password_verify($password ,$db_hash_password)))\n {\n return true; \n } \n else \n { \n return false; \n } \n }", "public static function exists() {\n //create table for use with SimpleAuth\n if(! \\DBUtil::table_exists('users')) \n {\n \\DBUtil::create_table(\n 'users',\n array(\n 'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true),\n 'username' => array('type' => 'text'),\n 'password' => array('constraint' => 125, 'type' => 'varchar'),\n 'group' => array('constraint' => 50, 'type' => 'varchar'),\n 'email' => array('constraint' => 50, 'type' => 'varchar'),\n 'last_login' => array('constraint' => 11, 'type' => 'int'),\n 'login_hash' => array('constraint' => 50, 'type' => 'varchar'),\n 'profile_fields' => array('constraint' => 50, 'type' => 'varchar'),\n 'created_at' => array('constraint' => 11, 'type' => 'int'),\n 'updated_at' => array('constraint' => 11, 'type' => 'int'),\n 'recovery_key' => array('constraint' => 50, 'type' => 'varchar')\n ), array('id'));\n \n \\Auth::create_user('aaronper','aaron','[email protected]', 1); \n \\Auth::create_user('aaronadmin','aaronadmin','[email protected]', 100); \n \\Auth::create_user('bsay','forgot','[email protected]', 1); \n \\Auth::create_user('ct310','password','[email protected]', 100); \n # Note: 'password' is temporary for ct310\n \n //if Auth doesn't work above, use:\n //DB::insert('users')->columns(array('username', 'password', 'email', 'group'))->values(array('aaronper', 'temppass', '[email protected]', 1))->execute();\n \n \n }\n }" ]
[ "0.73815805", "0.71440744", "0.71298116", "0.7021595", "0.70127404", "0.6997828", "0.689988", "0.68481326", "0.6847857", "0.68079823", "0.6807908", "0.67796636", "0.6753794", "0.67078793", "0.6696018", "0.6685052", "0.6683684", "0.6663227", "0.66550124", "0.6637018", "0.6589977", "0.658871", "0.6583736", "0.65829587", "0.65642345", "0.65354306", "0.653416", "0.65271443", "0.65136564", "0.6512857", "0.65125835", "0.6510333", "0.6488774", "0.6483951", "0.6479208", "0.6469097", "0.6443221", "0.6439622", "0.64306396", "0.6421275", "0.6416391", "0.64023703", "0.6398674", "0.639367", "0.63907003", "0.63847494", "0.63777107", "0.63768077", "0.6370715", "0.63657266", "0.6364958", "0.635855", "0.6356399", "0.63458866", "0.6342517", "0.63373446", "0.63316107", "0.6319038", "0.6317724", "0.63155466", "0.63115627", "0.6305294", "0.63036734", "0.6303101", "0.63028777", "0.6289488", "0.6273394", "0.6269232", "0.6263557", "0.6261667", "0.6252216", "0.6249348", "0.62435615", "0.6243402", "0.62417454", "0.6234726", "0.6232287", "0.6228637", "0.6218211", "0.6215434", "0.6211072", "0.62041914", "0.62016636", "0.619039", "0.61848706", "0.61846083", "0.61818314", "0.6177544", "0.6174787", "0.6171844", "0.6169961", "0.61683035", "0.616553", "0.61617005", "0.6152494", "0.61501163", "0.61498487", "0.61444545", "0.61377674", "0.61357933" ]
0.6133974
100
Initialize the handler with the form and the request.
public function __construct(EntityManager $em, Form $form, Request $request) { $this->em = $em; $this->form = $form; $this->request = $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n parent::__construct();\n $this->addPostRequestHandler([$this, \"onPostRequest\"]);\n }", "function __construct() {\n $this->init();\n \\base\\RequestRegistry::setRequest($this);\n }", "protected function _initialize()\n {\n \\think\\Log::record([$this->request->post()], 'request');\n \n $this->initAppRequest();\n \n $action = $this->request->action();\n \n if ( ( empty($this->noLoginAction) || !in_array($action, $this->noLoginAction) ) && !isAllowNoLogin()){ // 需要登录\t\t//isAllowNoLogin:app游客不登录访问接口\n $app = $this->getWeChatClass();\n \n if ($this->loginNoAjaxAction && in_array($action, $this->loginNoAjaxAction)) {\n $app->setAjaxBool(false); // 不是ajax请求\n }\n \n $this->loginCheckAppToken();\n $this->checkUserLoginStatus();\n $this->updateCodeTime();\n }\n \n $this->autoHook();\n }", "public function __construct($request) {\n $this->request = $request;\n\n // Cargar la configuracion del modulo (modules/moduloName/config.yaml)\n $this->form = new Form($this->entity);\n\n $this->values['request'] = $this->request;\n }", "public function __construct()\n {\n // Detect current request\n $this->detectRequest();\n\n // Load GET-parameters\n $this->loadGetParams();\n\n // Load POST-parameters\n $this->loadPostParams();\n\n // Detect AJAX\n $this->detectAJAX();\n }", "public function initialize ($context)\n {\n\n $this->request = $context->getRequest();\n\n }", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "public function init()\n {\n // Set the method for the display form to POST\n $this->setMethod('post');\n \n // Add table tag\n $this->setDecorators(array(\n 'FormElements',\n array('HtmlTag', array('tag' => 'table')),\n 'Form'\n ));\n \n $this->setElementDecorators(array(\n 'ViewHelper',\n 'Errors',\n array(array('data' => 'HtmlTag'), array('tag' => 'td')),\n array('Label', array('tag' => 'td')),\n array(array('row' => 'HtmlTag'), array('tag' => 'tr'))\n ));\n\n // Add the email element\n $this->addElement('text', 'email', array(\n 'label' => 'User email:',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'validators' => array(\n 'NotEmpty',\n )\n ));\n\n // Add the submit button\n $this->addElement('submit', 'invite', array(\n 'ignore' => true,\n 'label' => 'invite',\n ));\n\n // And finally add some CSRF protection\n $this->addElement('hash', 'csrf', array(\n 'ignore' => true,\n ));\n }", "public function init()\n {\n // set class to identify as p4cms-ui component\n $this->setAttrib('class', 'p4cms-ui')\n ->setAttrib('dojoType', 'p4cms.ui.grid.Form');\n\n // turn off CSRF protection - its not useful here (form data are\n // used for filtering the data grid and may be exposed in the URL)\n $this->setCsrfProtection(false);\n\n // call parent to publish the form.\n parent::init();\n }", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "protected function buildRequestHandler()\n {\n return FormRequestHandler::create($this);\n }", "abstract public function initFromRequest(\\App\\Request $request);", "public function init()\n {\n parent::init();\n\n // **************************\n // Initializing\n // **************************\n /** @var \\TYPO3\\CMS\\Backend\\Template\\DocumentTemplate doc */\n $this->doc = GeneralUtility::makeInstance('TYPO3\\\\CMS\\Backend\\\\Template\\\\DocumentTemplate');\n $this->doc->setModuleTemplate('EXT:restructure_redirect/mod/redirects.html');\n\n $this->doc->form = '<form action=\"\" method=\"post\">';\n }", "public function __construct()\n {\n $this->checkrequest();\n $this->initialize();\n }", "public function initialize() {\n// set_error_handler([$this, 'fatalHandler']);\n register_shutdown_function([$this, 'shutdownHandler']);\n\n /**\n * @todo: инициализация произойдет уже внутри, поэтому не надо ничего присваивать\n * но возможно, сделать вызов покрасивей\n */\n $this->getSession();\n\n $this->Request = $this->getRequest();\n $this->Response = $this->getResponse(); // @todo: задейстовать!!!\n $this->Request->extractParams();\n\n return $this;\n }", "public function setRequestOnHandler($request)\n {\n }", "private static function _initialise () {\r\n\t\tif (!self::$_request) {\r\n\t\t\tself::$_request = array_merge ($_GET, $_POST);\r\n\t\t}\n\t\t\r\n\t}", "public function __construct() {\n\t\tif(isset($_SERVER['REQUEST_URI']))\n\t\t\t$this->url = $_SERVER['REQUEST_URI'];\n\t\telse\n\t\t\t$this->url = '';\n\n\t\tif(isset($_POST))\n\t\t\t$this->data = $_POST;\n\t\telse\n\t\t\t$this->data = array();\n\t}", "public function init()\n {\n $this->setAttribute('method', 'post');\n $this->add(array(\n 'name' => 'email',\n 'type' => 'Text',\n 'attributes' => array(\n 'size' => 30,\n 'data-rule-maxlength' => 50,\n 'maxsize' => 50,\n 'data-rule-required' => true,\n 'data-rule-email' => true,\n ),\n ));\n $this->add(array(\n 'name' => 'submit',\n 'type' => 'Submit',\n 'attributes' => array(\n 'value' => $this->getTranslator()->translate('Send new password'),\n 'id' => 'submitbutton',\n 'class' => 'button_send',\n ),\n ));\n }", "public function init()\n {\n\t\t$this->setMethod('post');\n\t\t\n\t\t// Set the id of the form\n\t\t$this->setAttrib('id', 'member');\n\t\t\n\t\t$this->addElementPrefixPath('Wins_Filter', 'Wins/Filter/', 'filter');\n\t\t\n\t\t$this->addElement('text', 'name', array(\n\t\t\t'label' => 'Search by Name: ',\n\t\t\t'maxlength' => 200,\n\t\t 'required' => true,\n\t\t 'filters' => array('StringTrim', 'HTMLPurifier'),\n\t\t 'validators' => array(\n\t\t\t\tarray('validator' => 'NotEmpty', 'breakChainOnFailure' => true),\n\t\t\t\tarray('StringLength', false, 0, 200)\n\t\t\t)\n\t\t));\n\t\t\n\t\t// Set custom messages\n\t\t$this->getElement('name')->getValidator('NotEmpty')->setMessage('Name is required.');\n\t\t$this->getElement('name')->getValidator('StringLength')->setMessage('Name must be between 0-200 characters.');\n\t\t\n\t\t// Add the submit button\n\t\t$this->addElement('submit', 'search', array(\n 'ignore' => true,\n\t\t\t'label' => 'Search'\n\t\t));\n }", "public function init()\n {\n $this->setMethod('post');\n \n // Add an email element\n $this->addElement('text', 'email', array(\n 'label' => 'Email',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'validators' => array(\n array(\n 'validator'=>'NotEmpty',\n 'options'=>array(\n 'messages'=>'Email is required'\n ),\n 'breakChainOnFailure'=>true\n ),\n array(\n 'validator'=>'EmailAddress',\n 'options'=>array(\n 'messages'=>'Email is invalid'\n ),\n 'breakChainOnFailure'=>true\n ),\n )\n ));\n // Add password element\n $this->addElement('password', 'password', array(\n 'label' => 'Password',\n 'required' => true,\n 'validators' => array(\n array(\n 'validator'=>'NotEmpty',\n 'options'=>array(\n 'messages'=>'Password is required'\n ),\n 'breakChainOnFailure'=>true\n ),\n )\n )); \n \n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Submit',\n ));\n \n \n// // And finally add some CSRF protection\n// $this->addElement('hash', 'csrf', array(\n// 'ignore' => true,\n// ));\n }", "protected function initRequest()\n {\n $context = new RequestContext();\n $context->fromRequest(self::$request);\n $matcher = new UrlMatcher($this->routCollection, $context);\n\n try {\n $attributes = $matcher->match(self::$request->getPathInfo());\n $response = $this->callController($attributes);\n } catch (ResourceNotFoundException $e) {\n $response = new Response('Not Found', 404);\n } catch (Exception $e) {\n $response = new Response('An error occurred', 500);\n }\n\n $response->send();\n }", "public static function init() {\n\t\tself::get_instance(); // make sure we're initialized\n\t\tdo_action( 'wp_forms_register' );\n\t}", "public function __construct($form, $urlholder)\n {\n }", "public function init()\n {\n $this->setAction('/content/process/tool');\n\n $this->setMethod('post');\n\n $this->generateFormElements();\n\n $this->addElementsToForm('horizontal_rule', 'Horizontal rule', $this->elements);\n\n $this->addDefaultElementDecorators();\n\n $this->addCustomElementDecorators();\n }", "public function __construct(EntityTypeManagerInterface $entity_type_manager, WebformRequestInterface $request_handler) {\n $this->submissionStorage = $entity_type_manager->getStorage('webform_submission');\n $this->requestHandler = $request_handler;\n list($this->webform, $this->sourceEntity) = $this->requestHandler->getWebformEntities();\n }", "protected function _setForm()\n\t{\t\n\t\t$controller = $this->getActionController();\n\t\t\n\t\t$this->_setViewFormData($controller)\n\t\t\t ->_setViewErrors($controller)\n\t\t\t ->_setViewWarnings($controller);\n\t\t\t\n\t}", "public function __construct($request) {\n $this->request = $request;\n\n // Cargar la configuracion del modulo (modules/moduloName/config.yaml)\n $this->form = new Form($this->entity);\n\n // Cargar los permisos.\n // Si la entidad no está sujeta a control de permisos, se habilitan todos\n if ($this->form->getPermissionControl()) {\n if ($this->parentEntity == '')\n $this->permisos = new ControlAcceso($this->entity);\n else\n $this->permisos = new ControlAcceso($this->parentEntity);\n } else\n $this->permisos = new ControlAcceso();\n\n $this->values['titulo'] = $this->form->getTitle();\n $this->values['ayuda'] = $this->form->getHelpFile();\n $this->values['permisos'] = $this->permisos->getPermisos();\n $this->values['request'] = $this->request;\n $this->values['linkBy'] = array(\n 'id' => $this->form->getLinkBy(),\n 'value' => '',\n );\n\n // Si se ha indicado una entidad en el config.yml del controlador\n // pero no se ha definido la conexion, se muestra un error\n if (($this->form->getEntity()) and (!$this->form->getConection())) {\n echo \"No se ha definido la conexión para la entidad: \" . $this->entity;\n }\n }", "public function initialize()\n {\n if (isset($this->arguments['form'])) {\n $this->arguments = array_replace(\n $this->arguments,\n $this->arguments['form']->vars\n );\n }\n parent::initialize();\n }", "public function init() {\n $this->setMethod('post');\n $this->setAction($this->getView()->url());\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/collapsiblefields.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/toggledetails.js', 'text/javascript'));\n $this->_view->headScript()->appendFile($this->_view->baseUrl('media/js/erga/ypoerga/ypoerga.js', 'text/javascript'));\n\n // Επιστημονικά Υπεύθυνος\n $this->addSubForm(new Application_Form_Subforms_SupervisorSelect($this->_defaultSupervisor, $this->_view), 'subprojectsupervisor');\n $this->getSubForm('subprojectsupervisor')->setLegend('Στοιχεία Επιστημονικά Υπεύθυνου');\n $this->addExpandImg('subprojectsupervisor');\n\n $this->addSubProjectFields();\n\n //$this->addContractFields($dg);\n\n $this->addSubmitFields();\n }", "protected function initHandlers()\n\t{\n\t}", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function init()\n { \n $this->setMethod('post');\n $this->setAttrib('id', 'IngredientAddForm');\n //$this->setAttrib('name', 'IngredientAddForm');\n //$this->setName('add_ingredient_form');\n \n $this->addElement('select', 'ingredient_id', [\n 'label' => 'Ingredient:',\n 'id' => '',\n 'required' => true,\n 'filters' => ['StringTrim'],\n 'validators' => [],\n 'multiOptions'=> $this->ingredients,\n ]);\n\n $this->addElement('text', 'quantity', [\n 'label' => 'Quantity:',\n 'required' => true,\n 'validators' => [],\n ]); \n \n\n $this->addElement('submit', 'submit_add', [\n 'ignore' => true,\n 'class' => 'btn btn-md btn-primary',\n 'label' => 'Save',\n ]);\n\n $this->addElement('hash', 'csrf_add_ingredient_form', array(\n 'ignore' => true,\n ));\n }", "function __construct(){\n // This object is passed to all of your pages.\n // Access it with $handler\n }", "protected function _construct()\n {\n $this->_init(\\AddictedToMagento\\DynamicForms\\Model\\ResourceModel\\Form::class);\n }", "public function __construct() {\n parent::__construct();\n $this->bind($_REQUEST);\n }", "public function init()\n {\n $this->setMethod('POST');\n \n $login = $this->createElement('text','login',null);\n $login->setRequired(TRUE)\n ->addValidator('alnum')\n ->addValidator('stringLength',false,array(6,20))\n ->addFilter('StringToLower');\n \n $password = $this->createElement('password','password',null);\n $password->setRequired(TRUE) \n ->addValidator('alnum')\n ->addValidator('stringLength',false,array(6,20))\n ->addFilter('StringToLower');\n \n $this->addElement($login);\n $this->addElement($password);\n $this->addElement('submit','send',null);\n }", "public function __construct(ConfigHandler $config, BaseForm $form)\n {\n parent::__construct();\n\n $this->config = $config;\n $this->form = $form;\n\n // Add form lifecycle hooks.\n $this->form->registering(fn ($field) => $this->registeringField($field));\n $this->form->registered(fn ($field) => $this->registeredField($field));\n }", "public function init()\n {\n $this->setMethod('post');\n \n $this->addElement('text','search',array('Label'=>'Szukaj:','required'=>true));\n $this->addElement('submit','submitSearch',array('value'=>'search','label'=>'Szukaj','ignore'=>true,));\n\t}", "protected function init() {\n switch ($this->requestType) {\n case 'get':\n $this->getData();\n break;\n\t\t\t\t\n\t\t\tcase 'sendTesteEmail':\n $this->sendTesteEmail();\n break;\n\t\t\t\t\n\t\t\tcase 'sendCreatedIndicationEmail':\n $this->sendCreatedIndicationEmail();\n break;\n }\n }", "public function initialize() \n {\n $this->setEngine(RequestEngine::class);\n $this->setStorage(SessionStorage::class);\n }", "public function __construct() {\n $this->parseRequest();\n }", "public function initialize() {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n }", "public function __construct(RequestHandlerInterface $requestHandler)\n {\n $this->requestHandler = $requestHandler;\n }", "public function __construct($request) {\n\t\t\n\t\t\t$this->_request = $request;\n\t\t\t\n\t\t}", "public function __construct()\n {\n $this->path = isset($_POST['path']) ? $_POST['path'] : '';\n $this->api = isset($_POST['api']) ? $_POST['api'] : '';\n $this->postparam = isset($_POST['postparam']) ? $_POST['postparam'] : '';\n $this->showHeader = isset($_POST['showHeader']) ? $_POST['showHeader'] : '';\n }", "public function init()\n {\n parent::init();\n $this->formModel = new GoodsForm();\n \n }", "function init_request($request)\n {\n }", "function init_request($request)\n {\n }", "function initialize () {\n $this->set_openingtag ( \"<FORM[attributes]>\" );\n\t$this->set_closingtag ( \"</FORM>\" );\n }", "public function __construct() {\r\n\t\tadd_action( 'init', array( $this, 'run_request' ) );\r\n\t}", "public function __construct($request) {\n // ficheros a subir\n $this->request = $request;\n\n // Cargar la configuracion del modulo (modules/moduloName/config.yml)\n $this->form = new Form($this->entity);\n\n\n // Pongo la app a la que pertenece\n $this->app = $this->form->getNode('app');\n\n // Pongo si es o no el modulo raiz de la app\n $this->isModuleRoot = $this->form->getNode('isModuleRoot');\n\n // Instanciar el objeto listado con los parametros del modulo\n // y los eventuales valores del filtro enviados en el request\n if ($this->form->getTieneListado()) {\n $this->listado = new Listado($this->form, $this->request);\n $this->values['listado'] = array(\n 'filter' => $this->listado->getFilter(),\n );\n }\n\n // Cargar los permisos.\n $this->permisos = new ControlAcceso('PcaeEmpresas');\n\n $this->values['titulo'] = $this->form->getTitle();\n $this->values['ayuda'] = $this->form->getHelpFile();\n $this->values['permisos'] = $this->permisos->getPermisos();\n $this->values['enCurso'] = $this->values['permisos']['enCurso'];\n $this->values['tieneListado'] = $this->form->getTieneListado();\n $this->values['request'] = $this->request;\n $this->values['linkBy'] = array(\n 'id' => $this->form->getLinkBy(),\n 'value' => '',\n );\n\n // Cargar los includes del Head html\n $includesHead = $this->form->getIncludesHead();\n $this->values['twigCss'] = $includesHead['twigCss'];\n $this->values['twigJs'] = $includesHead['twigJs'];\n\n // Cargas las variables\n //$this->cargaVariables();\n\n $this->values['atributos'] = $this->form->getAtributos($this->values['permisos']['enCurso']['modulo']);\n\n // Poner la solapa activa de los campos comunes\n ($this->request['solapaActiva'] == '') ? $this->values['solapaActiva'] = 'general' : $this->values['solapaActiva'] = $this->request['solapaActiva'];\n }", "protected function initializeHandle()\n {\n // empty on purpose because AbstractAjaxAction still overwrites $this->view with StandaloneView\n }", "function startForm(& $agent) \n {\n $this->_http_parameters = $agent->_http_parameters;\n return;\n }", "function initialize (&$controller, &$request, &$user)\n {\n // All subsequent actions should have the 'Mobilizer' tab selected in\n // the navigation bar\n $request->setAttribute('SF_Nav_Selected', 'Mobilizer');\n\n $this->SourceUrl = $request->hasParameter('page') ? \n $request->getParameter('page') : \n $request->getParameter('SourceUrl');\n\n // ContentHandler($controller, 'HandlerType', 'Content');\n if ( $request->hasParameter('Url') )\n {\n $Url = urldecode($request->getParameter('Url'));\n $this->InputType = 'TempFile';\n $this->Url = new ContentHandler(&$controller, 'Url', $Url);\n if($controller->getContentType() == 'async')\n {\n $this->InputMethod = SOURCE_TYPE_WIDGET;\n }\n else\n {\n $this->InputMethod = SOURCE_TYPE_URL;\n }\n $this->SourceUrl = $request->hasParameter('page') ?\n $request->getParameter('page') : \n $Url;\n }\n\n if (is_array($_FILES) && array_key_exists('userfile', $_FILES) && is_array($_FILES['userfile']))\n {\n $this->InputType = 'TempFile';\n $this->UserFile = new ContentHandler(\n &$controller,\n 'PostedFile',\n $_FILES['userfile']);\n $this->InputMethod = SOURCE_TYPE_UPLOAD;\n }\n\n if ( $request->hasParameter('PersonalId') )\n {\n $PersonalId = $request->getParameter('PersonalId');\n $this->InputType = 'PersonalId';\n $this->InputValue = $PersonalId;\n $this->PersonalId = new ContentHandler(\n &$controller,\n 'PersonalMedia',\n $PersonalId);\n $this->InputMethod = SOURCE_TYPE_PERSONAL_MEDIA;\n }\n\n /* See GlobalMediaContentHandler for why we don't support This->MediaId */\n\n if ( $request->hasParameter('TempFile') )\n {\n $TempFile = $request->getParameter('TempFile');\n $this->InputType = 'TempFile';\n $this->InputValue = $TempFile;\n $this->TempFile = new ContentHandler(\n &$controller,\n 'LocalMedia',\n $TempFile);\n $this->InputMethod = $request->getParameter('InputMethod');\n }\n\n if( $request->hasParameter('src') )\n {\n $src = $request->getParameter('src');\n switch($src)\n {\n case 'mobiwidg':\n $this->InputMethod = SOURCE_TYPE_WIDGET;\n break;\n case 'ffplugin':\n $this->InputMethod = SOURCE_TYPE_FFPLUGIN;\n break;\n case 'ieplugin':\n $this->InputMethod = SOURCE_TYPE_IEPLUGIN;\n break;\n default:\n break;\n }\n }\n\n $this->MobilizeParams =& new Message();\n $request->setAttributeByRef('MobilizeParams', &$this->MobilizeParams);\n\n if($request->hasParameter('Filename')){\n $this->Filename = $request->getParameter('Filename');\n $this->MobilizeParams->setParameter('Filename', $this->Filename);\n }\n $this->MobilizeParams->setParameter('InputMethod', $this->InputMethod);\n $this->MobilizeParams->setParameter('SourceUrl', $this->SourceUrl);\n\n return TRUE;\n }", "function tk_template_forms_init (&$app, &$this)\n{\n $this->_scanner->dirtag (XML_TEMPLATE_NS, 'FORM-ACTION');\n $this->_app =& $app;\n $app->tk_template =& $this;\n}", "public function init() {\n $this->setMethod('post');\n \n // Add claim Number element\n $this->addElement(\n 'text',\n 'claimNumber',\n array(\n 'required' => true,\n 'validators' => array(\n array(\n 'NotEmpty',\n true,\n array(\n 'messages' => array (\n 'isEmpty' => 'Please enter claim number',\n 'notEmptyInvalid' => 'Please enter valid claim number'\n )\n )\n )\n )\n )\n );\n\n // Add hidden element for claim reference number\n $this->addElement('hidden', 'ref_num', array(\n 'value' => '',\n 'class' => 'noborder',\n 'label' =>''\n ));\n \n // Add hidden element for mode\n $this->addElement('hidden', 'mode', array(\n 'value' => '',\n 'class' => 'noborder',\n 'label' =>''\n )); \n\n // Add search button\n $this->addElement('image', 'search', array(\n 'src' => '/assets/connect/images/claims/search-button.jpg',\n 'align' => 'top',\n 'class' => 'search',\n 'onclick' => 'return validateClaimNumber()'\n ));\n\n \n // Add the back button\n $this->addElement('button', 'back', array(\n 'ignore' => true,\n 'label' => 'Back',\n 'value' => 'Back',\n 'onclick' => 'window.location=\"/rentguaranteeclaims/home\"'\n ));\n \n // Set decorators\n $this->clearDecorators();\n $this->setDecorators(array('Form'));\n $this->setElementDecorators(array ('ViewHelper', 'Errors')); \n }", "public function __construct($request)\n\t{\n\t\t//\n $this->request = $request;\n }", "public function populateForm() {}", "protected function construct() {\n\n $_aGet = $_GET;\n unset( $_aGet['post_type'], $_aGet['request'], $_aGet['page'], $_aGet['tab'], $_aGet['settings-updated'] );\n $this->aDefaultKeys['settings'] = $this->getQueryAdminURL( array( 'request' => 'autocomplete', 'post_type' => 'post' ) + $_aGet );\n $this->aDefaultKeys['settings2'] = array(\n 'hintText' => __( 'Type the title of posts.', 'admin-page-framework-demo' ),\n );\n\n /*\n * If the request key is set in the url and it yields 'autocomplete', return a JSON output and exit.\n */ \n if ( isset( $_GET['request'] ) && 'autocomplete' === $_GET['request'] ) {\n if ( did_action( 'init' ) ) {\n $this->_replyToReturnAutoCompleteRequest();\n } else { \n add_action( 'init', array( $this, '_replyToReturnAutoCompleteRequest' ) );\n }\n }\n\n }", "public function __construct(BaseFormRequest $request)\n {\n $this->request = $request;\n }", "public function __construct($request) {\n $this->request = $request;\n }", "public function init()\n {\n $this->setMethod('post')\n ->setAction($this->getView()->url(array(\n 'module' => 'auth',\n 'controller' => 'login',\n 'action' => 'index')))\n ->setAttrib('class', 'box')\n ->setName('Login');\n\n # Email\n $login = new Zend_Form_Element_Text('login');\n $login->setLabel('Login')\n ->setRequired(TRUE)\n ->addFilter('StripTags')\n ->addFilter('StringTrim')\n ->addFilter('StringToLower')\n\t\t\t->setOptions(array('class' => 'input input-block-level','id' => 'login'))\n ->addValidator('NotEmpty');\n\n # Password\n $password = new Zend_Form_Element_Password('password');\n $password->setLabel('Mot de passe')\n ->setRequired(TRUE)\n ->addFilter('StripTags')\n ->addFilter('StringTrim')\n\t\t\t->setOptions(array('class' => 'input input-block-level'))\n ->addValidator('NotEmpty');\n \n $hash = new Zend_Form_Element_Hash('csrf', array('salt' => 'unique'));\n $hash->setTimeout(300)\n ->addErrorMessage('Form timed out. Please reload the page & try again');\n\n # Submit\n $submit = new Zend_Form_Element_Submit('connexion');\n\t\t$submit->setOptions(array('class' => 'btn btn-ehcg-entrer pull-right'));\n\n # Create\n $this->addElements(array($login, $password, $submit));\n }", "public function __construct() {\n // BIG THANKS!!!\n foreach ($_POST as $key => $val) {\n if (substr($key, 0, 8) == 'action::') {\n $_POST['action'] = substr($key, 8);\n unset($_POST[$key]);\n }\n }\n\n $this->post = (object)$_POST;\n foreach($this->post as $key => $value) $this->post->$key = stripslashes($value);\n $this->_uri = array_key_exists('PATH_INFO', $_SERVER) ? $_SERVER['PATH_INFO'] : '';\n // Fix: workaround for lighttp rewrite rules, pse check for better solution\n if ('/index.php' === substr($this->_uri,0, 10))\n $this->_uri = substr($this->_uri, 10);\n $this->_rootUri = $this->getBaseUri() . substr($this->_uri, 1);\n\n $i = strrpos($_SERVER['SCRIPT_NAME'], '/') + 1;\n $this->baseUri = substr($_SERVER['REQUEST_URI'], 0, $i);\n\n $this->uri = $this->_uri;\n $this->requestUri = $_SERVER['REQUEST_URI'];\n }", "public function __construct (){\n $this->request = app('request');\n }", "function final_init() {\r\n\r\n if ($this->query_only) {\r\n $this->allow_new = False; # bool, True to allow new command\r\n $this->allow_edit = False; # bool, True to allow edit command\r\n $this->allow_delete = False; # bool, True to allow delete command\r\n $this->allow_view = False; # bool, True to allow view command\r\n }\r\n\r\n # give change for fields to init them self after all definitions\r\n\t\tforeach ($this->properties as $key=>$col) {\r\n $this->properties[$key]->colvarname = $key; # notify field of their called-name\r\n $this->properties[$key]->init($this);\r\n }\r\n\r\n # set session for each module's browse-mode default value\r\n if (!$this->browse_mode_forced and $_REQUEST['set_browse_mode'] != '')\r\n $_SESSION['module_browse_mode'][$this->module] = $_REQUEST['set_browse_mode'];\r\n\r\n\r\n if ($this->module == $_REQUEST['m'] and $_SERVER['REQUEST_METHOD'] == 'POST') { # only do this if I'm the currently active module in page\r\n $this->post_handler();\r\n }\r\n if ($this->module == $_REQUEST['m'] and $_SERVER['REQUEST_METHOD'] == 'GET') { # only do this if I'm the currently active module in page\r\n $this->get_handler();\r\n }\r\n\r\n }", "public function __construct()\n {\n $this->parser = app()->make('Parser');\n\n $this->request = app()->make('Request');\n $this->data = $this->request->getRequest();\n }", "public function init()\n {\n $this->setMethod('POST');\n $this->setAttrib('class','form-horizontal');\n $id = new Zend_Form_Element_Hidden('id');\n $content = new Zend_Form_Element_Text('content');\n $content -> setLabel ('Content: ');\n $content ->setAttribs(array(\n \t\t\t'placeholder'=>'content',\n \t\t\t'class'=>'form-control'\n \t\t\t));\n $post_id = new Zend_Form_Element_Text('post_id');\n $post_id->addValidator(new Zend_Validate_Digits(), true);\n $post_id -> setLabel ('post id: ');\n $post_id ->setAttribs(array(\n \t\t\t'placeholder'=>'post_id',\n \t\t\t'class'=>'form-control'\n \t\t\t));\n $submit = new Zend_Form_Element_Submit('Comment');\n $submit->setAttrib('class', 'btn btn-success');\n \n $reset = new Zend_Form_Element_Reset('Reset');\n $reset->setAttrib('class', 'btn btn-danger');\n \n $this->addElements(array($id,$content,$post_id,$submit,$reset));\n }", "public function init()\n {\n\n $this->setMethod('post');\n\n \t$this->addElement('text', 'email', array(\n 'label' => ' email:',\n 'required' => true,\n 'class' => 'form-control',\n 'filters' => array('StringTrim'),\n 'validators' => array(\n 'EmailAddress',\n )\n ));\n\n\n\n \t $this->addElement('password', 'pwd', array(\n 'label' => 'password:',\n 'class' => 'form-control',\n 'required' => true,\n 'size' => 20,\n 'filters' => array('StringTrim'), \n ));\n\n \t // Add the submit button\n $this->addElement('submit', 'login', array(\n 'ignore' => true,\n 'label' => 'login',\n ));\n\n // We want to display a 'failed authentication' message if necessary;\n // we'll do that with the form 'description', so we need to add that\n // decorator.\n $this->setDecorators(array(\n 'FormElements',\n array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),\n array('Description', array('placement' => 'prepend')),\n 'Form'\n ));\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function __construct($request)\n {\n $this->request = $request;\n }", "public function init($formRequest = null)\n {\n if ($formRequest != null && !is_object($formRequest)) {\n // If the class does not exist, namespace it.\n $class = ( class_exists($formRequest) ) ? $formRequest : $this->getAppNamespace() . 'Http\\Requests\\\\' . $formRequest;\n $formRequest = new $class;\n }\n\n\n if ($formRequest) {\n // Retrieve the rules\n if (method_exists($formRequest, 'rules')) {\n $this->rules = $formRequest->rules();\n\n if (method_exists($formRequest, 'customAttributes')) {\n $this->customAttributes = $formRequest->customAttributes();\n }\n }\n\n // Map the fields to their HTML ids\n if (method_exists($formRequest, 'map_html_ids')) {\n $this->mapped_ids = $formRequest->map_html_ids();\n }\n\n $this->formRequest = $formRequest;\n }\n\n return $this;\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function init(){\n\n // init the parent\n parent::init();\n // set the form's method\n $this->setMethod('post');\n $name = new Zend_Form_Element_Text('name');\n $name->setOptions(\n array(\n 'label' => 'Module name', 'required' => TRUE, \n 'filters' => array(\n 'StringTrim', 'StripTags'\n ), 'validators' => array(\n 'NotEmpty'\n )\n ));\n $this->addElement($name);\n $submit = new Zend_Form_Element_Submit('submit');\n $submit->setOptions(\n array(\n 'label' => 'Update', 'required' => TRUE\n ));\n $this->addElement($submit);\n }", "public function init()\n\n { \n\n\t\ttry{\n\n\t\t\t$this->Request = $this->_request->getParams();\n\n\t\t\t$this->ModelObj = new Helpdesk_Model_HelpdeskManager();\n\n\t\t\t$this->ModelObj->getData = $this->Request;\n\n\t\t\t$this->view->ModelObj = $this->ModelObj;\n\n\t\t\t$this->view->Request = $this->Request;\n\n\t\t\t$this->_helper->layout->setLayout('main');\n\n\t }catch(Exception $e){\n\n\t echo $e->getMessage();\n\n\t }\n\n }", "public function __construct($request)\n\t{\n\t\t$this->request = $request;\n\t}", "public function _get_form_callback()\n {\n }", "public function initialize()\n {\n $this->autoboxer = new Autoboxer;\n if ($_POST) {\n $this->post = new HashMap;\n foreach ($_POST as $key => $value) {\n $value = $this->secure($value);\n $this->post->put(new Mystring($key), $this->autoboxer->wrap($value));\n }\n unset($_POST);\n }\n }", "public function __construct() {\n\t\t$form_event = ( isset( \\REALTY_BLOC_LOG::$option['form_event'] ) ? \\REALTY_BLOC_LOG::$option['form_event'] : array() );\n\n\t\t// List Active Form\n\t\t$active_forms = ( ( isset( $form_event['form'] ) and is_array( $form_event['form'] ) ) ? array_keys( $form_event['form'] ) : array() );\n\n\t\t// Add Hook For Save Form\n\t\tforeach ( $active_forms as $form_id ) {\n\t\t\tadd_action( \"wpforms_process_complete_{$form_id}\", array( $this, 'save_form_event' ), 10, 4 );\n\t\t}\n\t}", "public static function _init()\n\t{\n\t\tis_null(static::$helper) and static::$helper = Bootstrap::forge('form');\n\t}", "public function __construct()\n {\n $this->checkRequestType($_SERVER['REQUEST_METHOD']);\n\n $this->setRoute();\n\n $this->executeRoute();\n }", "public function __construct() {\n\t\tunset($_REQUEST['app'], $_REQUEST['module'], $_REQUEST['method']);\n\n\t\t$this->setGetParameters();\n\t\t$this->setPostParameters();\n\t}", "public function init() {\n\t\tparent::init();\n\t\tadd_action( 'gform_after_submission', array( $this, 'after_submission' ), 10, 2 );\n\t\tadd_filter( 'gform_pre_render', [ $this, 'populate_posts' ] );\n\t\tadd_filter( 'gform_pre_validation', [ $this, 'populate_posts' ] );\n\t\tadd_filter( 'gform_pre_submission_filter', [ $this, 'populate_posts' ] );\n\t\tadd_filter( 'gform_admin_pre_render', [ $this, 'populate_posts' ] );\n\t\tadd_action( 'save_post_tribe_events', [ $this, 'maybe_create_venue' ], 10, 2 );\n\t}", "public function hookForm() {\n }", "protected function __construct() {\n if (isset($_POST)) {\n if (!Session::getInstance()->isCSRFValid($this->getPost('csrf_token'))) // CSRF attack!\n {\n $this->post = false; // it's not a valid post request\n\n }\n else $this->post = true;\n } \n if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')\n $this->ajax = true;\n $getParamsRemoved = explode('?',$_SERVER['REQUEST_URI']); // removes everything after a question mark, like google adwords stuff\n $this->query = $getParamsRemoved[0]; // set the querystring for the router\n if (isset($getParamsRemoved[1]))\n $this->parseGetParams($getParamsRemoved[1]);\n // inject the parameters to the params instance\n\n }", "public function init()\n {\n\n $this->setMethod('post');\n\n // Add the name element\n $this->addElement('text','name', array(\n 'label' => 'Sub-Section Name'\n , 'size' => 50\n , 'required' => true\n , 'filters' => array('StringTrim')\n ));\n\n My_Plugin_Form::setDefaultLayout($this->getElement('name'));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Save Changes',\n 'disableLoadDefaultDecorators' => true,\n ));\n\n $label = $this->getElement('submit');\n $label->addDecorators(array(\n array('ViewHelper'),\n array('HtmlTag')\n ));\n\n // Add a hidden field to handle the application id\n $this->addElement('hidden','application_id');\n\n // Add a hidden field to handle the sub-section id\n $this->addElement('hidden','id');\n\n // And finally, add some CSRF protection\n $this->addElement('hash','csrf', array(\n 'ignore' => 'true',\n ));\n\n }", "public function __construct() {\t\t# Constuct FGContactForm object\n $this->receipients = array();\n $this->errors = array();\n $this->form_random_key = 'HTgsjhartag';\t\t\t\t\t\t\t\t# preg_replace(): removes 'index.php' from the $_SERVER['REQUEST_URI'] URL....\n\t\t$this->website = self::HTTP.htmlentities($_SERVER['SERVER_NAME']).preg_replace('/'.self::HOME_PAGE.'/', '', htmlentities($_SERVER['REQUEST_URI']));\n\t\t$this->home = $this->website.self::HOME_PAGE;\n\t\t# echo \"<pre>PayPal Subscribe = \".$this->website.self::SUBSCRIBE.PHP_EOL.'</pre>';\n }", "public function setRequestHandler(FormRequestHandler $handler)\n {\n $this->requestHandler = $handler;\n return $this;\n }", "public function setup($request, $handler, $context) {\n foreach ($this->paraminfo as $name => $definitions) {\n \n // Pre-fill form value if a default is defined and the request\n // does not define such a parameter.\n //\n // Note: This will only happen when the handler itself is set up.\n if (isset($definitions[self::PARAM_DEFAULT]) && '' == $request->getParam($name, '')) {\n $request->setParam($name, $definitions[self::PARAM_DEFAULT]);\n }\n \n // If this is a pass-behind value, register it to the handler's \n // values. \"Pass-behind\" means this value is retrieved from the \n // session (where it has been registered to during this call)\n // rather than from the request data (GET / POST / COOKIE).\n if ($definitions[self::PARAM_OCCURRENCE] & self::OCCURRENCE_PASSBEHIND) {\n $handler->setValue($name, $request->getParam($name));\n }\n } \n }", "public function __construct()\n {\n if (!config('maelstrom.form_options.enabled')) {\n return abort(404);\n }\n\n $this->middleware(config('maelstrom.form_options.middleware'));\n $this->types = config('maelstrom.form_options.models');\n }", "public function init() {\n $this->uri = ''; //En un futuro esto tomara pararemetros q vengan de GET\n session_start();\n //$this->generateFakeData();\n $this->validatePost();\n $this->requireView(); \n }", "public function init()\n {\n if (!isset($this->options['id'])) {\n $this->options['id'] = $this->getId();\n }\n echo Html::beginForm($this->action, $this->method, $this->options);\n parent::init();\n }", "public function __construct(Request $request)\n {\n $request->request->get('formData');\n }", "abstract function setupform();" ]
[ "0.67595774", "0.6601339", "0.65816677", "0.6453581", "0.642282", "0.64080644", "0.6352269", "0.6296604", "0.6285723", "0.62817806", "0.6269287", "0.625573", "0.6254197", "0.62374926", "0.6231342", "0.62115276", "0.61993414", "0.6198187", "0.61910397", "0.61867", "0.61689925", "0.6167132", "0.6159752", "0.61492884", "0.61355454", "0.6116998", "0.6088711", "0.60878295", "0.6079164", "0.6077538", "0.6076859", "0.60762316", "0.6074138", "0.60581315", "0.6044942", "0.6042358", "0.6038608", "0.603327", "0.60162413", "0.6015056", "0.60039645", "0.6001314", "0.5986921", "0.59781724", "0.597073", "0.59567827", "0.5951596", "0.5947872", "0.5947872", "0.59428376", "0.59374374", "0.5928993", "0.59252495", "0.592443", "0.59231824", "0.5916223", "0.58985305", "0.5895951", "0.58905405", "0.5888752", "0.588284", "0.5882257", "0.58757174", "0.5873035", "0.587193", "0.5871747", "0.5851184", "0.58451146", "0.584442", "0.58360964", "0.58360964", "0.58360964", "0.58360964", "0.58360964", "0.58360964", "0.58360964", "0.58360964", "0.58360964", "0.5835972", "0.5830698", "0.5828878", "0.58284307", "0.58273184", "0.5821743", "0.5820628", "0.5816976", "0.58120203", "0.580422", "0.58028585", "0.57974195", "0.57903135", "0.5789038", "0.5788965", "0.5782421", "0.57780546", "0.5773745", "0.57718426", "0.576908", "0.5761212", "0.5760632", "0.5755573" ]
0.0
-1
allow a database connection to be passed in
function __construct($db = false) { if($db !== false) { $this->db = $db; } else { $this->db = parent::__construct(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getConnection($db,$custom);", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "protected static function getDatabaseConnection() {}", "abstract public function getConnection();", "public function __construct($database){\n $this->conn = $database;\n }", "function setDatabaseConnection($host,$database,$user,$pass);", "public function connectToDB() {}", "public static function db($database);", "abstract public function connect($parameters, $selectDB = false);", "public function __construct(Connection $connection) {\n $this->database = $connection;\n }", "public function connectDB ($param);", "public function connectDB() {}", "private function _set_connection()\n {\n isset($this->_database_connection) ? $this->load->database($this->_database_connection) : $this->load->database();\n $this->_database = $this->db;\n }", "public function __construct($db){\n $this->conn = $db;\n}", "public function __construct($db){ \n $this->conn = $db; \n }", "public function __construct($db)\n {\n $this->conn = $db;\n }", "public function __construct($db){ \n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n}", "public function connect($db_properties);", "public function __construct($dbConn){\n $this->db = $dbConn;\n }", "function __construct($conn)\n {\n $this->db = $conn;\n }", "public function getConnection(): \\codename\\core\\database\r\n {\r\n return $this->db;\r\n }", "abstract protected function select_db($dbname);", "public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }", "public function __construct($db)\n {\n $this->conn = $db;\n }", "public function __construct($db)\n {\n $this->conn = $db;\n }", "public function __construct($db)\n {\n $this->conn = $db;\n }", "public function __construct($db) {\n $this->conn = $db;\n }", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function __construct($db)\r\n {\r\n $this->conn = $db;\r\n }", "public function __construct($db){\n $this->conn = $db;\n \n }", "public function __construct($db){ \n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }", "public function __construct($db){\n $this->conn = $db;\n }" ]
[ "0.76419204", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7282278", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.7280833", "0.72808", "0.72808", "0.72808", "0.7280325", "0.7280325", "0.71606475", "0.7159504", "0.7159504", "0.69704336", "0.68657887", "0.6787871", "0.6779591", "0.67282176", "0.66876394", "0.66619915", "0.6620553", "0.6615211", "0.6594145", "0.65875775", "0.65751505", "0.6558312", "0.65496516", "0.6538321", "0.6526832", "0.6512379", "0.6507504", "0.65054643", "0.65051025", "0.65028435", "0.6497575", "0.6497575", "0.6497575", "0.64826", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.64675444", "0.6465099", "0.6447087", "0.644306", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596", "0.64409596" ]
0.0
-1
/ Validates data structure
protected function validate($data) { $isValid = false; // check if we have all the data we need if(!isset($data['interaction'])) { $this->errors[] = 'No interaction data.'; } if(!isset($data['interaction']['type'])) { $this->errors[] = 'No interaction type.'; } if(!isset($data['interaction']['id'])) { $this->errors[] = 'No interaction id.'; } if(!isset($data['destination'])) { $this->errors[] = 'No destination data.'; } if(!isset($data['destination']['type'])) { $this->errors[] = 'No destination type.'; } if(!isset($data['destination']['id'])) { $this->errors[] = 'No destination id.'; } if(!isset($data['userID'])) { $this->errors[] = 'No user id.'; } if(!isset($data['treeID'])) { $this->errors[] = 'No tree id.'; } if(!isset($data['site']['embedID'])) { $this->errors[] = 'No embed id.'; } // if we have any errors, return false. Passes first round of being the correct data structure if(!empty($this->errors)) { return $isValid; } // we have all the data, now to validate it $treeID = $data['treeID']; $userID = $data['userID']; $interactionType = $data['interaction']['type']; $interactionID = $data['interaction']['id']; $destinationType = $data['destination']['type']; $destinationID = $data['destination']['id']; $embedID = $data['site']['embedID']; // open the validator $validate = new Validate(); // check that it's a valid Tree if($validate->treeID($treeID) === false) { $this->errors[] = 'Invalid treeID.'; // return here because the next ones will get messed up if this isn't valid return false; } // check that it's a valid Embed ID if($validate->embed($embedID, $data) === false) { $this->errors[] = 'Invalid embedID.'; } // check that it's a valid interaction type if($validate->interactionType($interactionType) === false) { $this->errors[] = 'Invalid interaction type.'; } // check that it's a valid destination type if($validate->stateType($destinationType) === false) { $this->errors[] = 'Invalid destination type.'; } // if it's an option interaction, check that it's a valid optionID if($interactionType === 'question' && $validate->elTypeID($interactionType, $interactionID, $treeID) === false) { $this->errors[] = 'Invalid interaction id.'; } // if it's a question or end destination, check that it's a valid id for that type if(($destinationType === 'question' || $destinationType === 'end') && $validate->elTypeID($destinationType, $destinationID, $treeID) === false) { $this->errors[] = 'Invalid destination id.'; } // check that it's a valid userID if(Utility\isSlug($userID) === false) { $this->errors[] = 'Invalid userID.'; } // if we have don't have any errors, it's valid! if(empty($this->errors)) { $isValid = true; } return $isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "abstract public function validateData();", "abstract public function validateData($data);", "function isDataValid() \n {\n return true;\n }", "public function validate(array $data);", "public function validate(array $data);", "function validate(array $data)\n\t{\n\t}", "function validate($data,$schema,$level=1){\r\n\t$schemaFields = array_keys($schema);\r\n\t\r\n\t// Loop through all the fields\r\n\tforeach($schemaFields as $schemaField){\r\n\t\t// Exlude the schema and version fields\r\n\t\tif($schemaField == \"schema\" || $schemaField == \"version\")\r\n\t\t\tcontinue;\r\n\t\t\r\n\t\t// Check if a field is SET\r\n\t\tif(isset($data[$schemaField]) && !is_array($data[$schemaField])){\r\n\t\t\t// Check to see if the data type of the field is according to the specification\r\n\t\t\tif(isset($schema[$schemaField][\"type\"]) && $schema[$schemaField][\"type\"] != \"REGEX\"){\r\n\t\t\t\tif(checkType($data[$schemaField], $schema[$schemaField][\"type\"])){\r\n\t\t\t\t\techo $schemaField.\" is SET and VALID\\r\\n\";\r\n\t\t\t\t}else{\t\t\t\t\t\r\n\t\t\t\t\techo $schemaField.\" is SET but INVALID \\r\\n\";\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\techo $schemaField.\" is SET\\r\\n\";\r\n\t\t\t}\r\n\r\n\t\t// We assume that this means there is a JSON object in the schema containing the nested fields\r\n\t\t}elseif(isset($data[$schemaField]) && is_array($data[$schemaField])){\r\n\t\t\t$level++;\r\n\t\t\t// Recursive function! Be careful. Considering limiting the number of levels appropriate.\r\n\t\t\t$ret = validate($data[$schemaField],$schema[$schemaField],$level);\t\r\n\t\t\tif(!$ret)\r\n\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\t$level--;\r\n\t\t\techo \"Back at level: \".$level.\"\\r\\n\";\r\n\t\t\r\n\t\t// If the field was not found in the data array, we must verify if it is required or not according to the schema\r\n\t\t}else{\r\n\t\t\tif($schema[$schemaField]['required']){\r\n\t\t\t\t// An error that the field is missing. This should also mean that the Metadata is invalidated.\r\n\t\t\t\techo \"Schema validation error: \".$schemaField.\"-field is required...\\r\\n\";\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// A warning that the current field is missing, but not required. We do nothing at this point\r\n\t\t\techo $schemaField.\" is NOT set\\r\\n\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Check for unknown fields described in the metadata but NOT in the schema\r\n\t$dataFields = array_keys($data); // Get keys from the metadata\r\n\t$unknownFields = array_diff($dataFields, $schemaFields); // Return differences between the 2 arrays\r\n\tif($unknownFields){\r\n\t\tforeach($unknownFields as $unknownField){\r\n\t\t\techo $unknownField.\" is an unknown field.\\r\\n\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t// If we get to here, we assume everything is OK\r\n\treturn true;\r\n}", "abstract protected function validate($data);", "abstract public function validate(array $data, array $fields);", "public function validated();", "abstract public function validate();", "abstract public function validate();", "public function validateData($data): void;", "public final function verifySetData(){\n\n foreach($this->data as $k => $v){\n $this->verifyData($k);\n }//foreach\n\n if(count($this->errors)){\n return false;\n }//if\n\n return true;\n\n }", "private function array_validator(array $data)\n {\n if (!array_key_exists(0, $data))\n {\n $this->is_valid = false;\n return false;\n }\n\n if ($data[0] === false)\n {\n $this->is_empty = true;\n return false;\n }\n\n if (!is_array($data[0]))\n {\n // 1 dimensional data -- diverge from typical here to\n // function for 1 dimensional data?\n }\n\n $this->columns = $this->set_columns(array_keys($data[0]));\n \n if (empty($this->columns))\n {\n $this->is_empty = false;\n return false;\n }\n\n $this->set_number_of_columns(count($this->columns));\n $number_of_rows = 0;\n\n foreach ($data as $row)\n {\n ++$number_of_rows;\n if (count(array_keys($row)) > $this->number_of_columns)\n {\n // invalid data\n // data must have same number of columns throughout.\n // although, there is a desgin decision here: it is possible\n // that this ought to be considered valid data, and a filling\n // of the data could be performed... *thinking on that*\n }\n \n foreach ($this->columns as $key)\n {\n if (!array_key_exists($key, $row))\n {\n // invalid data? or possibly same decison as above\n // and fill the data...\n }\n }\n }\n\n $this->set_number_of_rows($number_of_rows);\n\n // valid array. from here, either pass $data to a building function\n // or simply say $this->data = $data. unsure of design yet.\n }", "abstract public function isValid($data);", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function isDataValid(): bool;", "function validate($data)\n\t{\n\t\t\n\t\t$res[] = [\n\t\t\t'validity' => false,\n\t\t\t'type' => 'all',\n\t\t\t'message' => ''\n\t\t];\n\t\t//required check\n\t\tif(isset($data['required'])){\n\t\t\t$dataForCheck = $data['required'];\n\t\t\tforeach ($dataForCheck as $key => $value) {\n\t\t\t\tif($value != null && $value != '' && !empty($value) && !is_null($value))\n\t\t\t\t{\n\t\t\t\t\t$res[] = [\n\t\t\t\t\t\t'validity' => true,\n\t\t\t\t\t\t'type' => 'required',\n\t\t\t\t\t\t'message' => 'Success'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$res[] = [\n\t\t\t\t\t\t'validity' => false,\n\t\t\t\t\t\t'type' => 'required',\n\t\t\t\t\t\t'message' => 'Some required fields are missing'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $res;\n\t}", "public function isValid($data);", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "public function validate($data): array;", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public abstract function validation();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate() : bool\n {\n $validator = Validator::make(\n $this->data, $this->structure\n );\n\n if($validator->fails()) {\n return false;\n }\n\n return $this->validateArray($this->data, $this->structure);\n }", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "public static function validate() {}", "abstract public function valid();", "function validateData($data) {\n $data = json_decode($data);\n $typesArr = [1, 2];\n\n if (!in_array((int)$data->type, $typesArr)) {\n return false;\n } else {\n $data->type = (int)$data->type;\n }\n\n if (empty($data->feedback)) {\n return false;\n }\n\n if ($data->type == 2 && !filter_var($data->url, FILTER_VALIDATE_URL)) {\n return false;\n }\n\n if (empty($data->name)) {\n $data->name = \"anonymous\";\n }\n\n if (empty($data->email)) {\n $data->email = \"anonymous\";\n }\n\n return $data;\n }", "public function validate($configData);", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n return false;\n }\n if ($this->container['sort_type'] === null) {\n return false;\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['values'] === null) {\n return false;\n }\n return true;\n }", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "function validates($data){\n\t\t$errors = array();\n\t\tforeach($this->validates as $k=>$v){\n\t\t\tif(!isset($data->$k)){\n\t\t\t\t$errors[$k] = $v['message'];\n\t\t\t}else{\n\t\t\t\tif($v['rule'] == 'notEmpty'){\n\t\t\t\t\tif(empty($data->$k)){\n\t\t\t\t\t\t$errors[$k] = $v['message'];\n\t\t\t\t\t} \n\t\t\t\t}elseif(!preg_match( '/^'.$v['rule'] .'$/', $data->$k)){\n\t\t\t\t\t$errors[$k] = $v['message'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->errors = $errors;\n\n\t\tif(isset($this->Form)){\n\t\t\t$this->Form->errors = $errors;\n\t\t}\n\t\tif(empty($errors)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "public function validate()\n\t{\n\t\t$errors = array();\n\t\t\n\t\t//make sure user is logged in\n\t\tif (empty($this->userid)) \n\t\t{\n\t\t\t$errors['userid'] = true;\n\t\t}\n\t\t\n\t\t//verify all info is provided\n\t\tif (isset($this->title))\n\t\t\t$this->title = strip_tags($this->title);\n\t\telse\n\t\t\t$errors['title'] = true;\n\t\t\t\n\t\tif (isset($this->description))\n\t\t\t$this->description = strip_tags($this->description);\n\t\telse\n\t\t\t$errors['description'] = true;\n\t\t\t\n\t\tif (isset($this->content))\n\t\t\t$this->content = strip_tags($this->content, \"<br><b>\");\n\t\telse\n\t\t\t$errors['content'] = true;\n\t\t\t\n\t\tif (isset($this->location))\n\t\t\t$this->location = strip_tags($this->location);\n\t\telse\n\t\t\t$errors['location'] = true;\n\t\t\n\t\tif (!isset($this->category))\n\t\t\t$errors['category'] = true;\n\t\t\t\n\t\tif (!isset($this->enddatetime))\n\t\t\t$errors['enddatetime'] = true;\n\t\t\n\t\t\n\t\t//If we made it here, all is valid\n\t\tif (count($errors) > 0)\n\t\t\treturn $errors;\n\t\telse\n\t\t\treturn NULL;\n\t}", "public function validation();", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "private function arrayValidator()\n {\n\n\n\n $rules = [\n 'name' => ['required', 'string'],\n 'email' => ['required', 'string', 'unique:users'],\n 'ConfigPassword' => ['required', 'string', 'min:8'],\n 'password' => ['required_with:ConfigPassword', 'same:ConfigPassword', 'min:8'],\n 'phone' => ['required'],\n 'nickname' => ['required'],\n \"gender\" => ['required'],\n \"profile_picture\" => ['required', 'mimes:jpeg,bmp,png,jpg'],\n \"birthday\" => ['required'],\n \"position\" => ['required'],\n \"weight\" => ['required'],\n \"height\" => ['required'],\n \"footPlay\" => ['required'],\n \"living_location\" => ['required'],\n \"previous_clubs\" => ['required'],\n \"strength_point\" => ['required'],\n \"scientificl_level\" => ['required'],\n \"level\" => ['required'],\n\n\n ];\n\n return $rules;\n }", "protected function _validate() {\n\t}", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "public function validate() {\n \n $errors = [];\n $names = explode(' ', $this->data->name, 2);\n\n if(count($names) < 2) {\n $errors['name'] = array('first and last names are required');\n }\n\n if(!filter_var($this->data->email, FILTER_VALIDATE_EMAIL)) {\n $errors['email'] = array($this->data->email.' is not a valid email address');\n }\n\n if(strlen($this->data->password) < 8) {\n $errors['password'] = array('password must be at least 8 characters');\n }\n\n return $errors;\n }", "abstract protected function isValid(\\stdClass $data): bool;", "public function Valid();", "private function validateInputParameters($data)\n {\n }", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function Validate()\n\t{\n\t\t//\n\t\t// Traverse object.\n\t\t//\n\t\tforeach( $this as $condition => $statements )\n\t\t\t$this->_ValidateCondition( $condition, $statements, 0 );\n\t\n\t}", "public static function validateData(): array\n {\n\n $data = self::sanitizeData();\n\n // check for name\n if (empty($data['fname'])) {\n $data['errorName'] = 'First name is blank';\n } elseif(strlen($data['fname']) < 2 || strlen($data['fname']) > 20) {\n $data['errorName'] = 'First name must be in range of 2-20 char...';\n }\n\n // check for lname\n if (empty($data['lname'])) {\n $data['errorLastName'] = 'Last name is blank';\n } elseif(strlen($data['lname']) < 2 || strlen($data['lname']) > 30) {\n $data['errorLastName'] = 'Last name must be in range of 2-30 char...';\n }\n\n // check for email\n if (empty($data['email'])) {\n $data['errorEmail'] = 'Email cannot be blank';\n }\n\n // check for gender\n if (empty($data['gender'])) {\n $data['errorGender'] = 'Gender must be selected';\n }\n\n // check for passwords\n\n if (empty($data['password']) || empty($data['cpassword'])) {\n $data['errorPassword'] = 'Password cannot be empty';\n } elseif(strlen($data['password']) < 5 || strlen($data['cpassword']) < 5) {\n $data['errorPassword'] = 'Password must be longer than 5 char...';\n }\n\n if ($data['password'] !== $data['cpassword']) {\n $data['errorPassword'] = 'Passowrd must be a same';\n } \n\n // check birtth\n if (empty($data['birthDate'])) {\n $data['errorBirth'] = 'Birth Date cannot be empty';\n }\n\n if (empty($data['profilePic'])) {\n $data['profilePic'] = '/images/profile.jpg';\n }\n\n if (empty($data['coverPic'])) {\n $data['coverPic'] = 'images/cover.png';\n }\n\n return $data;\n }", "protected function _validData($collection){\n\t\t$params = array(\n\t\t\t'id_factura'=>'1',\n\t\t\t'tipo'=>'4',\n\t\t\t'fecha'=>'8',\n\t\t\t'valor'=>'1',\n\t\t\t'banco'=>'-1',\n\t\t\t'nro_cheque'=>'-1',\n\t\t\t'nro_deposito'=>'-1'\n\t\t\t);\n\n\t\treturn($this->_validUserData($params,$collection,4));\n\n\t}", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function validateEntries() \n {\n //verify if first entry is a START entry\n $this->firstItemIsStartEntry();\n\n //Detect the right order of entries\n $this->detectRightEntryOrder();\n\n //check if last entry is pause or end when the record is not current\n $this->obligePauseWhenNotCurrent();\n }", "public function validateData(){\n return true;\n }", "public function validateFormData($data) {\n\n $errors = array();\n\n // twitter name\n if (strlen($data['twitterName']) < 1 || strlen($data['twitterName']) > 100) {\n $errors['twitterName'] = 'Full name is required and must be less than 100 characters.';\n }\n\n // twitter username\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['twitterUsername']) || strlen($data['twitterUsername']) < 1 || strlen($data['twitterUsername']) > 15) {\n $errors['twitterUsername'] = 'Username must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // cron key\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['cronKey']) || strlen($data['cronKey']) < 1 || strlen($data['cronKey']) > 50) {\n $errors['cronKey'] = 'The cron key must only use letters, numbers, underscores, and be 50 or fewer characters in length.';\n }\n\n // timezone\n if (!date_default_timezone_set($data['timezone'])) {\n $errors['timezone'] = 'Not a valid timezone.';\n }\n\n // database prefix\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['databasePrefix']) || strlen($data['databasePrefix']) < 1 || strlen($data['databasePrefix']) > 15) {\n $errors['databasePrefix'] = 'The database prefix must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // do one last check to require all fields without a specific check\n $requiredFields = array('twitterName', 'twitterUsername', 'consumerKey', 'consumerSecret', 'oauthToken', 'oauthSecret', 'baseUrl', 'timezone', 'cronKey', 'databaseHost', 'databaseDatabase', 'databaseUsername', 'databasePassword', 'databasePrefix');\n foreach ($requiredFields as $field) {\n if (!isset($errors[$field]) && strlen(trim($data[$field])) < 1) {\n $errors[$field] = 'This field is required.';\n }\n }\n\n return (count($errors)) ? $errors : false;\n\n }", "public function validDataTypes();", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "function validate_visit_data($visit_data ) {\n\textract($visit_data);\n\t$err = array();\n\n\t// name: min 2 chars length\n\tif (empty($name )) {\n\t\t$err[] = 'Name is required.';\n\t}\telse if (mb_strlen($name ) < 1 ) {\n\t\t$err[] = 'Name must be at least 1 character long.';\n\t}\n\t\n\t// start_date: valid date. either integer timestamp (unix time in \n\t// milliseconds) or parseable date string.\n\tif (!isset($start_date )) {\n\t\t$err[] = 'Start date is required.';\n\t} else if (!is_numeric($start_date )) {\n\t\t$start_date = strtotime($start_date);\n\t\tif ($start_date === false ) {\n\t\t\t$err[] = \"Start date must be parseable by strtotime().\";\n\t\t}\n\t} else {\n\t\t$start_date /= 1000;\n\t}\n\n\t// end_date: valid date. either integer timestamp (unix time in\n\t// milliseconds) or parseable date string.\n\tif (!isset($end_date )) {\n\t\t$err[] = 'End date is required';\n\t} else if (!is_numeric($end_date )) {\n\t\t$end_date = strtotime($end_date);\n\t\tif ($end_date === false ) {\n\t\t\t$err[] = \"End date must be parseable by strtotime().\";\n\t\t}\n\t} else {\n\t\t$end_date /= 1000;\n\t}\n\n\t// sanity check: start date is BEFORE end date!\n\tif ($start_date && $end_date && ($end_date < $start_date)) {\n\t\t$err[] = 'End date must be >= start date';\n\t}\n\n\t// receivers: comma-separated list of axis usernames\n\tif (empty($receivers )) {\n\t\t$err[] = 'Receivers is required.';\n\t} else {\n\t\t$db = db_connect();\n\n\t\t$rs = $receivers;\n\t\tif (!is_array($receivers )) {\n\t\t\t$rs = explode(',', $receivers);\n\t\t}\n\n\t\t$receivers = array();\n\t\tforeach ($rs as $r ) {\n\t\t\t$r = trim($r);\n\n\t\t\t$sql = sprintf(\"SELECT * FROM info \".\n\t\t\t\t\"WHERE uname='%s' LIMIT 1\",\n\t\t\t\t$db->real_escape_string($r ));\n\n\t\t\tif ($result = $db->query($sql )) {\n\t\t\t\t$rec = $result->fetch_assoc();\n\t\t\t\tif (!$rec ) {\n\t\t\t\t\t$err[] = \"Receiver username \".\n\t\t\t\t\t\t\"not found: $r\";\n\t\t\t\t} else {\n\t\t\t\t\t$receivers[] = $rec;\n\t\t\t\t}\n\t\t\t\t$result->free();\n\t\t\t} else {\n\t\t\t\t$err[] = \"Internal error\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif (empty($picture )) {\n\t\t$err[] = 'Picture is required.';\n\t}\n\t\n\tif ($err ) {\n\t\tthrow new Http_error(400, implode(\"\\n\", $err ));\n\t}\n\n\treturn array(\n\t\t'name' => $name,\n\t\t// company is not required\n\t\t'company' => @$_POST['company'],\n\t\t'parking' => $parking,\n\t\t'start_date' => $start_date,\n\t\t'end_date' => $end_date,\n\t\t'receivers' => $receivers,\n\t\t'picture' => $picture,\n\t);\n}", "private function checkValid()\n\t{\n\t\tif(!$this->isValid()) {\n\t\t\tthrow new \\RuntimeException(\"TypeStruct Error: '\".get_called_class().\"' not validated to perform further operations\");\t\n\t\t}\n\t}", "public function validate()\n\t{\n\t\t$result = true;\n\t\tforeach ($this->slices as &$slice) {\n\t\t\t//debug($slice['name'] . ' ('.$slice['from'].'-'.$slice['till'].': '.sizeof($slice['desc']).')');\n\t\t\t$f2 = new HTMLFormTable($slice['desc']);\n\t\t\t$v = new HTMLFormValidate($f2);\n\t\t\t$result = $v->validate() && $result; // recursive inside // this order to force execution\n\t\t\t$slice['desc'] = $v->getDesc();\n\t\t}\n\t\t//debug($this->slices);\n\t\treturn $result;\n\t}", "function validate()\n\t{\n\t\t$isValid = false;\n\t\t\n\t\tif(empty($this->data['username']))\n\t\t{\n\t\t\t\t$this->errors['username'] = \"Please enter a Username\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['password']))\n\t\t{\n\t\t\t\t$this->errors['password'] = \"Please enter a password\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['description']))\n\t\t{\n\t\t\t\t$this->errors['description'] = \"Please enter a description of yourself\";\n\t\t}\n\t\t\n\t\t\n\t\t//validate data elements in userData property\n\t\t//if an error exists, store to errors using column name as key\n\t\t\n\t\t if(empty($this->errors))\n\t\t{\n\t\t\t$isValid = true;\n\t\t}\n\t\t\n\t\treturn $isValid;\n\t}", "public function testThrowErrorsWhenDataAreInvalid(): void\n {\n $data = [\n \"name\" => \"\",\n \"description\" => \"The Star Wars The Last Jedi Collection 9TWENTY is constructed of a black poly fabric. A Star Wars fighter plane is embroidered on the front panels and the cap features a D-Ring closure.\",\n \"price\" => \"20.50\",\n \"category\" => [\n \"id\" => 1\n ],\n \"images\" => [\n [\n \"id\" => 1\n ]\n ]\n ];\n\n $response = $this->request('POST', '/api/products', $data);\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(400, $response->getStatusCode());\n $this->assertEquals('application/problem+json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertArrayHasKey('violations', $json);\n $this->assertCount(2, $json['violations']);\n\n $this->assertArrayHasKey('propertyPath', $json['violations'][0]);\n $this->assertEquals('name', $json['violations'][0]['propertyPath']);\n\n $this->assertArrayHasKey('propertyPath', $json['violations'][1]);\n $this->assertEquals('tax', $json['violations'][1]['propertyPath']);\n }", "private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "private function isValidData($data) {\n\t\tif (!is_string($data) && !is_int($data) && !is_float($data) && !is_array($data)) {\n\t\t\tthrow new FlintstoneException('Invalid data type');\n\t\t}\n\n\t\treturn true;\n\t}", "public function validate(array $data, array $params): array;", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "public function validate($data): bool;", "public function validate($data): bool;", "public function validate($data) {\n $data = $this->gump->sanitize($data);\n $this->gump->validation_rules(array(\n 'name' => 'required|max_len,100',\n 'capacity' => 'required|numeric',\n 'color' => 'required|max_len,7'\n ));\n\n $this->gump->filter_rules(array(\n 'name' => 'trim|sanitize_string',\n 'capacity' => 'trim|sanitize_string',\n 'color' => 'trim|sanitize_string',\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n return $data;\n }\n }", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}" ]
[ "0.7841097", "0.7555885", "0.684447", "0.6787751", "0.6752132", "0.6752132", "0.6721421", "0.6480714", "0.64725125", "0.64671403", "0.6446789", "0.643009", "0.643009", "0.64091116", "0.6385275", "0.6357254", "0.63478065", "0.63291895", "0.6319029", "0.6312638", "0.62866116", "0.6274635", "0.6227515", "0.62068856", "0.6205391", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.62046754", "0.61860096", "0.6170826", "0.61550677", "0.6150726", "0.614826", "0.6124751", "0.61220545", "0.61220545", "0.608462", "0.6068574", "0.60589147", "0.6039854", "0.60353184", "0.60334873", "0.6020842", "0.60191184", "0.6015463", "0.60092527", "0.60092527", "0.60092527", "0.60092527", "0.59991676", "0.5998921", "0.5993211", "0.59739023", "0.5959956", "0.5959648", "0.59442204", "0.5943906", "0.593871", "0.5919005", "0.5917635", "0.5913627", "0.5913627", "0.5913627", "0.5913627", "0.5913627", "0.5913627", "0.5913627", "0.5913627", "0.5909197", "0.59073114", "0.589954", "0.5889588", "0.586742", "0.58584225", "0.58502674", "0.58480984", "0.5844797", "0.58407086", "0.58319974", "0.5826994", "0.5815722", "0.57974744", "0.57965624", "0.57943463", "0.5788865", "0.5778551", "0.5777622", "0.5766908", "0.5766908", "0.57666695", "0.57663375" ]
0.5859623
82
Inserts a new interaction
protected function insert($data) { $response = []; // make sure it's valid $isValid = $this->validate($data); // if validation doesn't pass, return the errors if($isValid !== true) { return $this->errors; } $treeID = $data['treeID']; $userID = $data['userID']; $interactionType = $this->db->getInteractionType($data['interaction']['type']); $interactionID = $data['interaction']['id']; $destinationType = $this->db->getStateType($data['destination']['type']); $destinationID = $data['destination']['id']; $embedID = $data['site']['embedID']; // Get our Parameters ready $params = [ ':treeID' => $treeID, ':userID' => $userID, ':embedID' => $embedID, ':interactionTypeID' => $interactionType['interactionTypeID'], ':stateTypeID' => $destinationType['stateTypeID'], ]; // write our SQL statement $sql = 'INSERT INTO '.$this->db->tables['treeInteraction'].' ( treeID, userID, embedID, interactionTypeID, stateTypeID ) VALUES( :treeID, :userID, :embedID, :interactionTypeID, :stateTypeID )'; // insert the mc_option into the database $stmt = $this->db->query($sql, $params); // success! if($stmt !== false) { $insertedInteractionID = $this->db->lastInsertId(); $response = [ 'interactionID' => $insertedInteractionID, 'status' => 'success', 'action' => 'insertInteraction' ]; // if it's one that has a stateID with it, then let's save that too $interactions = ['option', 'history', 'start']; if(in_array($interactionType['interactionType'], $interactions) && $destinationType['stateType'] !== 'overview') { $this->insertState($insertedInteractionID, $destinationID); } // if we interacted with an option, save the interactionID to the elment_interactions $interactions = ['option']; if(in_array($interactionType['interactionType'], $interactions)) { $this->insertInteractionElement($insertedInteractionID, $interactionID); } } else { // handle errors $this->errors[] = 'Insert interaction failed.'; $this->errors['status'] = 'error'; } if(!empty($this->errors)) { return $this->errors; } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddInteraction()\n {\n $this->addInteraction(\n new Interaction(\n new User('123'),\n new ItemUUID('1', 'product'),\n 'click',\n [\n 'position' => 1,\n ]\n )\n );\n\n $this->assertTrue(true);\n }", "public function insert() {\n \n }", "public function insert($techHit);", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "public function insert_interaction($dataset_id, $reference_id, $ligand, $uploadName,$MW,$position,$position_acc, $penetration, $penetration_acc, $water, $water_acc, \n $LogK, $LogK_acc, $Area,$Volume, $LogP, $LogPerm, $LogPerm_acc, $Theta, $Theta_acc, $abs_wl, $abs_wl_acc, $fluo_wl, $fluo_wl_acc, \n $QY, $QY_acc, $lt, $lt_acc,\n $Q, $comment, $SMILES, $DrugBank, $PubChem, $PDB, $CHEMBL, $CHEBI, $membrane, $method, $temperature)\n {\n $substanceModel = new Substances();\n $interactionModel = new Interactions();\n\t\t$user_id = session::user_id();\n\t\t$rdkit = new Rdkit();\n\n\t\ttry\n\t\t{\n\t\t\t// Checks if substance already exists\n\t\t\t$substance = $substanceModel->exists($ligand, $SMILES, $PDB, $DrugBank, $PubChem, $CHEBI, $CHEMBL);\n\n\t\t\t// Canonize smiles\n\t\t\t$canonized_smiles = $rdkit->canonize_smiles($SMILES, false);\n\n\t\t\tif($canonized_smiles)\n\t\t\t{\n\t\t\t\t$SMILES = $canonized_smiles;\n\t\t\t}\n\n\t\t\t// Protected insert \n\t\t\tif(!$substance->id)\n\t\t\t{\n\t\t\t\t// Add new one\n\t\t\t\t$substance->name = $ligand;\n\t\t\t\t$substance->uploadName = $ligand;\n\t\t\t\t$substance->SMILES = $SMILES;\n\t\t\t\t$substance->MW = $MW;\n\t\t\t\t$substance->pdb = $PDB;\n\t\t\t\t$substance->pubchem = $PubChem;\n\t\t\t\t$substance->drugbank = $DrugBank;\n\t\t\t\t$substance->chEMBL = $CHEMBL;\n\t\t\t\t$substance->chEBI = $CHEBI;\n\t\t\t\t$substance->user_id = $user_id;\n\t\t\t\t\n\t\t\t\t$substance->save($dataset_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Add new values as valid identifiers\n\t\t\t\t$valid_attributes = array\n\t\t\t\t(\n\t\t\t\t\tValidator_identifiers::ID_NAME => $ligand,\n\t\t\t\t\tValidator_identifiers::ID_SMILES => $SMILES,\n\t\t\t\t\tValidator_identifiers::ID_CHEBI => $CHEBI,\n\t\t\t\t\tValidator_identifiers::ID_CHEMBL => $CHEMBL,\n\t\t\t\t\tValidator_identifiers::ID_PDB => $PDB,\n\t\t\t\t\tValidator_identifiers::ID_PUBCHEM => $PubChem,\n\t\t\t\t\tValidator_identifiers::ID_DRUGBANK => $DrugBank,\n\t\t\t\t);\n\n\t\t\t\tforeach($valid_attributes as $type => $value)\n\t\t\t\t{\n\t\t\t\t\tif(empty($value) || trim($value) === '')\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$record = new Validator_identifiers();\n\t\t\t\t\t$record->identifier = $type;\n\t\t\t\t\t$record->id_substance = $substance->id;\n\t\t\t\t\t$record->value = $value;\n\t\t\t\t\t$record->id_source = NULL;\n\t\t\t\t\t$record->server = NULL;\n\t\t\t\t\t$record->id_user = session::user_id();\n\t\t\t\t\t$record->state = Validator_identifiers::STATE_VALIDATED;\n\t\t\t\t\t$record->active = Validator_identifiers::INACTIVE;\n\t\t\t\t\t$record->id_dataset_passive = $dataset_id;\n\t\t\t\t\t$record->flag = NULL;\n\n\t\t\t\t\tif($type === Validator_identifiers::ID_SMILES && $canonized_smiles)\n\t\t\t\t\t{\n\t\t\t\t\t\t$record->flag = Validator_identifiers::SMILES_FLAG_CANONIZED;\n\t\t\t\t\t}\n\n\t\t\t\t\t$record->save();\n\t\t\t\t}\n\n\t\t\t\t$substance->check_identifiers();\n\n\t\t\t\t// If missing identifier, then update\n\t\t\t\tif(!Identifiers::is_valid($substance->identifier))\n\t\t\t\t{\n\t\t\t\t\t$substance->identifier = Identifiers::generate_substance_identifier($substance->id);\n\t\t\t\t}\n\n\t\t\t\t$substance->save();\n\t\t\t}\n\n\t\t\t// try to find interaction\n\t\t\t$interaction_id = $interactionModel->where(array\n\t\t\t\t(\n\t\t\t\t\t'id_membrane'\t=> $membrane->id,\n\t\t\t\t\t'id_method'\t\t=> $method->id,\n\t\t\t\t\t'id_substance'\t=> $substance->id,\n\t\t\t\t\t'temperature'\t=> $temperature,\n\t\t\t\t\t'charge'\t\t=> $Q,\n\t\t\t\t\t'id_reference'\t=> $reference_id,\n\t\t\t\t\t'comment' \t\t=> $comment\n\t\t\t\t))\n\t\t\t\t->select_list('id')\n\t\t\t\t->get_one()\n\t\t\t\t->id;\n\n\t\t\t$interaction = new Interactions($interaction_id);\n\n\t\t\t// If not exists or has different comment, then add new interaction detail\n\t\t\tif(!$interaction->id) \n\t\t\t{\n\t\t\t\t$interaction->id_dataset = $dataset_id;\n\t\t\t\t$interaction->id_membrane = $membrane->id;\n\t\t\t\t$interaction->id_method = $method->id;\n\t\t\t\t$interaction->id_substance = $substance->id;\n\t\t\t\t$interaction->id_reference = $reference_id;\n\t\t\t\t$interaction->charge = $Q;\n\t\t\t\t$interaction->temperature = $temperature;\n\t\t\t\t$interaction->comment = $comment;\n\n\t\t\t\t$interaction->Position = $position;\n\t\t\t\t$interaction->Position_acc = $position_acc;\n\t\t\t\t$interaction->Penetration = $penetration;\n\t\t\t\t$interaction->Penetration_acc = $penetration_acc;\n\t\t\t\t$interaction->Water = $water;\n\t\t\t\t$interaction->Water_acc = $water_acc;\n\t\t\t\t$interaction->LogK = $LogK;\n\t\t\t\t$interaction->LogK_acc = $LogK_acc;\n\t\t\t\t$interaction->LogPerm = $LogPerm;\n\t\t\t\t$interaction->LogPerm_acc = $LogPerm_acc;\n\t\t\t\t$interaction->theta = $Theta;\n\t\t\t\t$interaction->theta_acc = $Theta_acc;\n\t\t\t\t$interaction->abs_wl = $abs_wl;\n\t\t\t\t$interaction->abs_wl_acc = $abs_wl_acc;\n\t\t\t\t$interaction->fluo_wl = $fluo_wl;\n\t\t\t\t$interaction->fluo_wl_acc = $fluo_wl_acc;\n\t\t\t\t$interaction->QY = $QY;\n\t\t\t\t$interaction->QY_acc = $QY_acc;\n\t\t\t\t$interaction->lt = $lt;\n\t\t\t\t$interaction->lt_acc = $lt_acc;\n\n\t\t\t\t$interaction->save();\n\t\t\t}\n\t\t\telse // Exists and has the same comment, so try to fill missing data\n\t\t\t{\n\t\t\t\t$interaction->Position = self::check_int_val($interaction->Position, $position, 'Position', $interaction->id_dataset);\n\t\t\t\t$interaction->Position_acc = $interaction->Position === $position ? $position_acc : $interaction->Position_acc;\n\t\t\t\t$interaction->Penetration = self::check_int_val($interaction->Penetration, $penetration, 'Penetration', $interaction->id_dataset);\n\t\t\t\t$interaction->Penetration_acc = $interaction->Penetration === $penetration ? $penetration_acc : $interaction->Penetration_acc;\n\t\t\t\t$interaction->Water = self::check_int_val($interaction->Water, $water, 'Water', $interaction->id_dataset);\n\t\t\t\t$interaction->Water_acc = $interaction->Water === $water ? $water_acc : $interaction->Water_acc;\n\t\t\t\t$interaction->LogK = self::check_int_val($interaction->LogK, $LogK, 'LogK', $interaction->id_dataset);\n\t\t\t\t$interaction->LogK_acc = $interaction->LogK === $LogK ? $LogK_acc : $interaction->LogK_acc;\n\t\t\t\t$interaction->LogPerm = self::check_int_val($interaction->LogPerm, $LogPerm, 'LogPerm', $interaction->id_dataset);\n\t\t\t\t$interaction->LogPerm_acc =$interaction->LogPerm === $LogPerm ? $LogPerm_acc : $interaction->LogPerm_acc;\n\t\t\t\t$interaction->theta = self::check_int_val($interaction->theta, $Theta, 'theta', $interaction->id_dataset);\n\t\t\t\t$interaction->theta_acc = $interaction->theta === $Theta ? $Theta_acc : $interaction->theta_acc;\n\t\t\t\t$interaction->abs_wl = self::check_int_val($interaction->abs_wl, $abs_wl, 'abs_wl', $interaction->id_dataset);\n\t\t\t\t$interaction->abs_wl_acc = $interaction->abs_wl === $abs_wl ? $abs_wl_acc : $interaction->abs_wl_acc;\n\t\t\t\t$interaction->fluo_wl = self::check_int_val($interaction->fluo_wl, $fluo_wl, 'fluo_wl', $interaction->id_dataset);\n\t\t\t\t$interaction->fluo_wl_acc = $interaction->fluo_wl === $fluo_wl ? $fluo_wl_acc : $interaction->fluo_wl_acc;\n\t\t\t\t$interaction->QY = self::check_int_val($interaction->QY, $QY, 'QY', $interaction->id_dataset);\n\t\t\t\t$interaction->QY_acc = $interaction->QY === $QY ? $QY_acc : $interaction->QY_acc;\n\t\t\t\t$interaction->lt = self::check_int_val($interaction->lt, $lt, 'lt', $interaction->id_dataset);\n\t\t\t\t$interaction->lt_acc = $interaction->lt === $lt ? $lt_acc : $interaction->lt_acc;\n\n\t\t\t\t$interaction->save();\n\t\t\t}\n\t\t} \n\t\tcatch(UploadLineException $e)\n\t\t{\n\t\t\tthrow new UploadLineException($ligand . ' / ' . $e->getMessage());\n\t\t}\n\t\tcatch (Exception $ex) \n\t\t{\n\t\t\tthrow new UploadLineException($ligand . ' / ' . $ex->getMessage());\n\t\t}\n\t}", "public function insert()\n {\n \n }", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "public abstract function insert();", "public function insert()\n {\n $this->id = insert($this);\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public static function insert()\n {\n }", "public function insert()\n {\n # code...\n }", "abstract public function insert();", "private function insertInteractionElement($interactionID, $elID) {\n /**************************************\n ** WARNING!!!!!! **\n ** **\n ** NO VALIDATION OCCURS HERE. **\n ** ONLY CALL FROM $this->insert() **\n ***************************************/\n\n // save the interaction\n $params = [\n ':interactionID' => $interactionID,\n ':elID' => $elID\n ];\n // write our SQL statement\n $sql = 'INSERT INTO '.$this->db->tables['treeInteractionElement'].' (\n interactionID,\n elID\n )\n VALUES(\n :interactionID,\n :elID\n )';\n // insert the mc_option into the database\n $stmt = $this->db->query($sql, $params);\n\n if($stmt !== false) {\n // return the inserted ID\n return $this->db->lastInsertId();\n } else {\n // handle errors\n $this->errors[] = 'Insert interaction element failed.';\n return false;\n }\n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "function insert(iEvent $event);", "public abstract function Insert();", "function mINSERT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$INSERT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:19:3: ( 'insert' ) \n // Tokenizer11.g:20:3: 'insert' \n {\n $this->matchString(\"insert\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function insert(Tag $tag);", "protected function _insert()\n\t{\n\t}", "public function insert($mambot);", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function push() {\n\t\t\n\t\t/*\n\t\t * Check if there is an application context, and only an application context.\n\t\t * Users shouldn't be allowed to modify their own reputation.\n\t\t */\n\t\tif (!$this->authapp || $this->user) {\n\t\t\tthrow new PublicException('Users are not allowed to push interactions. Please do so from an application', 403);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Retrieve the source from the request. This is the user where the interaction\n\t\t * stems from.\n\t\t */\n\t\t$src = db()->table('user')->get('_id', $_POST['source'])->first();\n\t\tif (!$src && $_POST['source']) { $src = UserModel::make($this->sso->getUser($_POST['source'])); }\n\t\t\n\t\t/*\n\t\t * Get the user that received the interaction.\n\t\t */\n\t\t$tgt = db()->table('user')->get('_id', $_POST['target'])->first();\n\t\tif (!$tgt && $_POST['target']) { $tgt = UserModel::make($this->sso->getUser($_POST['target'])); }\n\t\t\n\t\tif (!$src && !$tgt) {\n\t\t\tthrow new PublicException('Could not find users', 400);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Create the record and store it to the database.\n\t\t */\n\t\t$record = db()->table('interaction')->newRecord();\n\t\t$record->src = $src;\n\t\t$record->tgt = $tgt;\n\t\t$record->name = $_POST['name'];\n\t\t$record->value = $_POST['value'];\n\t\t$record->caption = $_POST['caption'];\n\t\t$record->url = $_POST['url'];\n\t\t$record->created = time();\n\t\t$record->store();\n\t\t\n\t\t/*\n\t\t * Pass the data onto the view, so the application sending the request can\n\t\t * parse it and extract data from it.\n\t\t */\n\t\t$this->view->set('record', $record);\n\t}", "public function insert($attributes);", "public function inserir()\n {\n }", "private function insertNew() {\n $sth=NULL;\n $array=array();\n $query=\"INSERT INTO table_spectacles (libelle) VALUES (?)\";\n $sth=$this->dbh->prepare($query);\n $array=array($this->libelle);\n $sth->execute($array);\n $this->message=\"\\\"\".$this->getLibelle().\"\\\" enregistré !\";\n $this->blank();\n $this->test=1;\n }", "public function insert(){\n\n }", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "protected function saveInsert()\n {\n }", "public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\n\t}", "protected function insert() {\n\t\tglobal $wgEchoNotifications;\n\n\t\t$notifMapper = new NotificationMapper();\n\n\t\t$services = MediaWikiServices::getInstance();\n\t\t$hookRunner = new HookRunner( $services->getHookContainer() );\n\t\t// Get the bundle key for this event if web bundling is enabled\n\t\t$bundleKey = '';\n\t\tif ( !empty( $wgEchoNotifications[$this->event->getType()]['bundle']['web'] ) ) {\n\t\t\t$hookRunner->onEchoGetBundleRules( $this->event, $bundleKey );\n\t\t}\n\n\t\tif ( $bundleKey ) {\n\t\t\t$hash = md5( $bundleKey );\n\t\t\t$this->bundleHash = $hash;\n\t\t}\n\n\t\t$notifUser = NotifUser::newFromUser( $this->user );\n\n\t\t// Add listener to refresh notification count upon insert\n\t\t$notifMapper->attachListener( 'insert', 'refresh-notif-count',\n\t\t\tstatic function () use ( $notifUser ) {\n\t\t\t\t$notifUser->resetNotificationCount();\n\t\t\t}\n\t\t);\n\n\t\t$notifMapper->insert( $this );\n\n\t\tif ( $this->event->getCategory() === 'edit-user-talk' ) {\n\t\t\t$services->getTalkPageNotificationManager()\n\t\t\t\t->setUserHasNewMessages( $this->user );\n\t\t}\n\t\t$hookRunner->onEchoCreateNotificationComplete( $this );\n\t}", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "function dialogue_add_instance($dialogue) {\n global $DB;\n\n $dialogue->timemodified = time();\n\n return $DB->insert_record('dialogue', $dialogue);\n}", "function insertTest()\n {\n $this->cD->insertElement(new Product(1, \"Trang\"));\n $this->cD->insertElement(new Product(1, \"Trang\"));\n $this->cD->insertElement(new Product(1, \"Trang\"));\n }", "public function insert($metricaevotranspiracion);", "public function Do_insert_Example1(){\n\n\t}", "public function insert($article);", "public function add_impediment($impediment)\n\t{\n\t\t$this->db->insert('impediment', $impediment);\n\t\treturn $this->db->insert_id();\n\t}", "public function insert() {\n\t\tif ( !$this->content || !$this->resource ) {\n\t\t\tthrow new UnexpectedValueException( \"Provide at least a comment, rating or tag and a resource.\" );\n\t\t}\n\t\tif ( empty( $this->smoValues[\"simple\"][\"dtreviewed\"] ) ) {\n\t\t\t$this->setParameter( \"dtreviewed\", date('c') );\n\t\t}\n\n\t\t$this->action = \"insert\";\n\t\t$this->createSmoRequest();\n\t\t$xmlVar = new SoapVar( \"<ns1:insertSMO>\".$this->smo.\"</ns1:insertSMO>\", XSD_ANYXML );\n\t\t$this->insertSMO( $xmlVar );\n\t\t$this->processResponse( $this->__getLastResponse() );\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function insert(registroEquipo $reEquipo);", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function insert() {\n return $this->getActionByName('Insert');\n }", "public function insert($loyPrg);", "function create($insert)\n{\n connect()->query($insert);\n}", "public function after_insert() {}", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "public static function Insert(){\r\n }", "public function newQuestion($question, $connection) {\r\n\t\t$connection -> exec(\"INSERT INTO `\".$GLOBALS['dbPrefix'].\"question_question` (`set`, `question`, `mode`) VALUES (\" . $this -> setid . \", '\" . $question -> getQuestion() . \"', '\" . $question -> getMode() . \"')\");\r\n\t\t$question -> setId($connection -> lastInsertId());\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public function insert() {\n\n // Does the program object already have an ID?\n if ( !is_null( $this->programID ) ) trigger_error ( \"program::insert(): Attempt to insert an program object that already has its ID property set (to $this->id).\", E_USER_ERROR );\n\n // Insert the program\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO programs ( programName, programStart, programFrequency ) VALUES ( :programName, :programStart, :programFrequency )\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":programName\", $this->programName, PDO::PARAM_STR );\n $st->bindValue( \":programStart\", $this->programStart, PDO::PARAM_STR );\n\t$st->bindValue( \":programFrequency\", $this->programFrequency, PDO::PARAM_STR );\n $st->execute();\n $this->programID = $conn->lastInsertId();\n $conn = null;\n }", "public function insert($item): void;", "public function createInsertSql(): \\Hx\\Db\\Sql\\InsertInterface;", "public function store(CreateInteractionRequest $request)\n {\n $tagNames = $request->tags;\n $tags = array();\n if ($tagNames != null)\n {\n foreach ($tagNames as $tagName)\n {\n $tagName = removeAccents(strtr(trim($tagName), array(' ' => '-')));\n if (!preg_match('/^[a-zA-Z0-9-]+$/i', $tagName))\n {\n return Redirect::back()->withErrors(trans('messages.tagCharacterError'));\n }\n array_push($tags, $tagName);\n }\n }\n\n $person = Person::find($request->person_id);\n $interaction = new Interaction;\n $destinationMail = $request->destination;\n $input = $request->all();\n $interaction->fill($input);\n $interaction->user_id = Auth::id();\n $success = $interaction->save();\n\n if (!is_null($tags))\n {\n $interaction->retag($tags);\n }\n\n $seEnviaronMails = false;\n if (env('MAIL_USERNAME') != null && env('MAIL_PASSWORD') != null)\n {\n // El usuario puede elegir un correo electrónico para enviar el mail de derivación\n if ($destinationMail != '' && !is_null($person))\n {\n $seEnviaronMails = true;\n try\n {\n sendMail($destinationMail,$person);\n flash()->success(trans('messages.mailSuccess'));\n }\n catch (\\Exception $e)\n {\n flash()->error(trans('messages.mailFailed'))->important();\n }\n }\n\n // Si hay tags se envian mails a todos los usuarios que tengan alguno de los tags seleccionados\n if (!is_null($tags) && allowed_to_tag(Auth::user(),$tags) && !$interaction->fixed && !$seEnviaronMails)\n {\n $users = User::withAnyTag($tags)->get();\n if ($users != null && count($users) > 0)\n {\n $seEnviaronMails = true;\n try\n {\n sendMailToUsers($users,$person);\n flash()->success(trans('messages.mailsSuccess'));\n }\n catch (\\Exception $e)\n {\n flash()->error(trans('messages.mailsFailed'))->important();\n }\n }\n\n }\n }\n\n if (!$seEnviaronMails)\n {\n if ($success)\n {\n flash()->success(trans('messages.interactionCreated'));\n }\n else\n {\n flash()->error(trans('messages.interactionFailed'));\n }\n }\n\n return redirect('person/'.$interaction->person_id);\n }", "public function insert( $objet);", "private function insert(Array $input) {\n $statement = \"INSERT INTO IDEAS (idea_name,ownerId,ideaStatus,description, extraResources)\n VALUES (:idea_name, :ownerId,:ideaStatus ,:description, :extraResources);\";\n try {\n $db=new databaseController();\n $statement = $db->getConnection()->prepare($statement);\n $statement->execute(array(\n 'idea_name'=>$input['idea_name'],\n 'ownerId' => $input['ownerId'],\n 'ideaStatus' => 'START',\n 'description' => $input['description'],\n 'extraResources' => $input['extraResources'],\n ));\n return $statement->rowCount();\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n }\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "function insertarCorredor(Corredor $corredor);", "function insert(){\r\n $this->model->randomInsert();\r\n $this->index();\r\n }", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "public function createInteraction($metric_id, $fields = array()) { \n $data = array_merge(array( \n \"authorId\"=> \"me\",\n \"kind\" => \"comment\"\n ), $fields); \n $result = $this->post(\"/v1/metrics/{$metric_id}/interactions\", $data);\n return $result; \n }", "function iadlearning_add_instance($iad) {\n global $DB;\n\n // Create the iad.\n $iad->timecreated = time();\n $iad->timemodified = $iad->timecreated;\n\n return $DB->insert_record('iadlearning', $iad);\n}", "public function insert(array $params);", "public function addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\n }", "public function insert() {\r\n\r\n\t\t// Does the Genre object already have an ID?\r\n\t\tif ( !is_null( $this->id ) ) trigger_error ( \"Genre::insert(): Attempt to insert an Genre object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n\t\t// Insert the Genre\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$sql = \"INSERT INTO :table ( id, name ) VALUES ( :id, :name )\";\r\n\t\t$st = $conn->prepare ( $sql );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->bindValue( \":name\", $this->name, PDO::PARAM_STR );\r\n\t\t$st->execute();\r\n\t\t$this->id = $conn->lastInsertId();\r\n\t\t$conn = null;\r\n\t}", "public function insertStatAndRoyalitiesAction(){\n \n }", "protected function create_interact_view() {\n\t\t$this->interact = new \\Interact\\InteractBaseView($this->course, $this->user,\n\t\t\tarray($this->assignment->get_tag()), $this->section->get_tag());\n\t\t$this->add_aux($this->interact);\n\t}", "public function add() {\n if ($this->id == 0) {\n $reponse = $this->bdd->prepare('INSERT INTO chapitres SET title = :title, body = :body');\n $reponse->execute([\n 'body'=>$this->body, \n 'title'=>$this->title\n ]);\n }\n }", "public function insert(array $options);", "protected function afterInsertAccepting()\n {\n }", "public function insert()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->newItemEntry();\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $this->getEntry()->setItemType($this->_getItemType());\n $entry = $service->insertGbaseItem($this->getEntry());\n $this->setEntry($entry);\n $entryId = $this->getEntry()->getId();\n $published = $this->gBaseDate2DateTime($this->getEntry()->getPublished()->getText());\n $this->getItem()\n ->setGbaseItemId($entryId)\n ->setPublished($published);\n\n if ($expires = $this->_getAttributeValue('expiration_date')) {\n $expires = $this->gBaseDate2DateTime($expires);\n $this->getItem()->setExpires($expires);\n }\n }", "public function insert($input, $noAutocomplete = false){\n return $this->add($input, $noAutocomplete);\n }", "public function add() {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"\n INSERT INTO reviews (persons_id, lessons_id, title, review, date_submitted, rating)\n VALUES (?,?,?,?,?,?)\");\n \n $stmt->bind_param('iisssi', $this->personsID, $this->lessonsID, $this->title, \n $this->review, $this->dateSubmitted, $this->rating);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }", "abstract public function insertID();", "protected function afterInserting()\n {\n }", "public function insert($attream);", "public function insert(Persona $persona);", "function add_student_behaviors_skill($params)\n {\n $this->db->insert('student_behaviors_skills',$params);\n return $this->db->insert_id();\n }", "public function insert() {\n \n $query = $this->dbConnection->prepare(\"INSERT INTO `menu` (`id`, `name`, `nameen`, `address`, `isMenu`, `order`) VALUES (NULL, :name, :nameen, :address, :isMenu, :order)\");\n $query->bindValue(':name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':nameen', $this->nameen, PDO::PARAM_STR);\n $query->bindValue(':address', $this->address, PDO::PARAM_STR);\n $query->bindValue(':isMenu', $this->isMenu, PDO::PARAM_STR);\n $query->bindValue(':order', $this->order, PDO::PARAM_STR);\n $query->execute();\n $this->id = $this->dbConnection->lastInsertId();\n }", "public function add_or_ignore()\n {\n $this->insert_ignore('table', array('foo' => 'bar'));\n\n // you can also do\n $this->ignore();\n $this->insert('table', array('foo' => 'bar'));\n }", "public function insert_() {\n\n\n\t\t\t$podcast = Model\\Podcast::get_instance();\n\n\t\t}", "public function insert($query, $bindings = []);", "public function insert($query, $bindings = []);", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "public function insert($permiso);", "public function insert() {\n\t\t$this->insert_user();\n\t}", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function insert($entity){\n\t\ttry {\n\t\t\t$data = $entity->toArray();\n\t\t\t$this->callBehavior('beforeInsert',$data);\n\t\t\t$this->convertId($data);\n\t\t\t$result = $this->collection->insertOne($data);\n\t\t\t$data['_id'] = $result->getInsertedId();\n\t\t\t//$this->doIntegrateIn($data);\n\t\t\t$this->callBehavior('afterInsert',$data);\n\t\t} catch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function insertEntities(array $input): void;", "function create(){\n //\n //create the insert \n $insert = new insert($this);\n //\n //Execute the the insert\n $insert->query($this->entity->get_parent());\n }", "public function insert($data);", "public function created(Observation $observation)\n {\n // create corrective action here....\n CorrectiveAction::insert([\n 'observation_id' => $observation->id,\n 'company_id' => $observation->company_id,\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime()\n ]);\n }", "public function insertPsychomotor($instruments, $dancing, $hurdles, $jumps, $sprints, $other_games, $volleyball, $basketball, $football, $painting, $drawing, $tools_handling, $public_speaking, $hand_writing, $student_id, $clazz_id, $clazz_type_id, $class_arm, $session_id, $term_id, $teacher_id){\n\t\t\t$sql = \"INSERT INTO psychomotor_skill (id, instruments, dancing, hurdles, jumps, sprints, other_games, volleyball, basketball, football, painting, drawing, tools_handling, public_speaking, hand_writing, student_id, clazz_id, clazz_type_id, class_arm_id, session_id, term_id, teacher_id, created_at) VALUES (NULL, '$instruments', '$dancing', '$hurdles', '$jumps', '$sprints', '$other_games', '$volleyball', '$basketball', '$football', '$painting', '$drawing', '$tools_handling', '$public_speaking', '$hand_writing', '$student_id', '$clazz_id', '$clazz_type_id', '$class_arm','$session_id', '$term_id', '$teacher_id', NULL)\";\n\t\t\t$this->connection()->exec($sql);\n\t\t\treturn true;\n\t\t}", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}" ]
[ "0.64006245", "0.6381019", "0.62174636", "0.6205525", "0.61593217", "0.61092013", "0.60342604", "0.6025956", "0.5964377", "0.59624", "0.59624", "0.5946269", "0.59357375", "0.58791935", "0.58703667", "0.58671206", "0.58671206", "0.5861781", "0.5805973", "0.5774082", "0.5760838", "0.57038134", "0.5692395", "0.56903464", "0.5676702", "0.56622547", "0.5650704", "0.56376475", "0.5611826", "0.55287963", "0.5504443", "0.54708785", "0.54471207", "0.54365206", "0.5433608", "0.5428634", "0.5426755", "0.5421982", "0.5413517", "0.54118663", "0.540098", "0.5400074", "0.53375185", "0.53311", "0.5330373", "0.53258187", "0.53142697", "0.53123516", "0.53077066", "0.52946246", "0.5284743", "0.52662414", "0.523943", "0.52337486", "0.5228997", "0.52232325", "0.5212946", "0.5205968", "0.5197707", "0.51914364", "0.5186212", "0.51773334", "0.5163816", "0.516202", "0.51418304", "0.5141675", "0.51397187", "0.5138131", "0.5127153", "0.5123561", "0.5118917", "0.51176673", "0.51127696", "0.51078784", "0.51044667", "0.5101076", "0.50939155", "0.50826895", "0.5074644", "0.50724113", "0.5071427", "0.507095", "0.5062032", "0.5055579", "0.50552404", "0.50527436", "0.5048545", "0.5048545", "0.5041386", "0.50313836", "0.50255084", "0.50247264", "0.5023563", "0.5019273", "0.5019076", "0.50104094", "0.50059396", "0.5004734", "0.49973646", "0.49971262" ]
0.5396874
42
Saves a state related to an interactionID. Example: Clicking an option will bring you to a new question state. We want to know what the resulting state (or destination) of this interaction on the option brought someone to. This insertion will allow us to track that.
private function insertState($interactionID, $stateID) { /************************************** ** WARNING!!!!!! ** ** ** ** NO VALIDATION OCCURS HERE. ** ** ONLY CALL FROM $this->insert() ** ***************************************/ // save the state too $params = [ ':interactionID' => $interactionID, ':elID' => $stateID ]; // write our SQL statement $sql = 'INSERT INTO '.$this->db->tables['treeState'].' ( interactionID, elID ) VALUES( :interactionID, :elID )'; // insert the mc_option into the database $stmt = $this->db->query($sql, $params); if($stmt !== false) { // return the inserted ID return $this->db->lastInsertId(); } else { // handle errors $this->errors[] = 'Insert state failed.'; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save($state);", "function insertJointSourceState($jointSourceId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n\n $result = query(\"INSERT INTO jointsources_states\n (`jointsource_id`, `author_id`, `state`)\n VALUES ($jointSourceId, $accountId, $stateEncoded);\");\n $stateId = $DATABASE->insert_id;\n\n return $stateId;\n\n }", "private function insertInteractionElement($interactionID, $elID) {\n /**************************************\n ** WARNING!!!!!! **\n ** **\n ** NO VALIDATION OCCURS HERE. **\n ** ONLY CALL FROM $this->insert() **\n ***************************************/\n\n // save the interaction\n $params = [\n ':interactionID' => $interactionID,\n ':elID' => $elID\n ];\n // write our SQL statement\n $sql = 'INSERT INTO '.$this->db->tables['treeInteractionElement'].' (\n interactionID,\n elID\n )\n VALUES(\n :interactionID,\n :elID\n )';\n // insert the mc_option into the database\n $stmt = $this->db->query($sql, $params);\n\n if($stmt !== false) {\n // return the inserted ID\n return $this->db->lastInsertId();\n } else {\n // handle errors\n $this->errors[] = 'Insert interaction element failed.';\n return false;\n }\n }", "public function save($state)\n\t{\n\t\tIOHelper::writeToFile($this->stateFile, serialize($state));\n\t}", "public function save()\n {\n $this->persist($this->state);\n }", "function insertJointSourceMetaParticipantState($delegId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n $result = query(\"INSERT INTO jointsources_participants_states\n (`deleg_id`, `state`, `author_id`)\n VALUES ({$delegId}, {$stateEncoded}, {$accountId});\");\n\n $stateId = $DATABASE->insert_id;\n return $stateId;\n\n }", "public function save($state) {\n $data = serialize($state);\n try {\n $db = $this->getDbConnection();\n $sql = \"SELECT id FROM {$this->persisterTableName} WHERE id=1\";\n if ($db->createCommand($sql)->queryScalar() === false)\n $sql = \"INSERT INTO {$this->persisterTableName} (id, data) VALUES (1, :data)\";\n else\n $sql = \"UPDATE {$this->persisterTableName} SET data=:data WHERE id=1\";\n $db->createCommand($sql)->bindValue(':data', $data)->execute();\n }\n catch (Exception $e) {\n if (YII_DEBUG)\n echo $e->getMessage();\n return false;\n }\n return true;\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n }\n\n $state_id = $this->request->getPost(\"state_id\");\n\n $mission_user_state = MissionUserState::findFirstBystate_id($state_id);\n if (!$mission_user_state) {\n $this->flash->error(\"mission_user_state does not exist \" . $state_id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n }\n\n $mission_user_state->mission_id = $this->request->getPost(\"mission_id\");\n $mission_user_state->user_id = $this->request->getPost(\"user_id\");\n $mission_user_state->state = $this->request->getPost(\"state\");\n \n\n if (!$mission_user_state->save()) {\n\n foreach ($mission_user_state->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"edit\",\n \"params\" => array($mission_user_state->state_id)\n ));\n }\n\n $this->flash->success(\"mission_user_state was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"mission_user_state\",\n \"action\" => \"index\"\n ));\n\n }", "public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }", "public function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\t\t$this->saveAdditionalQuestionDataToDb();\n\t\t$this->saveAnswerSpecificDataToDb();\n\n\t\tparent::saveToDb($original_id);\n\t}", "function insertJointSourceMetaThemeState($delegId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n $result = query(\"INSERT INTO jointsources_themes_states\n (`deleg_id`, `state`, `author_id`)\n VALUES ({$delegId}, {$stateEncoded}, {$accountId});\");\n\n $stateId = $DATABASE->insert_id;\n return $stateId;\n\n }", "protected function saveState() {\n $filename = $this->tempPath() . self::STATEFILE_STUB;\n return file_put_contents($filename, serialize($this->state));\n }", "public function saveResponse($responseID, $response);", "function insertJointSourceMetaRegionLanguageState($langId, $state = STATE_PUBLISHED) {\n\n global $DATABASE;\n $accountId = \\Session\\getAccountId();\n\n $stateEncoded = encodeState($state);\n $result = query(\"INSERT INTO jointsources_regions_langs_states\n (`lang_id`, `state`, `author_id`)\n VALUES ({$langId}, {$stateEncoded}, {$accountId});\");\n\n $stateId = $DATABASE->insert_id;\n return $stateId;\n\n }", "function insert_state($state) {\n if (!RefineData::isStateExists($state)) {\n RefineData::insertState(remove_numbers($state));\n }\n}", "public function saveState($jsonState)\n {\n $state = null;\n if ($jsonState !== null) {\n $state = new State();\n $state->setSlug($this->application->getSlug());\n $state->setTitle(\"SuggestMap\");\n $state->setJson($jsonState);\n $state = $this->unSignUrls($state);\n $this->entityManager->persist($state);\n $this->entityManager->flush();\n }\n return $state;\n }", "public function store()\n { \n $real_state = new RealState();\n $real_state->name = Input::get('name');\n $real_state->description = Input::get('description');\n $real_state->save(); \n return Redirect::route('real_state.index');\n }", "public function store(StateRequest $request)\n {\n $state = $this->service->saveOrUpdateDetails($request);\n if ($state) {\n return redirect(route('state.edit',['state' => $state]))->with('success', 'State has been created successfully!');\n }\n\n return back()->withInput();\n }", "function save($overideId = false)\n\t{\n\t\tif ($overideId)\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\n\t\telse if ($this->id)\n\t\t\t$this->getAdapter()->update($this->data, $this, \"{$this->id_column} = {$this->id}\");\n\n\t\telse\n\t\t{\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\t\t\t$this->id = $this->getAdapter()->lastInsertId();\n\t\t}\n\t}", "function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\n\t\t// save additional data\n\t\t$ilDB->manipulateF(\"DELETE FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\", \n\t\t\tarray(\"integer\"),\n\t\t\tarray($this->getId())\n\t\t);\n\t\t\n\t\t$ilDB->insert(\n\t\t\t\t$this->getAdditionalTableName(),\n\t\t\t\tarray(\n\t\t\t\t\t'question_fi'\t=> array('integer',(int) $this->getId()),\n\t\t\t\t\t'vip_sub_id'\t=> array('integer',(int) $this->getVipSubId()),\n\t\t\t\t\t'vip_cookie'\t=> array('text',(string) $this->getVipCookie()),\n\t\t\t\t\t'vip_exercise'\t=> array('clob',(string) $this->getVipExercise()),\n\t\t\t\t\t'vip_lang'\t\t=> array('text', (string) $this->getVipLang()),\n\t\t\t\t\t'vip_exercise_id'\t=> array('integer',(string) $this->getVipExerciseId()),\n\t\t\t\t\t'vip_evaluation' => array('clob',(string) $this->getVipEvaluation()),\n\t\t\t\t\t'vip_result_storage' => array('integer',(string) $this->getVipResultStorage()),\n\t\t\t\t\t'vip_auto_scoring' => array('integer', (int) $this->getVipAutoScoring())\n\t\t\t\t)\n\t\t);\n\t\tparent::saveToDb($original_id);\n\t}", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "public function store(){\n // state\n $state = new State;\n $state->name_en = Input::get('name_en');\n $state->name_jp = Input::get('name_jp');\n $state->region_id = Input::get('region_id');\n $state->rise_year = Input::get('rise_year');\n if(Input::has('is_rise_year_fixed')) $state->is_rise_year_fixed = true;\n $state->fall_year = Input::get('fall_year');\n if(Input::has('is_fall_year_fixed')) $state->is_fall_year_fixed = true;\n $state->explanation_en = Input::get('explanation_en');\n $state->explanation_jp = Input::get('explanation_jp');\n $state->capital_name_en = Input::get('capital_name_en');\n $state->capital_name_jp = Input::get('capital_name_jp');\n $state->save();\n\n //redirect\n Session::flash('message','Success create.');\n return Redirect::to('/admin/state');\n\n\t}", "public function saveState($data) {\n if (!is_numeric($data['user_id']))\n return;\n\n $this->logger->log(\"Application::saveState() SAVING...\", Zend_Log::INFO);\n try {\n $query = \"SELECT `user_id` FROM `app_state` WHERE user_id = ?\";\n $user_id = $this->db->fetchOne($query, $data['user_id']);\n\n $var = print_r($data, true);\n if (is_numeric($user_id)) {\n $n = $this->db->update('app_state', $data, \"user_id = $user_id\");\n $this->logger->log(\"Application::saveState() SAVING...UPDATING $var\", Zend_Log::INFO);\n } else {\n $this->db->insert('app_state', $data);\n $this->logger->log(\"Application::saveState() SAVING...INSERTING $var\", Zend_Log::INFO);\n }\n } catch (Exception $e) {\n $dbLoggerObj = new DbLogger($e);\n $this->logger->log($dbLoggerObj->message, Zend_Log::ERR);\n }\n }", "public function store($id)\n\t{\n\t\t//\n\t}", "public function store($id)\n\t{\n\t\t//\n\t}", "protected function actionSaveState($params){\n\t\tGO::session()->closeWriting();\n\t\t\n\t\tif(isset($params['values'])){\n\t\t\t$values = json_decode($params['values'], true);\n\n\t\t\tif(!is_array($values)){\n\t\t\t\ttrigger_error (\"Invalid value for Core::actionSaveState: \".var_export($params, true), E_USER_NOTICE);\n\t\t\t}else\n\t\t\t{\n\t\t\t\tforeach($values as $name=>$value){\n\n\t\t\t\t\t$state = \\GO\\Base\\Model\\State::model()->findByPk(array('name'=>$name,'user_id'=>GO::user()->id));\n\n\t\t\t\t\tif(!$state){\n\t\t\t\t\t\t$state = new \\GO\\Base\\Model\\State();\n\t\t\t\t\t\t$state->name=$name;\n\t\t\t\t\t}\n\n\t\t\t\t\t$state->value=$value;\n\t\t\t\t\t$state->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$response['success']=true;\n\t\techo json_encode($response);\n\t}", "public function save()\n\t{\n\t\t$this->copyAttributesToValues() ;\n\t\tif( $this->factory )\n\t\t{\n\t\t\tswitch( $this->todo )\n\t\t\t{\n\t\t\t\tcase 1: // Insert\n\t\t\t\t\tif( $this->factory->insertObjectIntoDB( $this ) ) $this->state = \"inserted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 2: // update\n\t\t\t\t\tif( $this->factory->updateObjectIntoDB( $this ) ) $this->state = \"updated\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 3: // delete\n\t\t\t\t\tif( $this->factory->deleteObjectIntoDB( $this ) ) $this->state = \"deleted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}", "public function addState(StateInterface $state): void;", "function save_district_state() {\n $datas = RefineData::getMasterData();\n foreach ($datas as $data) {\n insert_district($data->state, $data->district);\n }\n}", "public function changeStateOutcomeToCreated($id)\n {\n\n $outcome = Outcome::where('ID_ST_OUTCOME', '=', $id)->first();\n\n // $outcome->STATE_ID_STATE='15';\n // $outcome->save();\n\n $response = Response::json($outcome, 200);\n return $response;\n }", "public function getStateId();", "public function getStateId();", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "public function save()\n {\n try {\n $instanceState = $this->toArray();\n if (empty($instanceState['id'])) {\n unset($instanceState['id']);\n Db::getInstance()->insert($this->getTableName(), $instanceState);\n } else {\n Db::getInstance()->update($this->getTableName(), $instanceState, ['id' => $instanceState['id']]);\n }\n\n return true;\n } catch (DbException $e) {\n return false;\n }\n }", "function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}", "protected function insert($data) {\n $response = [];\n // make sure it's valid\n $isValid = $this->validate($data);\n\n // if validation doesn't pass, return the errors\n if($isValid !== true) {\n return $this->errors;\n }\n\n $treeID = $data['treeID'];\n $userID = $data['userID'];\n $interactionType = $this->db->getInteractionType($data['interaction']['type']);\n $interactionID = $data['interaction']['id'];\n $destinationType = $this->db->getStateType($data['destination']['type']);\n $destinationID = $data['destination']['id'];\n $embedID = $data['site']['embedID'];\n\n // Get our Parameters ready\n $params = [\n ':treeID' => $treeID,\n ':userID' => $userID,\n ':embedID' => $embedID,\n ':interactionTypeID' => $interactionType['interactionTypeID'],\n ':stateTypeID' => $destinationType['stateTypeID'],\n ];\n // write our SQL statement\n $sql = 'INSERT INTO '.$this->db->tables['treeInteraction'].' (\n treeID,\n userID,\n embedID,\n interactionTypeID,\n stateTypeID\n )\n VALUES(\n :treeID,\n :userID,\n :embedID,\n :interactionTypeID,\n :stateTypeID\n )';\n // insert the mc_option into the database\n $stmt = $this->db->query($sql, $params);\n\n // success!\n if($stmt !== false) {\n $insertedInteractionID = $this->db->lastInsertId();\n\n $response = [\n 'interactionID' => $insertedInteractionID,\n 'status' => 'success',\n 'action' => 'insertInteraction'\n ];\n\n // if it's one that has a stateID with it, then let's save that too\n $interactions = ['option', 'history', 'start'];\n if(in_array($interactionType['interactionType'], $interactions) && $destinationType['stateType'] !== 'overview') {\n $this->insertState($insertedInteractionID, $destinationID);\n }\n\n // if we interacted with an option, save the interactionID to the elment_interactions\n $interactions = ['option'];\n if(in_array($interactionType['interactionType'], $interactions)) {\n $this->insertInteractionElement($insertedInteractionID, $interactionID);\n }\n } else {\n // handle errors\n $this->errors[] = 'Insert interaction failed.';\n $this->errors['status'] = 'error';\n }\n\n\n if(!empty($this->errors)) {\n return $this->errors;\n }\n\n return $response;\n }", "function save_to_db()\n\t{\t\n\t\t// Sanitize database input. Note, the build_sql_string uses \n\t\t// mysql_real_escape_string() below. \n\t\t\n\t\tif (strlen($this->State) > 20)\n\t\t\treturn display_error(\"State is too long. It must be one of an enumeration.\");\t\n\t\tif (strlen($this->PrevState) > 20)\n\t\t\treturn display_error(\"PrevState is too long. It must one of an enumeration.\");\t\n\t\tif (strlen($Gender->Gender) > 10)\n\t\t\treturn display_error(\"Gender is too long. It must be Male or Female.\");\t\n\t\tif (strlen($Gender->Counted) > 1)\n\t\t\treturn display_error(\"Counted is too long. It must be Y or N.\");\t\n\n\t\tif (!array_key_exists(SESSION_LOGIN_USER_ID, $_SESSION))\n\t\t\treturn display_error(\"Cannot save Signup to DB: not logged in.\");\t\n\t\t\t\t\n\t\t\t\t\n\t\t$this->TimeStamp = date(\"Y-m-d H:i:s\", time());\t\n\t\t$this->UpdatedById = $_SESSION[SESSION_LOGIN_USER_ID];\n\n\t\t\n\t\t// See if this is an insert or update.\n\t\t\n\t\t$this->SignupId = mysql_real_escape_string($this->SignupId);\n\t\t$sql = \"select * from Signup where SignupId = '$this->SignupId'\";\n\t\t$result = mysql_query($sql);\n\t\tif (!$result)\n\t\t\treturn display_mysql_error ('Cannot execute query', $sql);\n\t\t\t\t\n\t\t// Update the database.\n\t\t\n\t\tif (mysql_num_rows($result) > 1)\n\t\t\treturn display_error(\"Error: multiple act rows found with same ID\");\n\t\t\t\n\t\telse if (mysql_num_rows($result) == 1)\n\t\t{\n\t\t\t$sql = \"update Signup set \";\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\t$sql = \"insert into Signup set \";\n\t\t}\n\n $sql .= build_sql_string('SignupId', $this->SignupId, false);\n $sql .= build_sql_string('UserId', $this->UserId);\n $sql .= build_sql_string('RunId', $this->RunId);\n $sql .= build_sql_string('State', $this->State);\n $sql .= build_sql_string('PrevState', $this->PrevState);\n $sql .= build_sql_string('Gender', $this->Gender);\n $sql .= build_sql_string('Counted', $this->Counted);\n $sql .= build_sql_string('UpdatedById', $this->UpdatedById);\n $sql .= build_sql_string('TimeStamp', $this->TimeStamp);\n \t\t\t\n\t\tif (mysql_num_rows($result) == 1)\n\t\t\t$sql .= sprintf(\" where SignupId = '%s'\", $this->SignupId);\n\t\t//echo $sql;\n\t\t\n\t\t$result = mysql_query($sql);\n\t\tif (!$result)\n\t\t\treturn display_mysql_error (\"Insert or Update into Signup failed\");\n\t}", "public function addState(StateInterface $state);", "public function store(int $idol_id)\n\t{\n\t\treturn $this->idol->add(new IdolId($idol_id));\n\t}", "public function saveToDb() {\n parent::saveToDb();\n\n require_once 'models/Location.php';\n Location::saveToDb($this->preferredLocation);\n Location::saveToDb($this->currentLocation);\n\n require_once 'libs/DB.php';\n $conn = DB::connect();\n\n $seekerId = $this->id();\n\n // Update the seeker table\n $conn->exec(\"UPDATE seeker SET experience='$this->experience', pref_location_name='$this->preferredLocation', curr_location_name='$this->currentLocation' WHERE id='$seekerId'\");\n\n require_once 'models/Skill.php';\n foreach($this->skills as $skill) {\n Skill::saveToDb($skill);\n }\n\n // Delete old skills\n $conn->exec(\"DELETE FROM seeker_skill WHERE seeker_id='$seekerId'\");\n\n // Add new skills\n foreach($this->skills as $skill) {\n $conn->exec(\"INSERT INTO seeker_skill(seeker_id, skill_name) VALUES('$seekerId', '$skill')\");\n }\n }", "public function save_category_form( $term_id ) {\n\t\tif( $this->save_count < 1 ) :\n\n\t\t\t$id = $this->args['id'];\n\t\t\t$data = Database::get_row( $this->args['table'], 'cat_id', $term_id );\n\n\t\t\tforeach( $this->args['table']['structure'] as $name => $args ) {\n\t\t\t\t$data[$name] = isset( $_POST[$name] ) ? $_POST[$name] : $data[$name];\n\t\t\t}\n\n\t\t\tif( empty( $data['cat_id'] ) ) {\n\t\t\t\t$data['cat_id'] = $term_id;\n\t\t\t\tDatabase::insert_row( $this->args['table'], $data );\n\t\t\t} else {\n\t\t\t\tDatabase::update_row( $this->args['table'], 'cat_id', $term_id, $data );\n\t\t\t}\n\n\t\t\t$this->save_count++;\n\n\t\tendif;\n\n\t}", "function save() {\n \t \tif ($this->id<>0) { \n \t \t\t$query_save = \"update wall set type = $this->type, typeId = $this->typeId, date = $this->date, active = $this->active where id=$this->id\"; \n \t \t\tmysql_query($query_save) or die(mysql_error()); \n \t \t} else { \n \t \t\t$query_save = \"insert into wall values (null, $this->type, $this->typeId, $this->date, $this->active)\"; \n \t \t\tmysql_query($query_save) or die(mysql_error()); \n \t \t\t$this->id = mysql_insert_id(); \n \t \t} \n \t }", "public function saveActivity($activityId, $event) {\n try {\n $activity = self::where('activityId', '=', $activityId)->get();\n if (isset($activity[0])) {\n $activity = $activity[0];\n $activity->$event = $activity->$event + 1;\n $activity->save();\n }\n else {\n $activity = new self();\n $activity->activityId = $activityId;\n $activity->enter = 0;\n $activity->click = 0;\n $activity->exit = 0;\n $activity->$event = 1;\n $activity->save();\n }\n Cache::forget(self::CACHE_KEY_PREFIX . '_' . $activityId);\n return true;\n }\n catch (Exception $e) {\n //log error here\n }\n }", "public function store($friend_id)\n {\n// Friend::create([\n// 'user_id' => Auth::id(),\n// 'friend_id' => $friend_id\n// ]);\n\n if (!friendship($friend_id)->exists) {\n\n Friend::create([\n 'user_id' => Auth::id(),\n 'friend_id' => $friend_id\n ]);\n }\n\n return back();\n }", "function addstate() {\n $clang = Yii::app()->lang;\n\n if (!Permission::model()->hasGlobalPermission('Regions', 'create')) {\n Yii::app()->setFlashMessage($clang->gT(\"You do not have sufficient rights to access this page.\"), 'error');\n $this->getController()->redirect(array(\"admin/index\"));\n }\n $new_state = flattenText(Yii::app()->request->getPost('new_state'), false, true);\n $country_name = (int) Yii::app()->request->getPost(\"country_name\");\n $zonelist = Yii::app()->request->getPost(\"zonelist\");\n $aData = array();\n if (empty($new_state)) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A state was not supplied or the state is invalid.\"), 'class' => 'warningheader');\n } elseif ($country_name == 0) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A country was not supplied or the country is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == 'zoneselect') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == '0') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif (State::model()->findByAttributes(array('state_Name' => $new_state, 'zone_id' => $zonelist))) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"The State already exists.\"), 'class' => 'warningheader');\n } else {\n $iNewUID = State::model()->instState($new_state, $zonelist);\n if ($iNewUID) {\n Yii::app()->setFlashMessage($clang->gT(\"State added successfully\"));\n $this->getController()->redirect(array(\"admin/state/index\"));\n } else {\n $aViewUrls['mboxwithredirect'][] = $this->_messageBoxWithRedirect($clang->gT(\"Failed to add state\"), $clang->gT(\"The state already exists.\"), 'warningheader');\n }\n }\n\n $this->_renderWrappedTemplate('region/state', $aViewUrls, $aData);\n }", "public function stateTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken('get');\n\n\t\t// Incoming\n\t\t$id = Request::getInt('id', 0);\n\t\t$state = strtolower(Request::getWord('state', 'up'));\n\n\t\tif ($state != 'up' && $state != 'down')\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$row = new Middleware\\Location($id);\n\t\tif ($row->exists())\n\t\t{\n\t\t\t$row->set('state', $state);\n\t\t\tif (!$row->store())\n\t\t\t{\n\t\t\t\tApp::redirect(\n\t\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false),\n\t\t\t\t\tLang::txt('COM_TOOLS_ERROR_STATE_UPDATE_FAILED'),\n\t\t\t\t\t'error'\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t);\n\t}", "function save(){\n\t\t// returns the item's id if successful\n\t\tif($this->beforesave()){\n\t\t\t$query = ($this->id?\"UPDATE \":\"INSERT INTO \").$this->tablename.\" SET \";\n\t\t\t$qvalues = \"\";\n\t\t\tforeach($this->dbvariables as $key){\n\t\t\t\t$qvalues .= ($qvalues == \"\"?\"\":\", \").$key.\"='\".trim(addslashes($this->$key)).\"'\";\n\t\t\t}\n\t\t\t$query .= $qvalues;\n\t\t\tif($this->id){\n\t\t\t\t$query .= \" WHERE id=\".$this->id;\n\t\t\t}else{\n\t\t\t\t$query .= \", item_order=\".get_neworder($this->tablename, $this->neworder_where());\n\t\t\t}\n\t\t\tmy_debug(\"Attempting query: \".$query,__FILE__,__LINE__,\"green\");\n\t\t\tif(mysql_query($query)){\t\t\t\t\n\t\t\t\tif(!$this->id && mysql_insert_id())\t$this->id = mysql_insert_id();\n\t\t\t\t$this->onsave();\n\t\t\t\treturn $this->id;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function store(CreateStateAPIRequest $request)\n {\n $input = $request->all();\n\n $state = $this->stateRepository->create($input);\n\n return $this->sendResponse(\n $state->toArray(),\n __('messages.saved', ['model' => __('models/states.singular')])\n );\n }", "public function store($id);", "public function save(){\r\n $db = new Database();\r\n $sql = \"\";\r\n $stm = null;\r\n if (empty($this->id)){\r\n $sql = \"insert into interests (name) values (:name)\";\r\n $stm = $db->pdo->prepare($sql);\r\n }\r\n else{\r\n $sql = \"update interests set name=:name where id=:id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':id', $this->id);\r\n }\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n }", "public function saveComponentAssociativeRelationTypeID($typeID): void\n {\n $associativeRelation = $this->getComponentAssociative();\n if ($associativeRelation && $associativeRelation->exists()) {\n $associativeRelation->AssociativeRelationTypeID = $typeID;\n }\n $associativeRelation->write();\n }", "public function save($id, $data, $lifeTime = 0);", "protected function setQuestTrackedStateRequest($destinyItemStateRequest)\n {\n // verify the required parameter 'destinyItemStateRequest' is set\n if ($destinyItemStateRequest === null || (is_array($destinyItemStateRequest) && count($destinyItemStateRequest) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $destinyItemStateRequest when calling setQuestTrackedState'\n );\n }\n\n $resourcePath = '/Destiny2/Actions/Items/SetTrackedState/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($destinyItemStateRequest)) {\n $_tempBody = $destinyItemStateRequest;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Key');\n if ($apiKey !== null) {\n $headers['X-API-Key'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function _saveNewShift()\n {\n // each timestamp action\n $this->shift = Shift::storeNewByEmployeeId($this->_employeeId);\n // log shift creation\n Log::info(\"New shift created.\", ['employee_id' => $this->_employeeId, 'shift_id' => $this->shift->id]);\n }", "protected function saveState(): void\n {\n $em = $this->getEntityManager();\n $em->flush();\n }", "public function setStateId($stateId);", "public function store($id)\n {\n // TODO: Implement update() method\n }", "public function save( $term_id ) {\n\t\t$subway_term_meta = filter_input( INPUT_POST, 'subway_term_meta', FILTER_DEFAULT, FILTER_FORCE_ARRAY );\n\t\t// Make the default value public.\n\t\t$subway_membership_access_type = 'public';\n\t\t// Filter allowed access type.\n\t\t$allowed_subway_membership_access_type = array( 'private', 'public' );\n\n\t\t// Bail out if not array.\n\t\tif ( ! is_array( $subway_term_meta ) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Bail out if empty.\n\t\tif ( empty ( $subway_term_meta ) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Assign requested access type.\n\t\t$subway_membership_access_type = $subway_term_meta['subway_membership_access_type'];\n\t\t$subway_membership_access_type_roles = (array) $subway_term_meta['subway_membership_access_type_role'];\n\n\t\t// Check if membership access type is in allowed access type.\n\t\tif ( ! in_array( $subway_membership_access_type, $allowed_subway_membership_access_type ) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Once everything is fine, save it to term meta.\n\t\tupdate_term_meta( $term_id, 'subway_membership_access_type', $subway_membership_access_type );\n\t\tupdate_term_meta( $term_id, 'subway_membership_access_type_roles', $subway_membership_access_type_roles );\n\t}", "public function save($cID) {\n\t\t$entry = $this->getEntryToSave($cID);\n\t\tif($this->saveEntry($entry)) {\n\t\t\tLoader::helper('clov_url', 'clov');\n\t\t\t\n\t\t\t// Redirect to the associated project or the generic list page. \n\t\t\t// Drafts always go to the generic list page because drafts are \n\t\t\t// not shown on the project page.\n\t\t\tif(!$entry->isComposerDraft() && $projectID = $entry->getAttribute('clov_expense_project')) {\n\t\t\t\t$project = Page::getByID($projectID);\n\t\t\t\t$this->redirect(ClovUrlHelper::getCollectionRoute($project));\n\t\t\t} else {\n\t\t\t\t$this->redirect('clov/expenses');\n\t\t\t}\n\t\t} else {\n\t\t\t// Something went wrong. Show the edit view where errors can be \n\t\t\t// displayed.\n\t\t\t$this->edit($entry->getCollectionID());\n\t\t}\n\t}", "public function save_referral_info($info_id,$referral_id,$sender_id,$senderType){\n\t\tglobal $con;\n\t\t$query=\"INSERT INTO referral_info(info_id,referral_id,sender_id)\n\t\tVALUES ($info_id,$referral_id,$sender_id,$senderType)\";\n\t}", "public function save($state)\n\t{\n\t\t$content=serialize($state);\n\t\t$saveFile=true;\n\t\tif(($cache=$this->getApplication()->getCache())!==null)\n\t\t{\n\t\t\tif($cache->get(self::CACHE_NAME)===$content)\n\t\t\t\t$saveFile=false;\n\t\t\telse\n\t\t\t\t$cache->set(self::CACHE_NAME,$content);\n\t\t}\n\t\tif($saveFile)\n\t\t{\n\t\t\t$fileName=$this->getStateFilePath();\n\t\t\tfile_put_contents($fileName,$content,LOCK_EX);\n\t\t}\n\t}", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function insertOUTCA($submitId, $state, $name, $phone, $product, $ip, $url, $typeID, $status, $caPrice)\r\n {\r\n $todayTime = Date(\"Y-m-d H:i:s\");\r\n $sql = \"INSERT INTO phone_order_outbound (`state`, `submitID`, `type`, `ip`, `phone`, `name`, `productID`, `status`, `referer`, `tocall_time`, `price`)\r\n VALUES ('$state', '$submitId', '$typeID', '$ip', '$phone', '$name', '$product', '$status', '$url', '$todayTime', '$caPrice')\";\r\n $this->conn->executeQuery($sql);\r\n return $this->conn->lastInsertId();\r\n }", "function timetracking_type_save(timetrackingType $type) {\n $type->save();\n}", "function save()\n {\n $GLOBALS['DB']->exec(\"INSERT INTO stores (store_name) VALUES (\n '{$this->getStoreName()}'\n );\");\n\n $this->id = $GLOBALS['DB']->lastInsertId();\n }", "public function insertOUTUP($state, $submitId, $typeID, $ip, $phone, $name, $product, $price, $upsellPrice, $quantity, $status, $url, $postData)\r\n {\r\n $todayTime = Date(\"Y-m-d H:i:s\");\r\n $sql = \"INSERT INTO phone_order_outbound (`state`, `submitID`, `type`, `ip`, `phone`, `name`, `productID`, `price`, `upsellPr`, `quantity`, `status`, `referer`, `postdata`, `tocall_time`)\r\n VALUES ('$state', '$submitId', '$typeID', '$ip', '$phone', '$name', '$product', '$price', '$upsellPrice', '$quantity', '$status', '$url', '$postData', '$todayTime')\";\r\n $this->conn->executeQuery($sql);\r\n return $this->conn->lastInsertId();\r\n }", "public function SaveExperience($data, $state, Experience $experience) {\n\t\t$costs = $data['costs'];\n\n\n\n\t\t$data['incurred_cost'] = 0;\n\t\t$data['incurred_cost_per_person'] = 0;\n\t\t$this->setCosts($costs['transportation'], $data['incurred_transportation_cost'], $data['incurred_transportation_cost_per_person'], $data);\n\t\t$this->setCosts($costs['food'], $data['incurred_food_drink_cost'], $data['incurred_food_drink_cost_per_person'], $data);\n\t\t$this->setCosts($costs['ticket'], $data['incurred_ticket_cost'], $data['incurred_ticket_cost_per_person'], $data);\n\t\t$this->setCosts($costs['other'], $data['incurred_other_cost'], $data['incurred_other_cost_per_person'], $data);\n\n\t\t$data['suggested_tip'] = $costs['tips']['value'];\n\t\t$data['is_experience_per_person'] = isset($costs['tips']['per_person']) && $costs['tips']['per_person'] === 'on';\n\t\t$data['state'] = $state;\n\n\t\tunset($data['costs']);\n\n\t\t$experience->update($data);\n\t\treturn $experience;\n\t}", "public function postState($stateDetail)\n {\n \n }", "function SaveGame($idPlayer, $IndividualScore)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"INSERT INTO fishermenland.history (ScoreHistory, fkPlayerHistory) VALUES ('$IndividualScore','$idPlayer')\");\n}", "public function savePaymentData($paypalPaymentID,$paypalPayerID){\n $payment_data = Session::get('payment_data');\n $order_id = $payment_data['order_id'];\n $state = $payment_data['state'];\n $order_price = $payment_data['order_price'];\n $paypal_payer_id = $paypalPayerID;\n\n if($state == 'Ordered'){\n //Create the row to add in our table\n $arrayNewPayment = array(\"order_id\"=>$order_id,\"order_price\"=>$order_price, \"payer\" => $paypal_payer_id);\n $paymentCreated = DB::table(\"payments\")->insert($arrayNewPayment);\n\n //update the state on that order to mark as paid\n DB::table('orders')->where('order_id', $order_id)->update(['state' => 'Paid']);\n }\n\n }", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function store()\n {\n $this->model->load('TacGia');\n $this->model->TacGia->anh = $_POST['anh'];\n $this->model->TacGia->ten = $_POST['ten'];\n $this->model->TacGia->thongtin = $_POST['thongtin'];\n $this->model->TacGia->save();\n\n go_back();\n }", "public function store(StateRequest $request)\n {\n\n try {\n $this->admin_id = auth()->user()->id;\n $input = $request->all();\n $input['user_id'] = $this->admin_id;\n State::create($input);\n return redirect()->route('states.create')->with(['success' => 'تم اضافة البيانات بنجاح']);\n } catch (\\Exception $ex) {\n return redirect()->route('states.create')->withInput($input)->with(['error' => 'لقد حدث خطأ برجاء المحاولة فيما بعد']);\n }\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function store(FeatureOptionRequest $request, $feature_id)\n {\n $data = $request->only($this->featureOption->fillable);\n $data['feature_id'] = $feature_id;\n\n $featureOption = $this->featureOption->create($data);\n\n $request->session()->flash('success', 'Salvo com sucesso.');\n\n if (!empty($request->input('saveAndContinueAdd'))) {\n return redirect()->route('admin.feature.option.create', [\n 'feature' => $feature_id,\n ]);\n }\n \n return redirect()->route('admin.feature.option.index', [\n 'feature' => $feature_id\n ]);\n }", "public function saveStoreToIntegration(int $integrationId, int $storeId): void;", "function TestSave_send_getState2(){\n \t$newAnswer = new Answer();\n \t$answerArray = array(array(\"elementId\" => 1, \"value\" => \"15\"), array(\"elementId\" => 2, \"value\" => \"0\"), array(\"elementId\" => 2, \"value\" => \"56\"), array(\"elementId\" => 2, \"value\" => \"29\"));\n \t$newAnswer->setAnswers($answerArray);\n \t$newAnswer->setRecipient(new User(1));\n \t$newAnswer->setFormId(4);\n \t$newAnswer->save();\n \t$newFormId = $newAnswer->getId();\n \t$newAnswer = new Answer($newFormId);\n \t$newAnswer->send();\n \t$this->assertEqual($newAnswer->getState(), TRUE);\n }", "public function ExtensionState($exten, $context, $actionId);", "public function writeState(array $newState): void\n {\n if (! is_writable($this->path) && ! is_writable(dirname($this->path))) {\n throw new RuntimeException('Unable to write to process ID file.');\n }\n\n file_put_contents($this->path, json_encode(\n array_merge($this->read(), ['state' => $newState]),\n JSON_PRETTY_PRINT\n ));\n }", "function education_information_meta_box_save( $post_id ) {\n\n\t// Verify if this is an auto save routine.\n\t// If it is our form has not been submitted, so we don't want to do anything\n\tif ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )\n\t\treturn;\n\n\t// Verify this comes from the our screen and with proper authorization\n\t// Because save_post can be triggered at other times\n\tif ( ( isset( $_POST['education_information_nonce'] ) ) &&\n\t( ! wp_verify_nonce( $_POST['education_information_nonce'], plugin_basename(__FILE__) ) ) )\n\t\treturn;\n\n\t// Check permissions\n\tif ( ( isset( $_POST['post_type'] ) ) && ( 'page' == $_POST['post_type'] ) ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// OK, we're authenticated: we need to find and save the data\n\tif ( isset( $_POST['institute_location'] ) ) {\n\t\t// P1: post id\n\t\t// P2: key\n\t\t// P3: value\n\t\tupdate_post_meta( $post_id, 'institute_location', $_POST['institute_location'] );\n\t}\n\n\tif ( isset( $_POST['degree_type'] ) ) {\n\t\tupdate_post_meta( $post_id, 'degree_type', $_POST['degree_type'] );\n\t}\n\n\tif ( isset( $_POST['graduation_date'] ) ) {\n\t\tupdate_post_meta( $post_id, 'graduation_date', $_POST['graduation_date'] );\n\t}\n\n\tif ( isset( $_POST['education_description'] ) ) {\n\t\tupdate_post_meta( $post_id, 'education_description', $_POST['education_description'] );\n\t}\n}", "public function saveTrackingPayOut($request_id)\n {\n \n }", "protected function save($queryParams = null)\n {\n $what = array('country' => $this->country);\n\n if (empty($this->id)) {\n $this->id = $this->query->sqlQueryInsert(array(\n 'arrayTableName' => array('tableName' => $this->tableName),\n 'arrayWhat' => $what));\n }\n }", "public function save_meta( $term_id, $taxonomy_term_id, $taxonomy ) {\n\t\ttry {\n\t\t\t$indexable = $this->get_indexable( $term_id, $taxonomy );\n\t\t} catch ( No_Indexable_Found $exception ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$formatter = $this->get_formatter( $term_id, $taxonomy );\n\t\t$indexable = $formatter->format( $indexable );\n\n\t\t$indexable->save();\n\t}", "public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}", "abstract protected function _doSave($id, $data, $lifeTime = false);", "public function save () {\n\t\t\t$insert = $this->db->prepare(\"INSERT INTO LOCATED(nameLocation, idArt) \n\t\t\t\tVALUES (?, ?)\");\n\t\t\treturn $insert->execute(array($this->nameLocation, $this->idArt));\n\t\t}", "function insert_district($state, $district) {\n if (!RefineData::isDistrictExists($district)) {\n $stid = RefineData::getStateId(substr($state, 0, 5));\n RefineData::insertDistrict($stid, $district);\n }\n}", "public function save($data, $scope, $id, $specificLifetime = false)\n\t{\n\t\t$id = str_replace(\"-\", \"_\", $id);\n\t\tif ($scope === self::SCOPE_USER)\n\t\t{\n\t\t\t$fullId = $scope . $this->_user->user_id . $id;\n\t\t\t$tags = array($scope . $this->_user->user_id);\n\t\t}\n\t\telseif ($scope === self::SCOPE_CLUB)\n\t\t{\n\t\t\t$fullId = $scope . $this->_clubId . $id;\n\t\t\t$tags = array($scope . $this->_clubId);\n\t\t}\n\t\telseif ($scope === self::SCOPE_IVC)\n\t\t{\n\t\t\t$fullId = $scope . $id;\n\t\t\t$tags = array($scope);\n\t\t}\n\t\t\n\t\tif ($this->_stats !== 'off')\n\t\t{\n\t\t\tif ($this->_cache->load($fullId))\n\t\t\t\t$action = \"replace\";\n\t\t\telse\n\t\t\t\t$action = \"insert\";\n\t\t\t$dataStr = serialize($data);\n\t\t\t$size = strlen($dataStr);\n\t\t\t$stats = array(\n\t\t\t'full_key' => $fullId,\n\t\t\t'scope' => $scope,\n\t\t\t'key' => $id,\n\t\t\t'size' => $size,\n\t\t\t'action' => $action,\n\t\t\t'validity' => $specificLifetime,\n\t\t\t'session_id' => $this->_sessionId\n\t\t\t);\n\t\t\t$this->_statsList[] = $stats;\n\t\t\tif ($this->_stats === 'full')\n\t\t\t $this->_statsTable->insert($stats);\n\t\t}\n\t\t$this->_cache->save($data, $fullId, $tags, $specificLifetime);\n\t\treturn ($this);\n\t}", "public function p_newentry($trip_id) {\n if (empty($_POST['title'])) {\n Router::redirect(\"/trips/newentry/blank\");\n }\n \n $here = Geolocate::locate();\n $_POST['state'] = $here['state'];\n $_POST['city'] = $here['city'];\n $_POST['ip'] = $here['ip'];\n\n # Associate this trip with this user\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this trip was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n $_POST['pic_id'] = \"\";\n $_POST['trip_id'] = $trip_id;\n $_POST['vid'] = \"\";\n $_POST['comment_id'] = \"\";\n\n DB::instance(DB_NAME)->insert(\"entries\", $_POST);\n\n Router::redirect(\"/trips/dashboard/\".$trip_id);\n }", "protected function doSave($id, $data, $lifeTime = 0)\n {\n $this->yac->set($this->getHash($id), $data);\n }", "public function testDestiny2SetQuestTrackedState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function save($bid)\n {\n\n DB::beginTransaction();\n try {\n\n $bid['status'] = ((array_key_exists('status', $bid) && $bid['status'] == 'on') ? \\Config::get('constants.ACTIVE_STATUS') : \\Config::get('constants.INACTIVE_STATUS'));\n $this->bids->create($bid);\n\n DB::commit();\n\n } catch (DBTransactionException $e) {\n DB::rollback();\n throw new DBTransactionException();\n }\n }", "function save_cookie($id, $type)\n\t{\n\t\t$cookiedata = $this->get_cookie_data();\n\t\t//mysql_query(\"INSERT INTO main.cookies (id, type, cookie_data) VALUES ('$id','$type','\".mysql_real_escape_string($this->get_cookie_data()).\"') ON DUPLICATE KEY UPDATE cookie_data='\".mysql_real_escape_string($this->get_cookie_data()).\"'\");\n\t\tif($type =='aol')\n\t\t{\n\t\t\tmysql_query(\"INSERT INTO main.cookies (id, type, cookie_data) VALUES ('$id','$type','\".mysql_real_escape_string($cookiedata).\"') ON DUPLICATE KEY UPDATE cookie_data='\".mysql_real_escape_string($cookiedata).\"'\") or die(mysql_error());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmysql_query(\"INSERT INTO $type.cookies (id, type, cookie_data) VALUES ('$id','$type','\".mysql_real_escape_string($cookiedata).\"') ON DUPLICATE KEY UPDATE cookie_data='\".mysql_real_escape_string($cookiedata).\"'\") or die(mysql_error());\n\t\t}\n\t}", "public function createState() {\n\t\t$statement = $this->database->prepare(\"INSERT INTO tbl_state (statename, capital, statecode) VALUES (?, ?, ?)\");\n\t\t// Bind all values to the placeholders\n\t\t$statement->bindParam(1, $this->statename);\n\t\t$statement->bindParam(2, $this->capital);\n\t\t$statement->bindParam(3, $this->statecode);\n\n\t\t// Execute the query\n\t\t$result = $statement->execute();\n\n\t\treturn $result ? true : false;\n\t}", "public function store($id) /* Maria Rennemark - add a house to a specific booking*/\n\t{\n\t\t$house = new Houses(\n\t\t\tarray(\n\t\t\t\t'name' => Input::get('checkbox1') ));\n\t\t$booking = Bookings::find($id);\n\t\t$house = $booking->houses()->save($house);\n\n\t\treturn Redirect::to('verification'.$id);\n\n}", "public function save_deals_meta_box( $post_id ) {\n\t \n\t // Check if our nonce is set.\n\t if ( ! isset( $_POST['deal_info_meta_box_nonce'] ) ) {\n\t return $post_id;\n\t }\n\t \n\t $nonce = $_POST['deal_info_meta_box_nonce'];\n\t \n\t // Verify that the nonce is valid.\n\t if ( ! wp_verify_nonce( $nonce, 'deal_info_meta_box' ) ) {\n\t return $post_id;\n\t }\n\t \n\t /*\n\t * If this is an autosave, our form has not been submitted,\n\t * so we don't want to do anything.\n\t */\n\t if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t return $post_id;\n\t }\n\t \n\t // Check the user's permissions.\n\t if ( 'page' == $_POST['deals'] ) {\n\t if ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t return $post_id;\n\t }\n\t } else {\n\t if ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t return $post_id;\n\t }\n\t }\n\t \n\t /* OK, it's safe for us to save the data now. */\n\t \n\t // Sanitize the user input.\n\t $start_data = sanitize_text_field( $_POST['start_time'] );\n\t $end_data = sanitize_text_field( $_POST['end_time'] );\n\t $happy_data = sanitize_text_field( $_POST['happy_hour'] );\n\t $food_data = sanitize_text_field( $_POST['food_deal'] );\n\t $alcohol_data = $_POST['alcohol_deal'];\n\t $neighborhood_data = sanitize_text_field( $_POST['neighborhood'] );\n\t $location_data = sanitize_text_field( $_POST['deal_location'] );\n\t $day_data = $_POST['deal_day'];\n\t $alcohol_deal_detail = $_POST['alcohol_deal_detail'];\n\t $food_deal_detail = $_POST['food_deal_detail'];\n\t $website_data = $_POST['website'];\n\t \n\t // Update the meta field.\n\t update_post_meta( $post_id, 'end_time', $end_data );\n\t update_post_meta( $post_id, 'start_time', $start_data );\n\t update_post_meta( $post_id, 'happy_hour', $happy_data );\n\t update_post_meta( $post_id, 'food_deal', $food_data );\n\t update_post_meta( $post_id, 'alcohol_deal', $alcohol_data );\n\t update_post_meta( $post_id, 'neighborhood', $neighborhood_data );\n\t update_post_meta( $post_id, 'deal_location', $location_data );\n\t update_post_meta( $post_id, '_deal_day', $day_data );\n\t update_post_meta( $post_id, 'alcohol_deal_detail', $alcohol_deal_detail );\n\t update_post_meta( $post_id, 'food_deal_detail', $food_deal_detail );\n\t update_post_meta( $post_id, 'website', $website_data );\n \t}", "function travel_meta_save( $post_id ) {\n \n // Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'travel_nonce' ] ) && wp_verify_nonce( $_POST[ 'travel_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n \n // Exits script depending on save status\n if ( $is_autosave || $is_revision || !$is_valid_nonce ) {\n return;\n }\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'travel-logo' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'travel-logo', $_POST[ 'travel-logo' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'travel-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'travel-image', $_POST[ 'travel-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-1-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-image', $_POST[ 'feature-1-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-2-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-image', $_POST[ 'feature-2-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-3-gettingto-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-gettingto-image', $_POST[ 'feature-3-gettingto-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-4-lodging-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-lodging-image', $_POST[ 'feature-4-lodging-image' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'feature-5-angling-image' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-angling-image', $_POST[ 'feature-5-angling-image' ] );\n\t\t}\n \n // Checks for input and saves\n\t\tif( isset( $_POST[ 'setthehook-option-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'setthehook-option-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'setthehook-option-checkbox', '' );\n\t\t}\n \n // Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'sth-textarea-1' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'sth-textarea-1', $_POST[ 'sth-textarea-1' ] );\n\t\t}\n\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image1' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image1', $_POST[ 'additional-info-image1' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image1-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image1-link', $_POST[ 'additional-info-image1-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image2' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image2', $_POST[ 'additional-info-image2' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image2-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image2-link', $_POST[ 'additional-info-image2-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image3' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image3', $_POST[ 'additional-info-image3' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image3-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image3-link', $_POST[ 'additional-info-image3-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image4' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image4', $_POST[ 'additional-info-image4' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image4-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image4-link', $_POST[ 'additional-info-image4-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image5' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image5', $_POST[ 'additional-info-image5' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image5-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image5-link', $_POST[ 'additional-info-image5-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image6' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image6', $_POST[ 'additional-info-image6' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image6-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image6-link', $_POST[ 'additional-info-image6-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image7' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image7', $_POST[ 'additional-info-image7' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image7-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image7-link', $_POST[ 'additional-info-image7-link' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image8' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image8', $_POST[ 'additional-info-image8' ] );\n\t\t}\n\t\n\t// Checks for input and saves if needed \n\t\tif( isset( $_POST[ 'additional-info-image8-link' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'additional-info-image8-link', $_POST[ 'additional-info-image8-link' ] );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-1-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-1-video', esc_url( $_POST[ 'feature-1-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-1-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-1-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-2-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-2-video', esc_url( $_POST[ 'feature-2-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-2-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-2-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-3-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-3-video', esc_url( $_POST[ 'feature-3-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-3-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-3-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-4-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-4-video', esc_url( $_POST[ 'feature-4-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-4-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-4-checkbox', '' );\n\t\t}\n\t\n\t// Checks for input and sanitizes/saves if needed\n\t\tif( isset( $_POST[ 'feature-5-video' ] ) ) {\n\t\tupdate_post_meta( $post_id, 'feature-5-video', esc_url( $_POST[ 'feature-5-video' ] ) );\n\t\t}\n\t\n\t// Checks for input and saves\n\t\tif( isset( $_POST[ 'feature-5-checkbox' ] ) ) {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-checkbox', 'yes' );\n\t\t} else {\n\t\t\t\tupdate_post_meta( $post_id, 'feature-5-checkbox', '' );\n\t\t}\n}", "function timetracking_save(timetracking $timetracking) {\n \n return $timetracking->save();\n}" ]
[ "0.5938603", "0.56179863", "0.5570784", "0.5551435", "0.5532026", "0.54963744", "0.54621977", "0.51635957", "0.5058857", "0.49947414", "0.4986856", "0.49748155", "0.4966034", "0.4945887", "0.4932158", "0.48915535", "0.48882657", "0.486293", "0.48371324", "0.48259965", "0.48153305", "0.48093542", "0.47970197", "0.47859743", "0.47859743", "0.4782872", "0.47595263", "0.4754389", "0.47520366", "0.4749895", "0.47475496", "0.47475496", "0.47384673", "0.46799433", "0.46679455", "0.4658652", "0.46477517", "0.4646042", "0.46448088", "0.46329767", "0.46323362", "0.4626098", "0.45864353", "0.4577819", "0.456954", "0.45585057", "0.45538417", "0.45537394", "0.45527518", "0.45464328", "0.45425892", "0.45421383", "0.45264667", "0.4525429", "0.452469", "0.452269", "0.45194256", "0.45129487", "0.4510696", "0.44994557", "0.44957766", "0.44945648", "0.4492618", "0.44879666", "0.4485934", "0.44847557", "0.44821572", "0.44814348", "0.4481109", "0.44767386", "0.44715783", "0.44664", "0.44630978", "0.44495058", "0.44486433", "0.44474512", "0.44458356", "0.44418332", "0.44389477", "0.44165853", "0.4413854", "0.4409002", "0.44073084", "0.43956104", "0.439407", "0.43940064", "0.43872845", "0.43872085", "0.4385047", "0.43797213", "0.43794087", "0.43756223", "0.43708158", "0.43676254", "0.43643063", "0.43600857", "0.43597236", "0.4357065", "0.43568853", "0.4352722" ]
0.7648632
0
Saves the element interacted with (like a click) related to an interactionID. Example: Clicking an option will bring you to a new question state. We want to know what element (option) was clicked on. This insertion will allow us to track that.
private function insertInteractionElement($interactionID, $elID) { /************************************** ** WARNING!!!!!! ** ** ** ** NO VALIDATION OCCURS HERE. ** ** ONLY CALL FROM $this->insert() ** ***************************************/ // save the interaction $params = [ ':interactionID' => $interactionID, ':elID' => $elID ]; // write our SQL statement $sql = 'INSERT INTO '.$this->db->tables['treeInteractionElement'].' ( interactionID, elID ) VALUES( :interactionID, :elID )'; // insert the mc_option into the database $stmt = $this->db->query($sql, $params); if($stmt !== false) { // return the inserted ID return $this->db->lastInsertId(); } else { // handle errors $this->errors[] = 'Insert interaction element failed.'; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save($overideId = false)\n\t{\n\t\tif ($overideId)\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\n\t\telse if ($this->id)\n\t\t\t$this->getAdapter()->update($this->data, $this, \"{$this->id_column} = {$this->id}\");\n\n\t\telse\n\t\t{\n\t\t\t$this->getAdapter()->insert($this->data, $this);\n\t\t\t$this->id = $this->getAdapter()->lastInsertId();\n\t\t}\n\t}", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function save() {\n\t\t$this->data[] = $this->current();\n\t}", "public function save()\n {\n parent::save();\n $warningBlock = $this->browser->find($this->warningBlock);\n if ($warningBlock->isVisible()) {\n $warningBlock->click();\n }\n }", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `svg_info` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `svg_info` values('\".addslashes($this->id).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->type).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->index).\"' , '\".addslashes($this->transform).\"' , '\".addslashes($this->value).\"' , '\".addslashes($this->fontsize).\"' , '\".addslashes($this->color).\"' , '\".addslashes($this->fill).\"' , '\".addslashes($this->stroke).\"' , '\".addslashes($this->points).\"' , '\".addslashes($this->txt).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "private function insertState($interactionID, $stateID) {\n /**************************************\n ** WARNING!!!!!! **\n ** **\n ** NO VALIDATION OCCURS HERE. **\n ** ONLY CALL FROM $this->insert() **\n ***************************************/\n // save the state too\n $params = [\n ':interactionID' => $interactionID,\n ':elID' => $stateID\n ];\n // write our SQL statement\n $sql = 'INSERT INTO '.$this->db->tables['treeState'].' (\n interactionID,\n elID\n )\n VALUES(\n :interactionID,\n :elID\n )';\n // insert the mc_option into the database\n $stmt = $this->db->query($sql, $params);\n\n if($stmt !== false) {\n // return the inserted ID\n return $this->db->lastInsertId();\n } else {\n // handle errors\n $this->errors[] = 'Insert state failed.';\n return false;\n }\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function save(){\n\t\tglobal $wpdb;\n\t\t$wpdb->insert( $wpdb->prefix . 'cf_form_entry_values', $this->to_array() );\n\t\treturn (int) $wpdb->insert_id;\n\n\t}", "function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}", "public function save(array $options = []) {\n \n // before save code \n parent::save();\n // after save code\n\n $id = $this->attributes['id'];\n $cms_tag = \\App\\Models\\CmsTag::find($id);\n\n // Define Position\n $input['position']=$cms_tag->id;\n\n // Save\n if ($cms_tag->position<1) {\n \\App\\Models\\CmsTag::where('id', $id)->update($input);\n }\n \n }", "public function store(DiagramInterface $diagram, $saveChildElements=false);", "public function saveElement($elementName, $elementType)\n {\n /* @var $connection PDO */\n $connection = $this->connection;\n \n //trim whitespace\n $elementName = trim($elementName);\n $elementType = trim($elementType);\n \n //check if element already exists\n $sql = \"SELECT ID FROM Elements WHERE Name = ? AND Type = ?\";\n $query = $connection->prepare($sql);\n $query->execute(array($elementName, $elementType));\n $result = $query->fetch(PDO::FETCH_ASSOC);\n \n if(!$result) {\n //element doesnt exist, save it and return its ID\n $sql = \"INSERT INTO Elements (Name, Type) VALUES (?, ?)\";\n $query = $connection->prepare($sql);\n $query->execute(array($elementName, $elementType));\n \n $elementID = $connection->lastInsertId();\n } else {\n //browser exists, return its ID\n $elementID = $result[\"ID\"];\n }\n \n return $elementID;\n }", "function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\n\t\t// save additional data\n\t\t$ilDB->manipulateF(\"DELETE FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\", \n\t\t\tarray(\"integer\"),\n\t\t\tarray($this->getId())\n\t\t);\n\t\t\n\t\t$ilDB->insert(\n\t\t\t\t$this->getAdditionalTableName(),\n\t\t\t\tarray(\n\t\t\t\t\t'question_fi'\t=> array('integer',(int) $this->getId()),\n\t\t\t\t\t'vip_sub_id'\t=> array('integer',(int) $this->getVipSubId()),\n\t\t\t\t\t'vip_cookie'\t=> array('text',(string) $this->getVipCookie()),\n\t\t\t\t\t'vip_exercise'\t=> array('clob',(string) $this->getVipExercise()),\n\t\t\t\t\t'vip_lang'\t\t=> array('text', (string) $this->getVipLang()),\n\t\t\t\t\t'vip_exercise_id'\t=> array('integer',(string) $this->getVipExerciseId()),\n\t\t\t\t\t'vip_evaluation' => array('clob',(string) $this->getVipEvaluation()),\n\t\t\t\t\t'vip_result_storage' => array('integer',(string) $this->getVipResultStorage()),\n\t\t\t\t\t'vip_auto_scoring' => array('integer', (int) $this->getVipAutoScoring())\n\t\t\t\t)\n\t\t);\n\t\tparent::saveToDb($original_id);\n\t}", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\t\t$this->saveAdditionalQuestionDataToDb();\n\t\t$this->saveAnswerSpecificDataToDb();\n\n\t\tparent::saveToDb($original_id);\n\t}", "function save($id, DataHolder $holder);", "protected function SaveActionIdToComment()\n {\n $sActionId = TTools::GetUUID();\n $this->sqlData['action_id'] = $sActionId;\n $this->AllowEditByAll(true);\n $this->Save();\n $this->AllowEditByAll(false);\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "function save(){\n\t\t// returns the item's id if successful\n\t\tif($this->beforesave()){\n\t\t\t$query = ($this->id?\"UPDATE \":\"INSERT INTO \").$this->tablename.\" SET \";\n\t\t\t$qvalues = \"\";\n\t\t\tforeach($this->dbvariables as $key){\n\t\t\t\t$qvalues .= ($qvalues == \"\"?\"\":\", \").$key.\"='\".trim(addslashes($this->$key)).\"'\";\n\t\t\t}\n\t\t\t$query .= $qvalues;\n\t\t\tif($this->id){\n\t\t\t\t$query .= \" WHERE id=\".$this->id;\n\t\t\t}else{\n\t\t\t\t$query .= \", item_order=\".get_neworder($this->tablename, $this->neworder_where());\n\t\t\t}\n\t\t\tmy_debug(\"Attempting query: \".$query,__FILE__,__LINE__,\"green\");\n\t\t\tif(mysql_query($query)){\t\t\t\t\n\t\t\t\tif(!$this->id && mysql_insert_id())\t$this->id = mysql_insert_id();\n\t\t\t\t$this->onsave();\n\t\t\t\treturn $this->id;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function save()\r\n {\r\n $changes = array();\r\n\tforeach( $this->saveable_fields as $field )\r\n\t{\r\n\t $changes[ $field ] = $this->$field;\r\n\t}\r\n\t$this->registry->getObject('db')->insertRecords( 'links', $changes );\r\n\t$uid = $this->registry->getObject('db')->lastInsertID();\r\n\treturn $uid; \r\n }", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function save() {\n //save the added fields\n }", "public function save(Identifiable $model);", "abstract protected function _doSave($id, $data, $lifeTime = false);", "public function save($id, $data, $lifeTime = 0);", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function test_save_1() {\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $data = array(\n 'instanceid' => $module->id,\n 'userid' => 2,\n 'title' => 'Talkpoint 001',\n 'uploadedfile' => 'foo.mp4',\n 'mediatype' => 'file',\n 'closed' => 0,\n );\n $data = $this->_cut->save($data, time());\n $this->assertArrayHasKey('id', $data);\n }", "public function addSubmittedExercise() {\n\n\t\t//$answers_from_current_user = xaseAnswer::where(array('user_id' => $this->dic->user()->getId(), 'question_id' => $this->xase_question->getId()))->get();\n\n\n\t\t$all_items_assisted_exercise = xaseQuestion::where(array( 'assisted_exercise_id' => $this->assisted_exercise->getId() ))->get();\n\n\t\t$answers_from_current_user = xaseQuestionTableGUI::getAllUserAnswersFromAssistedExercise($all_items_assisted_exercise, $this->dic, $this->dic->user());\n\n\t\t/*\n\t\t * @var xaseAnswer $answers_from_current_user\n\t\t */\n\t\tforeach ($answers_from_current_user as $answer_from_current_user) {\n\t\t\tif (is_array($answers_from_current_user)) {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answer_from_current_user['id'] ))->first();\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t} else {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answers_from_current_user['id'] ));\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tilUtil::sendSuccess($this->obj_facade->getLanguageValue('success_message_exercise_submitted'), true);\n\t\t$this->obj_facade->getCtrl()->redirectByClass(xaseQuestionGUI::class, xaseQuestionGUI::CMD_INDEX);\n\t}", "public function addclick() {\n $this->clicks = $this->clicks + 1;\n $this->save();\n\n}", "public function save($answerButton)\n {\n $answerButton->save();\n return $answerButton->id;\n }", "function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}", "function onSave()\r\n\t{\r\n\t\t$params\t= JRequest::getVar( 'params', array(), 'post', 'array' );\r\n\t\t$details\t= JRequest::getVar( 'details', array(), 'post', 'array' );\r\n\t\t$element =& $this->getElement();\r\n\t\t//load join based on this element id\r\n\t\t$join =& JTable::getInstance( 'Join', 'Table' );\r\n\t\t$origKey = $join->_tbl_key;\r\n\t\t$join->_tbl_key = \"element_id\";\r\n\t\t$join->load( $this->_id );\r\n\t\t$join->_tbl_key = $origKey;\r\n\t\t$join->table_join = '#__users';\r\n\t\t$join->join_type = 'left';\r\n\t\t$join->group_id = $details['group_id'];\r\n\t\t$join->table_key = str_replace('`', '', $element->name);\r\n\t\t$join->table_join_key = 'id';\r\n\t\t$join->join_from_table = '';\r\n\t\t$join->attribs = \"join-label=\" . $params['my_table_data'] . \"\\n\";\r\n\t\t$join->store();\r\n\t}", "public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }", "public function save(){\r\n $db = new Database();\r\n $sql = \"\";\r\n $stm = null;\r\n if (empty($this->id)){\r\n $sql = \"insert into interests (name) values (:name)\";\r\n $stm = $db->pdo->prepare($sql);\r\n }\r\n else{\r\n $sql = \"update interests set name=:name where id=:id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':id', $this->id);\r\n }\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n }", "function saveMyAnswer($connection,$questionId,$answerIdToSave,$userId,$userRole){\n $query = \"INSERT INTO forum_answer_saves SET q_id='$questionId',ansId='$answerIdToSave', saved_by='$userId',savedByUser='$userRole',date_time=now()\";\n $saveAnswer = $connection->query($query) or die(\"Error in saveing:\".$connection->error);\n if ($saveAnswer){\n return $saveAnswer;\n }\n }", "public function Save()\n {\n//echo $lastId;exit;\n $sql = \"\n insert into\n `\".$this->DB->db_name.\"`.`order`\n (\n `id`,\n `type`,\n `name`,\n `phone`,\n `email`,\n `date`,\n `lecture_id`,\n `webinar_id`\n )\n values\n (\n '\".$this->id.\"',\n '\".$this->type.\"',\n '\".$this->name.\"',\n '\".$this->phone.\"',\n '\".$this->email.\"',\n '\".time().\"',\n '\".$this->lecture_id.\"',\n '\".$this->webinar_id.\"'\n )\n on duplicate key update\n `type` = '\".$this->type.\"',\n `name` = '\".$this->name.\"',\n `phone` = '\".$this->phone.\"',\n `email` = '\".$this->email.\"',\n `lecture_id` = '\".$this->lecture_id.\"',\n `webinar_id` = '\".$this->webinar_id.\"'\n \";\n $res = $this->DB->DBConnect()->query( $sql );\n\n return $res;\n }", "function saveToRecord() {\n\t\t$fields_values = $this->toArray();\n\t\t$fields_values['tstamp'] = mktime();\n\t\t$fields_values['crdate'] = mktime();\n\t\tunset($fields_values['uid']);\n\t\t\n\t\t// If we have a non-zero UID, update an existing record, otherwise create a new record\n\t\tif($this->getUID()) {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_wecassessment_result', 'uid=' . $this->getUID(), $fields_values);\n\t\t} else {\n\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_wecassessment_result', $fields_values);\n\t\t\t$this->setUID($GLOBALS['TYPO3_DB']->sql_insert_id());\t\t\t\n\t\t}\n\t\t\n\t\t$answers = $this->getAnswers();\n\t\tforeach((array) $answers as $answer) {\n\t\t\t$answer->setResultUID($this->getUID());\n\t\t\t$answer->save();\n\t\t}\n\t\t\n\t\t// Blow up session data\n\t\ttx_wecassessment_sessiondata::storeSessionData(null, $this->getPID());\n\t\t\n\t\treturn $this->_uid;\n\t}", "public function afterSave($created, $options = array())\n { \n // If the item have no original_id then it is the original_id\n if(empty($this->data['Needle']['original_id']))\n {\n $this->saveField('original_id',$this->data['Needle']['id']);\n }\n }", "public function saveResponse($responseID, $response);", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }", "public function save()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n $queryBuilder->insert(self::TABLE_NAME);\n\n foreach (['delivery_id', 'status', 'topic', 'body', 'sent_at', 'direction', 'to', 'result'] as $field) {\n $value = isset($this->data[$field]) ? $this->data[$field] : null;\n $queryBuilder->setValue(\"`$field`\", $queryBuilder->expr()->literal($value));\n }\n\n $queryBuilder->execute();\n\n return $this->db->lastInsertId();\n }", "public function onsave() {\n\n\tif( filter_input( INPUT_POST, 'content' ) ) {\n\t global $post;\n do_shortcode( stripslashes( filter_input( INPUT_POST, 'content' ) ) );\n\t if( isset( $this->shortcode['elements'] ) ) {\n $this->assign_repeatable();\n }\n $meta = get_post_meta( $post->ID, 'pwp_form', true );\n $meta['definition'] = $this->shortcode;\n update_post_meta( $post->ID, 'definition', $meta );\n }\n }", "function save()\n {\n $GLOBALS['DB']->exec(\"INSERT INTO stores (store_name) VALUES (\n '{$this->getStoreName()}'\n );\");\n\n $this->id = $GLOBALS['DB']->lastInsertId();\n }", "public function save(){\n $data = file_get_contents('php://input');\n //saving data and getting inserted id or the existing one\n $this->id = $this->_so->save($data);\n //returning saved object for frontend sync\n return $this->byId();\n }", "function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }", "public function saved(EntryInterface $entry)\n {\n parent::saved($entry);\n\n $this->dispatch(new DumpPages());\n }", "function element_storeElement() {\t\n\t## okay we need to store/update the element\n\t\n\t## prepare the data\n\t$identifier = $_POST['attribute'];\n\t$filename = '';\n\n\t$caption = mysql_real_escape_string($_POST['caption']);\n\t$element_id = intval($_POST['element_id']);\n\t$object_id = intval($_POST['object']);\n\t\n\t## now preare the image\n\t## we need to prepare the input - needs to be done properly\n\t$userfile\t= $_FILES['image']['tmp_name'];\n\t$file_name\t= $_FILES['image']['name'];\n\t$file_size\t= $_FILES['image']['size'];\n\t$file_type\t= $_FILES['image']['type'];\n\t\n\t## okay we first create an upload object\n\t$f = new file_object(); \n\tif (($userfile != \"none\") && ($userfile !=\"\")) { \n\t\t##then we upload the file\n\t\t$filename = $f->upload($userfile, $file_name,$file_size,$file_type, MATRIX_UPLOADDIR.'dataobjects/'.$identifier.'/');\n\t\n\t\tif($filename != -1) {\n\t\t\t$img_size = GetImageSize(MATRIX_UPLOADDIR.'dataobjects/'.$identifier.'/'.$filename);\n\t\t}\n\t}\n\n\t$db_connection = new DB_Sql();\n\n\t## first check if the entry already exists\n\t$select_query = \"SELECT * FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_\".$identifier.\" WHERE id='$element_id'\";\n\t$result_pointer = $db_connection->query($select_query);\n\t$db_connection->next_record();\n\t\n\t$id = $db_connection->Record['id'];\n\n\tif($db_connection->num_rows() > 0) { \n\t\tif($filename == '') {\n\t\t\t$update_query = \"UPDATE \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_\".$identifier.\" SET caption = '\".$caption.\"' WHERE id = '$element_id'\";\n\t\t} else {\n\t\t\t$update_query = \"UPDATE \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_\".$identifier.\" SET caption = '\".$caption.\"', filename='\".$filename.\"', width= '$img_size[0]',height='$img_size[1]' WHERE id = '$element_id'\";\n\t\t}\t\n\t\t$result_pointer = $db_connection->query($update_query);\n\t} else {\n\t\t## first we need to regsiter the image in your image_data table\n\t\t$query = \"INSERT INTO \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_\".$identifier.\" (element_id,caption,filename, width, height) values ('$object_id','\".$caption.\"','\".$filename.\"','$img_size[0]','$img_size[1]')\";\n\t\t$result_pointer = $db_connection->query($query);\n\t}\n\t\n}", "public function post_save($data) {\n\n\t\t// Empty save result\n\t\tif (!$data) {\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Fetch elements\n\t\t$this->_load_elements_lib();\n\t\t$content_elements = $this->EE->elements->fetch_avaiable_elements($this->get_vars2export());\n\n\t\t// Current settings\n\t\tif (!is_array($data))\n\t\t\t$data = unserialize($data);\n\n\t\tforeach ($data as $eid => $element) {\n\n\t\t\tif (empty($element[\"element_type\"]))\n\t\t\t\tcontinue;\n\n\t\t\t$element_data = $element[\"data\"];\n\t\t\t$element_settings = unserialize(base64_decode($element[\"element_settings\"]));\n\t\t\t$element_type = $element_settings[\"type\"];\n\n\t\t\tif (!empty($this->EE->elements->$element_type) and method_exists($this->EE->elements->$element_type->handler, 'post_save_element')) {\n\t\t\t\t// Attach element settings\n\t\t\t\tforeach ($this->_exclude_setting_system_fields($element_settings[\"settings\"]) as $setting_var => $setting_value) {\n\t\t\t\t\t$this->EE->elements->$element_type->handler->settings[$setting_var] = $setting_value;\n\t\t\t\t}\n\n\t\t\t\t// Attach element field name\n\t\t\t\t$this->EE->elements->$element_type->handler->field_name = $this->_element_field_name() . '[' . $eid . '][data]';\n\n\t\t\t\t// Attach title\t\t\t\t\t\n\t\t\t\t$this->EE->elements->$element_type->handler->element_title = $element_settings[\"settings\"][\"title\"];\n\n\t\t\t\t// Set element id\n\t\t\t\t$this->EE->elements->$element_type->handler->element_id = $eid;\n\n\t\t\t\t// Set field id\t\n\t\t\t\tif (isset($this->field_id) && $this->field_id) {\n\t\t\t\t\t$this->EE->elements->$element_type->handler->field_id = $this->field_id;\n\t\t\t\t}\n\n\t\t\t\t// Send data & call event\n\t\t\t\t$this->EE->elements->$element_type->handler->post_save_element($data[$eid][\"data\"]);\n\t\t\t}\n\t\t}\n\n\t\t## fix saved revision\n\t\t\n\t\t// get channel settings\n\t\t$query = ee()->api_channel_structure->get_channel_info($_POST['channel_id']);\n\t\tforeach(array('channel_url', 'rss_url', 'deft_status', 'comment_url', 'comment_system_enabled', 'enable_versioning', 'max_revisions') as $key)\n\t\t{\n\t\t\t$c_prefs[$key] = $query->row($key);\n\t\t}\n\t\t\n\t\t// get entry titles\n\t\tee()->db->select('versioning_enabled');\n\t\t$query_v = ee()->db->get_where('channel_titles', array('entry_id' => $this->settings['entry_id']));\n\t\t\n\t\t// if entry version is disable then disable versioning\n\t\tif ($query_v->row('versioning_enabled') == 'n')\n\t\t{\n\t\t\t$c_prefs['enable_versioning'] = 'n';\n\t\t}\n\t\t\n\t\t// if is versioning enabled then fix saved data\n\t\tif ($c_prefs['enable_versioning'] == 'y')\n\t\t{\n\t\t\t// get last saved revision\n\t\t\tee()->db->select('*');\n\t\t\tee()->db->from('entry_versioning');\n\t\t\tee()->db->where('entry_id', $this->settings['entry_id']);\n\t\t\tee()->db->order_by('version_id', 'desc');\n\t\t\tee()->db->limit(1);\n\t\t\t\t\n\t\t\t$query = ee()->db->get();\n\t\t\t\t\n\t\t\t// if revision exist\n\t\t\tif ($query->num_rows == 1) {\n\t\t\n\t\t\t\t$temp = $query->result_array();\n\t\t\n\t\t\t\t// replace wrong data\n\t\t\t\t$field = unserialize($temp[0]['version_data']);\n\t\t\t\t$field[$this->settings['field_name']] = $data;\n\t\t\t\t$field = serialize($field);\n\t\t\n\t\t\t\t// update last revision with correct data\n\t\t\t\tee()->db->update('entry_versioning', array('version_data'\t=> $field), array('version_id' => $temp[0]['version_id']));\n\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\n\t\treturn $data;\n\t}", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "function save_order(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\t$ordered_ids = $_POST[ 'id_array' ];\n\t$position = 1;\n\tforeach( $ordered_ids as $id ){\n\t\tupdate_post_meta( (int) $id, 'post_order', $position );\n\t\t$position ++;\n\t}\n}", "private function saveData()\n { \n // Save form data in session\n if (count($this->post) > 0) {\n $_SESSION['gentlesource_voting_configuration'] = $this->post;\n $this->data = $this->post;\n $this->votingOptions = $this->post['votingOptions'];\n } else {\n if (isset($_SESSION['gentlesource_voting_configuration'])) {\n $this->data = $_SESSION['gentlesource_voting_configuration'];\n $this->votingOptions = $this->data['votingOptions'];\n }\n }\n }", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "public function save_meta_box_ajax() {\n\t\tcheck_ajax_referer( 'create-tracking-item', 'security', true );\n\n\t\tif ( isset( $_POST['tracking_number'] ) && strlen( $_POST['tracking_number'] ) > 0 ) {\n\n\t\t\t$order_id = wc_clean( $_POST['order_id'] );\n\t\t\t$args = array(\n\t\t\t\t'tracking_provider' => wc_clean( $_POST['tracking_provider'] ),\n\t\t\t\t'custom_tracking_provider' => wc_clean( $_POST['custom_tracking_provider'] ),\n\t\t\t\t'custom_tracking_link' => wc_clean( $_POST['custom_tracking_link'] ),\n\t\t\t\t'tracking_number' => wc_clean( $_POST['tracking_number'] ),\n\t\t\t\t'date_shipped' => wc_clean( $_POST['date_shipped'] ),\n\t\t\t);\n\n\t\t\t$tracking_item = $this->add_tracking_item( $order_id, $args );\n\n\t\t\t$this->display_html_tracking_item_for_meta_box( $order_id, $tracking_item );\n\t\t}\n\n\t\tdie();\n\t}", "protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }", "protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }", "protected function _save_question( $question ) {\n\n\t\tif ( ! empty( $this->_visited[ $question['id'] ] ) ) {\n\t\t\t//this means the question has already been visited from another branch\n\t\t\t//and we dont need to save it again\n\t\t\treturn $this->_visited[ $question['id'] ];\n\t\t}\n\n\t\t$answers = $question['answers'];\n\t\t$current_id = $question['id'];\n\t\tunset( $question['answers'], $question['id'] );\n\t\t$question['quiz_id'] = $this->_quiz_id;\n\n\t\t/**\n\t\t * import question image before saving it\n\t\t */\n\t\tif ( ! empty( $question['image'] ) ) {\n\t\t\t$question['image'] = $this->_import_file( $question['image'] );\n\t\t}\n\n\t\t/**\n\t\t * if we have to import a media file for the new question\n\t\t */\n\t\tif ( $this->_get_question_source( $question ) === 'custom' && ! empty( $question['display_settings']['url'] ) ) {\n\t\t\t$media = $this->_import_file(\n\t\t\t\tarray(\n\t\t\t\t\t'filename' => basename( $question['display_settings']['url'] ),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$question['display_settings']['url'] = ! empty( $media['url'] ) ? $media['url'] : $question['display_settings']['url'];\n\t\t}\n\n\t\t$this->manager->save_question( $question );\n\n\t\t$new_id = $question['id'];\n\n\t\t$this->_visited[ $current_id ] = $new_id;\n\n\t\t/**\n\t\t * save answers to newly added question\n\t\t */\n\t\t$this->_save_answers( $answers, $new_id );\n\n\t\t/**\n\t\t * If the question has a next question id\n\t\t * then save that question and get its id to be saved on current question\n\t\t */\n\t\tif ( $question['next_question_id'] ) {\n\t\t\t$next_question = $this->_stack[ $question['next_question_id'] ];\n\t\t\t$next_question['previous_question_id'] = $new_id;\n\t\t\t/**\n\t\t\t * Updates the current question with the new next question id\n\t\t\t */\n\t\t\t$question['next_question_id'] = $this->_save_question( $next_question );\n\t\t\t$this->manager->save_question( $question );\n\t\t}\n\n\t\treturn $new_id;\n\t}", "public function saveToDb() {\n parent::saveToDb();\n\n require_once 'models/Location.php';\n Location::saveToDb($this->preferredLocation);\n Location::saveToDb($this->currentLocation);\n\n require_once 'libs/DB.php';\n $conn = DB::connect();\n\n $seekerId = $this->id();\n\n // Update the seeker table\n $conn->exec(\"UPDATE seeker SET experience='$this->experience', pref_location_name='$this->preferredLocation', curr_location_name='$this->currentLocation' WHERE id='$seekerId'\");\n\n require_once 'models/Skill.php';\n foreach($this->skills as $skill) {\n Skill::saveToDb($skill);\n }\n\n // Delete old skills\n $conn->exec(\"DELETE FROM seeker_skill WHERE seeker_id='$seekerId'\");\n\n // Add new skills\n foreach($this->skills as $skill) {\n $conn->exec(\"INSERT INTO seeker_skill(seeker_id, skill_name) VALUES('$seekerId', '$skill')\");\n }\n }", "function education_information_meta_box_save( $post_id ) {\n\n\t// Verify if this is an auto save routine.\n\t// If it is our form has not been submitted, so we don't want to do anything\n\tif ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )\n\t\treturn;\n\n\t// Verify this comes from the our screen and with proper authorization\n\t// Because save_post can be triggered at other times\n\tif ( ( isset( $_POST['education_information_nonce'] ) ) &&\n\t( ! wp_verify_nonce( $_POST['education_information_nonce'], plugin_basename(__FILE__) ) ) )\n\t\treturn;\n\n\t// Check permissions\n\tif ( ( isset( $_POST['post_type'] ) ) && ( 'page' == $_POST['post_type'] ) ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// OK, we're authenticated: we need to find and save the data\n\tif ( isset( $_POST['institute_location'] ) ) {\n\t\t// P1: post id\n\t\t// P2: key\n\t\t// P3: value\n\t\tupdate_post_meta( $post_id, 'institute_location', $_POST['institute_location'] );\n\t}\n\n\tif ( isset( $_POST['degree_type'] ) ) {\n\t\tupdate_post_meta( $post_id, 'degree_type', $_POST['degree_type'] );\n\t}\n\n\tif ( isset( $_POST['graduation_date'] ) ) {\n\t\tupdate_post_meta( $post_id, 'graduation_date', $_POST['graduation_date'] );\n\t}\n\n\tif ( isset( $_POST['education_description'] ) ) {\n\t\tupdate_post_meta( $post_id, 'education_description', $_POST['education_description'] );\n\t}\n}", "function saveInfo(){\n mysql_query(\"UPDATE resolution SET text='$this->text' WHERE id='$this->clauseId'\") or die(mysql_error());\n mysql_query(\"UPDATE resolution SET nextId='$this->nextId' WHERE id='$this->clauseId'\") or die(mysql_error());\n if($this->subClause==array()){\n mysql_query(\"UPDATE resolution SET subId='0' WHERE id='$this->clauseId'\") or die(mysql_error());\n }else{\n $subId=$this->subClause[0]->clauseId;\n mysql_query(\"UPDATE resolution SET subId='$subId' WHERE id='$this->clauseId'\") or die(mysql_error());\n foreach($this->subClause as $subClause){\n $subClause->saveInfo();\n }\n }\n }", "public function save()\r\n {\r\n if($this->id != -1)\r\n {\r\n $this->update_target_grade();\r\n }\r\n else\r\n {\r\n $this->insert_target_grade();\r\n }\r\n }", "function erg_answers_save( $post_id ) {\n\tif ( ! isset( $_POST['erg_answers_metabox_nonce'] ) ) {\n\t\treturn;\n\t}\n\n\t// Verify that the nonce is valid.\n\tif ( ! wp_verify_nonce( $_POST['erg_answers_metabox_nonce'], 'erg_answers_metabox' ) ) {\n\t\treturn;\n\t}\n\n\t// If this is an autosave, our form has not been submitted, so we don't want to do anything.\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n\t\treturn;\n\t}\n\n\t/* OK, it's safe for us to save the data now. */\n\t\n\t// Make sure that it is set.\n\tif ( ! isset( $_POST['erg_answers'] ) || ! is_array( $_POST['erg_answers'] ) ) {\n\t\treturn;\n\t}\n\n\t$answers = array_filter($_POST['erg_answers'], function ($x) {\n\t\tif ( !is_array($x) )\n\t\t\treturn false;\n\t\tif ( empty($x['value']) || empty($x['label']) )\n\t\t\treturn false;\n\t\treturn true;\n\t});\n\n\t// Update the meta field in the database.\n\tadd_post_meta( $post_id, '_erg_answers', $answers, true );\n}", "function italystrap_meta_box_save( $post_id ){\n\tif( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n\t\n\t// if our nonce isn't there, or we can't verify it, bail\n\tif( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;\n\t\n\t// if our current user can't edit this post, bail\n\t//http://code.tutsplus.com/tutorials/how-to-create-custom-wordpress-writemeta-boxes--wp-20336#comment-802227555\n\t//prevents undefined offset notice and cannot modify header warning - add second parameters $post_id\n\tif( !current_user_can( 'edit_post' , $post_id ) ) return;\n\t\n\t// now we can actually save the data\t\n\t// Probably a good idea to make sure your data is set\n\t// This is purely my personal preference for saving checkboxes\n\t$chk = ( isset( $_POST['slide'] ) && $_POST['slide'] ) ? 'on' : 'off';\n\tupdate_post_meta( $post_id, 'slide', $chk );\n}", "function idem_pop_up_save_post( $post_id )\n{\n //On sauve la valeur, ou par defaut si deselect\n if( isset( $_POST[\"idem_pop_up_selected\"] ) )\n update_post_meta( $post_id, 'idem_pop_up_selected', $_POST[\"idem_pop_up_selected\"] );\n else {\n $default = getDefault();\n update_post_meta( $post_id, 'idem_pop_up_selected', $default );\n }\n\n //On sauve le template, ou par defaut si aucun\n if( isset( $_POST[\"idem_pop_up_template\"] ) )\n update_post_meta( $post_id, 'idem_pop_up_template', $_POST[\"idem_pop_up_template\"] );\n else {\n update_post_meta( $post_id, 'idem_pop_up_template', 'default' );\n }\n\n //On sauve le mode de fonctionnement\n if( isset( $_POST[\"idem_pop_up_action\"] ) )\n update_post_meta( $post_id, 'idem_pop_up_action', $_POST[\"idem_pop_up_action\"] );\n else {\n update_post_meta( $post_id, 'idem_pop_up_action', 'auto' );\n }\n\n //On sauve l'action caller du mode manuel\n if( isset( $_POST[\"idem_pop_up_action_caller\"] ) )\n update_post_meta( $post_id, 'idem_pop_up_action_caller', $_POST[\"idem_pop_up_action_caller\"] );\n else {\n update_post_meta( $post_id, 'idem_pop_up_action_caller', '' );\n }\n\n //On active ou desactive la pop up suivant la checkbox\n if( isset( $_POST[\"activate_idem_pop_up\"] ) )\n update_post_meta( $post_id, 'activate_idem_pop_up', 1 );\n else \n update_post_meta( $post_id, 'activate_idem_pop_up', 0 );\n}", "public function save()\n {\n $_SESSION['quiz'][$this->_testId] = serialize($this->_answers);\n }", "public function saveEditedElementData($inputData) {\n\t\t\tif($this->checkAllowedElementType($inputData) == false) {\n\t\t\t\t\tthrow new wrongElementTypeAdminException(getLabel(\"error-unexpected-element-type\"));\n\t\t\t}\n\n\t\t\t/* @var iUmiHierarchyElement|umiEntinty $element*/\n\t\t\t$element = getArrayKey($inputData, \"element\");\n\t\t\t$oUsersMdl = cmsController::getInstance()->getModule(\"users\");\n\t\t\t$event = new umiEventPoint(\"systemModifyElement\");\n\t\t\t$event->addRef(\"element\", $element);\n\t\t\t$event->addRef(\"inputData\", $inputData);\n\t\t\t$event->setParam(\"user_id\", $oUsersMdl->user_id);\n\t\t\t$event->setMode(\"before\");\n\t\t\t$event->call();\n\n\t\t\tif($element instanceof umiHierarchyElement === false) {\n\t\t\t\tthrow new expectElementException(getLabel(\"error-expect-element\"));\n\t\t\t}\n\n\t\t\t$this->checkDomainPermissions($element->getDomainId());\n\t\t\t$this->checkElementPermissions($element->getId());\n\n\t\t\t$module_name = $element->getModule();\n\t\t\t$method_name = $element->getMethod();\n\n\t\t\tif(!is_null(getRequest('alt-name'))) {\n\t\t\t\t$alt_name = strlen(getRequest('alt-name')) ? getRequest('alt-name') : getRequest('name');\n\t\t\t\t$element->setAltName($alt_name);\n\t\t\t}\n\n\t\t\tif(!is_null($is_active = getRequest('active'))) {\n\t\t\t\t$permissions = permissionsCollection::getInstance();\n\t\t\t\t$user_id = $permissions->getUserId();\n\t\t\t\tif($permissions->isAllowedMethod($user_id, $module_name, \"publish\") != false) {\n\t\t\t\t\t$element->setIsActive($is_active);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!is_null($is_visible = getRequest('is-visible'))) {\n\t\t\t\t$element->setIsVisible($is_visible);\n\t\t\t}\n\n\t\t\tif(!is_null($is_default = getRequest('is-default'))) {\n\t\t\t\t$element->setIsDefault($is_default);\n\t\t\t}\n\n\t\t\tif(!is_null($tpl_id = getRequest('template-id'))) {\n\t\t\t\t$element->setTplId($tpl_id);\n\t\t\t}\n\n\t\t\t$users = cmsController::getInstance()->getModule('users');\n\t\t\tif($users instanceof users) {\n\t\t\t\t$users->setPerms($element->getId());\n\t\t\t}\n\n\t\t\tbackupModel::getInstance()->save($element->getId());\n\n\t\t\t$object = $element->getObject();\n\n\t\t\tif ($object instanceof umiObject) {\n\t\t\t\t$this->saveEditedObjectData($object);\n\t\t\t}\n\n\t\t\t$objectUpdateTime = $object->getUpdateTime();\n\n\t\t\tif ($objectUpdateTime > $element->getUpdateTime()) {\n\t\t\t\t$element->setUpdateTime($objectUpdateTime);\n\t\t\t}\n\n\t\t\t$element->commit();\n\n\t\t\t$this->currentEditedElementId = $element->getId();\n\n\t\t\t$event->setMode(\"after\");\n\t\t\t$event->call();\n\n\t\t\treturn $element;\n\t\t}", "function saveToSession() {\n\t\t// Unset sessions since this info is elsewhere in the database\n\t\tunset($this->_questions);\n\t\ttx_wecassessment_sessiondata::storeSessionData($this, $this->getPID());\n\t}", "function handleStoreRelatedPerson(EventContext $context)\n {\n $related_person = $this->storeRelatedPerson();\n\n if ($related_person->getId() == NULL)\n {\n $program_item = $_SESSION['current_program_item'];\n if (isset($program_item))\n {\n $program_item->addRelatedPerson($related_person);\n }\n }\n else\n {\n $program_item = $_SESSION['current_program_item'];\n if (isset($program_item))\n {\n $program_item->replaceRelatedPerson($related_person);\n }\n }\n\n $context->setForward(dirname(__FILE__) . \"/program_item_editor.php\");\n }", "public function event()\r\n {\r\n\r\n\r\n if ($this->_config['changeSubmit']) {\r\n\r\n $changeSubmitId = $this->_config['changeSubmitId'];\r\n\r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change paste keyup cut select');\r\n\r\n $this->_event['change paste keyup cut select'] = $eventOld . \"\r\n console.log('changeSubmit: ' + event.target.id);\r\n $($changeSubmitId).submit();\r\n \";\r\n }\r\n\r\n\r\n if ($this->_config['changeSave']) {\r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change paste keyup cut select');\r\n // $eventOld = ZArrayHelper::getValue($this->_event, 'change');\r\n\r\n /**\r\n *\r\n * Get Attributes\r\n *\r\n */\r\n $id = ZArrayHelper::getValue($this->model, 'id');\r\n\r\n $allApp = $this->modelMain->allApp();\r\n // vd($allApp );\r\n if (!empty($allApp->parentAttr))\r\n $attribute = \"$allApp->parentAttr-$this->attribute\";\r\n else\r\n $attribute = $this->attribute;\r\n\r\n /**\r\n *\r\n * Parent Class\r\n */\r\n\r\n $parentClass = bname($allApp->parentClass);\r\n\r\n if (!empty($allApp->parentClass))\r\n $modelClass = $parentClass;\r\n else\r\n $modelClass = $this->modelClassName;\r\n\r\n\r\n /**\r\n *\r\n * ID Attribute\r\n */\r\n $valueKey = strtolower(\"$modelClass-$attribute\");\r\n // vd($valueKey);\r\n\r\n $changeSave = <<<JS\r\n \r\n //start|DavlatovRavshan|2020.10.12\r\n function isFunctionDefined(functionName) {\r\n if (eval(\"typeof(\" + functionName + \") == typeof(Function)\")) {\r\n return true;\r\n }\r\n }\r\n \r\n var value = $('#$valueKey').val(); \r\n \r\n console.log('changeSave ID: $valueKey');\r\n console.log('changeSave Value: ' + value);\r\n // var url = '/api/core/save/auto.aspx';\r\n var url = '/api/core/save/auto.aspx';\r\n \r\n if (xhr !== undefined) {\r\n console.log('Abort XHR: ' + xhr);\r\n xhr.abort()\r\n }\r\n \r\n var xhr = $.ajax({\r\n \r\n url: url, \r\n type: 'POST', \r\n data: { \r\n id: '$id', \r\n value: value, \r\n attr: '$this->attribute', \r\n parentAttr: '{$allApp->parentAttr}', \r\n parentClass: '{$parentClass}', \r\n parentId: '{$allApp->parentId}', \r\n modelClassName: '$this->modelClassName', \r\n }, \r\n \r\n success: function (data, status, xhr) {\r\n \r\n console.log('Change success! Value: ' + value);\r\n console.log('Data: ', data);\r\n \r\n {sendAjax}\r\n },\r\n \r\n error: function (jqXhr, textStatus, errorMessage) {\r\n console.error(jqXhr);\r\n console.error('message: ---' + errorMessage);\r\n console.error('text-status: ---' + textStatus);\r\n }\r\n });\r\n \r\nJS;\r\n\r\n//start|DavlatovRavshan|2020.10.11\r\n\r\n $sendAjax = '';\r\n if (!empty($this->form)) {\r\n\r\n//vd($this->_config['changeReloadPjax']);\r\n\r\n switch ($this->modelConfigs->changeReloadPjax) {\r\n case ALLData::changeReloadType['ajax']:\r\n $sendAjax = <<<JS\r\n if (event.type === 'change' && isFunctionDefined('sendAjax')) {\r\n \r\n console.log('sendAjax | ' + event.target.id);\r\n sendAjax()\r\n }\r\nJS;\r\n\r\n break;\r\n case ALLData::changeReloadType['pjax']:\r\n $sendAjax = <<<JS\r\n if (event.type === 'change' && isFunctionDefined('sendPjax')) {\r\n console.log('sendPjax | ' + event.target.id);\r\n sendPjax()\r\n }\r\nJS;\r\n\r\n break;\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n $this->_event['change paste keyup cut select'] = $eventOld . strtr($changeSave, [\r\n // $this->_event['change'] = $eventOld . strtr($changeSave, [\r\n '{sendAjax}' => $sendAjax\r\n ]);\r\n\r\n $this->_event['switchChange.bootstrapSwitch'] = $eventOld . strtr($changeSave, [\r\n // $this->_event['change'] = $eventOld . strtr($changeSave, [\r\n '{sendAjax}' => $sendAjax\r\n ]);\r\n }\r\n\r\n if ($this->_config['changeReload']) {\r\n\r\n $changeReloadId = $this->modelConfigs->changeReloadId;\r\n\r\n vd($this->model->className(), $changeReloadId);\r\n\r\n \r\n $eventOld = ZArrayHelper::getValue($this->_event, 'change');\r\n\r\n\r\n if (!empty($changeReloadId))\r\n {\r\n\r\n // vd($changeReloadId);\r\n \r\n $this->_event['change'] = $eventOld . \"\r\n\r\n console.log('changeReload from: ' + event.target.id);\r\n\r\n $.pjax.reload({\r\n container: '#{$changeReloadId}',\r\n async: true,\r\n timeout: false\r\n });\r\n \";\r\n }\r\n\r\n }\r\n\r\n if ($this->_config['enableEvent']) {\r\n\r\n $eventItem = $this->eventsOn($this->_event);\r\n\r\n\r\n // vd( $eventItem);\r\n $this->js .= strtr($this->_layout['eventMain'], [\r\n '{id}' => $this->id,\r\n '{eventItem}' => $eventItem,\r\n ]);\r\n\r\n /*\r\n if ($this::className() === ZFormWidget::class)\r\n vd($this->js);*/\r\n }\r\n\r\n }", "function formulize_save_postdata($post_id) {\n\t//verify if this is an auto save routine \n\t//If our form hasn't been submitted we don't want to do anything\n\t if (defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n\n // if our nonce isn't there, or we can't verify it, bail \n if (!isset($_POST['formulize_nonce']) \n \t|| !wp_verify_nonce($_POST['formulize_nonce'], 'my_formulize_nonce' )) return; \n \n // now we can actually save the data \n $allowed = array( \n 'a' => array( // on allow a tags \n 'href' => array() // and those anchors can only have href attribute \n ) \n ); \n \n if (isset( $_POST['formulize_select'])) \n update_post_meta($post_id, 'formulize_select', esc_attr( $_POST['formulize_select'])); \n}", "public function save()\n\t{\n\t\tglobal $ilDB;\n\n\t\t// sequence\n\t\t$this->setId($ilDB->nextId(\"adn_ep_assignment\"));\n \t$id = $this->getId();\n\n\t\t$fields = $this->propertiesToFields();\n\t\t$fields[\"id\"] = array(\"integer\", $id);\n\t\t\t\n\t\t$ilDB->insert(\"adn_ep_assignment\", $fields);\n\n\t\tparent::save($id, \"adn_ep_assignment\");\n\n\t\treturn $id;\n\t}", "public function save()\n {\n $this->data = $this->toArray();\n if (empty($this->id)) {\n unset($this->data[self::ID]);\n $this->insert();\n } else {\n $this->update();\n }\n try {\n $this->query->execute($this->data);\n\n if ($this->pdo->lastInsertId()) {\n $this->id = $this->pdo->lastInsertId();\n }\n\n return ($this->pdo->lastInsertId() != null) ? (int)$this->pdo->lastInsertId() : null;\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "function recordVote()\n{\n\n //add voter and vote to database\n\n //mark voter as voted\n\n}", "public function adsaveAction() {\n\t// Received Parameter from JS file.\n\t$adCancelReasion = (string) $this->_getParam('adCancelReasion');\n\t$adsId = (string) $this->_getParam('adsId');\n\t// Decode a ad id\n\t$adsId = Engine_Api::_()->communityad()->getEncodeToDecode($adsId);\n\t$adDescription = (string) $this->_getParam('adDescription');\n\t//Insert entry in the data base.\n\t$viewerId = Engine_Api::_()->user()->getViewer()->getIdentity();\n\t$adcancelTable = Engine_Api::_()->getItemTable('communityad_adcancel');\n\t$adcancelList = $adcancelTable->createRow();\n\t$adcancelList->user_id = $viewerId;\n\t$adcancelList->report_type = $adCancelReasion;\n\tif (!empty($adDescription)) {\n\t $adcancelList->report_description = $adDescription;\n\t}\n\t$adcancelList->ad_id = $adsId;\n\t$adcancelList->save();\n\t$this->view->showMsg = 1;\n }", "public function save(): bool\n {\n $data = [\n 'date' => $this->getDate(),\n 'type' => $this->getType(),\n 'recorded' => $this->getRecorded(),\n 'route' => $this->getRoute(),\n 'place' => $this->getPlace(),\n 'mileage' => $this->getMileage(),\n 'place_manual' => $this->getPlaceManual(),\n 'description' => $this->getDescription()\n ];\n if ($this->getId()) {\n if ((new db\\Update('event', $data, $this->getId()))->run() !== false) {\n return true;\n }\n } else {\n if ($newId = (new db\\Insert('event', $data))->run()) {\n $this->setId($newId);\n return true;\n }\n }\n return false;\n }", "private function save_interests(){\r\n $db = new Database();\r\n $sql = \"delete from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n\r\n foreach($this->interests as $interest){\r\n $sql = \"insert into \" . Person::PERSON_INTEREST_TABLE . \" (person_id, interest_id) values (:person_id, :interest_id)\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->bindParam(':interest_id', $interest->id);\r\n $stm->execute();\r\n }\r\n $pi_stm = \"\";\r\n }", "public function saveAction()\n {\n //the data for the thing\n $_consumerId = $this->getRequest()->getParam('consumer_id');\n \n //the post data\n $_data = $this->getRequest()->getPost();\n if ($_data) {\n $_artist = $this->_initConsumerSave();\n \n try {\n $_artist->save();\n \n $_redirectBack = false;\n $this->_getSession()->addSuccess($this->__('The consumer has been saved.'));\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage())\n ->setArtistData($_data);\n $_redirectBack = true;\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()->addError($e->getMessage());\n $_redirectBack = true;\n }\n }\n \n if ($_redirectBack) {\n $this->_redirect(\n '*/*/edit', array(\n 'id' => $_consumerId,\n '_current' => true\n )\n );\n } else {\n $this->_redirect('*/*/');\n }\n }", "function action_add() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['add_id'];\n\t\t\t$table = $data['add_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\t$choosen[$table][$id] = $id;\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function save($id, $duration) {\n\t\t$this->_results[] = array($id, $duration);\n\t}", "protected function saveStepPointer()\n {\n if (!$this->listingID) {\n return;\n }\n\n $update = array(\n 'fields' => array('Last_step' => $this->step),\n 'where' => array('ID' => $this->listingID),\n );\n $GLOBALS['rlDb']->update($update, 'listings');\n }", "function dialogue_add_instance($dialogue) {\n global $DB;\n\n $dialogue->timemodified = time();\n\n return $DB->insert_record('dialogue', $dialogue);\n}", "public function saveAttribute()\n {\n $this->getFormPageActionsBlock()->save();\n }", "public function save_widget() {\n\t\t$this->get_cache();\n\t\t$this->get_db_values();\n\t\tif ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST[ $this->unique() ] ) ) {\n\t\t\t$this->get_db_values();\n\t\t\t$this->get_cache();\n\t\t\t$instance = new Save_Handler( array(\n\t\t\t\t'module' => &$this,\n\t\t\t\t'unique' => $this->unique(),\n\t\t\t\t'fields' => $this->fields(),\n\t\t\t\t'db_values' => $this->get_db_values(),\n\t\t\t) );\n\t\t\t$instance->run();\n\n\t\t\t$this->options_cache['field_errors'] = $instance->get_errors();\n\t\t\t$this->set_db_cache( $this->options_cache );\n\t\t\t$this->set_db_values( $instance->get_values() );\n\t\t\tif ( ! empty( $instance->get_errors() ) ) {\n\t\t\t\twp_redirect( add_query_arg( 'wponion-save', 'error' ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->init_theme()->render();\n\t\t}\n\t}", "public function onSaveSuccess($type, $id) {\nglobal $_LW;\nif (!isset($_LW->ENV->editors[$_LW->page])) {\n\t// if not saving from the editor, this is coming from the ->update() API and these steps can be skipped\n\treturn false;\n}\nif ($type=='events' && ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit')) { // if saving an event from the editor\n\t$_LW->setCustomFields($type, $id, ['sample_textarea'=>@$_LW->_POST['sample_textarea']], []); // store the value entered for sample_textarea, allowing the sample_textarea field full visibility (on details pages, in widget results, and /live/* requests such as /live/json)\n\t/*\n\tNote:\n \tTo optionally hide the field (i.e. store it in the database but not expose it to the public on the frontend web site or API requests, add \"sample_textarea\" to the empty array above, registering it as a hidden field).\n\tNon-hidden fields may be added to a details template via <xphp var=\"details_custom_sample_textarea\"/> or to a widget format arg via {custom_sample_textarea}.\n\t*/\n\t$_LW->setCustomFields($type, $id, ['sample_text'=>@$_LW->_POST['sample_text']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_select'=>@$_LW->_POST['sample_select']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_checkbox'=>@$_LW->_POST['sample_checkbox']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_radio'=>@$_LW->_POST['sample_radio']], []); // store the value\n};\n}", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();" ]
[ "0.527578", "0.5078858", "0.50737625", "0.50131184", "0.49910444", "0.49553353", "0.49524158", "0.491659", "0.48778728", "0.48703498", "0.48508808", "0.48382857", "0.48338446", "0.48212272", "0.48145598", "0.48132876", "0.48061946", "0.47945273", "0.47937885", "0.47786736", "0.47721326", "0.47698212", "0.47580022", "0.47461343", "0.47411352", "0.4727815", "0.47251284", "0.46995333", "0.46878535", "0.46650642", "0.46623716", "0.4660828", "0.4660458", "0.4651647", "0.4650588", "0.46420372", "0.46300048", "0.46227217", "0.4619336", "0.46120405", "0.4610654", "0.4608884", "0.4607966", "0.46069872", "0.45913723", "0.4589597", "0.45887294", "0.4588397", "0.45861045", "0.45860142", "0.4581978", "0.4576379", "0.4575647", "0.45755213", "0.45720813", "0.45656982", "0.4562871", "0.4552748", "0.4552748", "0.4552662", "0.4543833", "0.45426315", "0.4541455", "0.45356673", "0.45353723", "0.4526433", "0.45246878", "0.45237598", "0.45218045", "0.45217568", "0.45182067", "0.45088893", "0.45052558", "0.4502204", "0.450183", "0.44838318", "0.44739866", "0.44734618", "0.4466759", "0.44642776", "0.44615954", "0.44532833", "0.44531238", "0.44524238", "0.44483012", "0.44474387", "0.44474223", "0.44425422", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007", "0.44405007" ]
0.6531297
0
Permet de construire le tableau associatif permettant de charger les models via la fonction Model.fill(array $data)
private function setStepValue(int $index, AliasedQueryField $field, array &$data, $value) { $finalStep = ($index == count($field->path)); if($finalStep) { $data[$field->aliasedField->field->name] = $this->getSqlValueForModel($field->aliasedField->field, $value); } else { $step = $field->path[$index]; if(!array_key_exists($step, $data)) { $data[$step] = array(); } $this::setStepValue($index + 1, $field, $data[$step], $value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final function __fromArray($data)\n {\n foreach ($data as $k => $v)\n {\n if ($k!=self::CLASS_FIELD_KEY)\n {\n //codice pronto da usare per la trasformazione degli oggetti in cascata.\n /* \n //associazione tramite chiave esterna\n if (ActiveRecord::isValidArrayDO($v))\n {\n $this->{$k} = ActiveRecord::fromArray($v);\n }\n else\n if (is_array($v)) //associazione tramite tabella esterna\n {\n $result = array();\n foreach ($v as $nes_key => $nes_value)\n {\n $result[] = ActiveRecord::fromArray($nes_value);\n }\n $this->{$k} = $result;\n }\n else*/\n $this->{$k} = $v;\n }\n }\n }", "public function __construct(Model $data)\n {\n //过滤掉数据库没有的列,避免报错\n $columns = $data->getColumns();\n $data->beforeSave($data);\n foreach ($data->getAttributes() as $key => $val) {\n if (!in_array($key, $columns)) {\n $data->setTmpSave($key, $data->$key);\n unset($data->$key);\n }\n }\n }", "protected function createModelInstance(array $data) {\n\n $this->entity = $this->model_instance ?? new $this->model_class();\n\n foreach($this->fields as $field) {\n\n $this->entity->$field = $data[$field];\n\n }\n\n if(!empty($this->object_name)) {\n $obj_name = $this->object_name;\n $this->$obj_name = $this->entity;\n }\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function populate($data = array())\n {\n $this->id = $data['id'];\n $this->name = $data['name'];\n $this->dated_at = isset($data['dated_at']) ? new \\DateTime($data['dated_at']) : null;\n $this->year = $data['year'];\n $this->weekday = $data['weekday'];\n $this->type = $data['type'];\n $this->constant = (bool) $data['constant'];\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "private function populateDummyTable() {}", "protected function fromDatabase( $data )\n\t{\n\t\tforeach ( $data AS $field => $value ) \n\t\t{\t\n\t\t\tif ( isset( static::$schema[ $field ] ) )\n\t\t\t{\n\t\t\t\tif ( is_array( static::$schema[ $field ] ) )\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ][ 'type' ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$type = static::$schema[ $field ];\n\t\t\t\t}\n\t\n\t\t\t\t$this->data[ $field ] = $this->sanitize( $type, $value );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->loaded = true;\n\t}", "public function createByArray($data) \n\t{\n\t\tif (empty($data)) {\n\t\t\treturn false;\n\t\t}\n\n\t include('./models/fichas_model.php');\n\t\t$model = new Fichas_Model;\n\t\t$model->create($data);\n\n\t\tunset($model);\n\t}", "private function __construct($table, $data = array()) {\n $temp = array_merge(array('data' => array()), $data);\n\n $this->set_table_name($table);\n $this->load_columns_information();\n $this->new_register = true;\n\n\n // Carrega os dados iniciais, caso $temp['data'] esteja definido\n if(sizeof($temp['data']) > 0)\n $this->load_data($temp['data']);\n }", "public function initialize()\n {\n $this->belongsTo(\n 'companies_id',\n Companies::class,\n 'id',\n ['alias' => 'company']\n );\n\n $this->belongsTo(\n 'apps_id',\n Apps::class,\n 'id',\n ['alias' => 'app']\n );\n\n $this->belongsTo(\n 'users_id',\n Users::class,\n 'id',\n ['alias' => 'user']\n );\n\n $this->setSource('users_associated_apps');\n }", "public function createOrUpdate(array $data, $model=null);", "protected function newModel($data)\n{\n\t$className = Model::className($this->query['from']);\n\t$model = new $className($this->query['from']);\n\n\tif (!$this->cachedTemplate) {\n\t\t$this->cachedTemplate = $model->getTemplate();\n\t}\n\n\t$model->setTemplate($this->cachedTemplate);\n\n\tif ($data) {\n\t\t$model->setValues($data);\n\t\t$model->isInDb(true);\n\t}\n\n\treturn $model;\n}", "public function fill($data);", "protected function tinydb_create($data)\n {\n $values = array();\n foreach (static::tinydb_get_table_info()->table_info() as $field => $info) {\n if (isset($data[$field])) {\n if ($this->tinydb_getset_is_method(\"create_$field\", true)) {\n $method_name = \"create_$field\";\n $values[$field] = $this->$method_name($data[$field]);\n } else {\n $values[$field] = $data[$field];\n }\n } else if ($field === 'created_at' || $field === 'modified_at') {\n $values[$field] = time();\n } else if (!$info->nullable && !$info->auto_increment && !isset($info->default)) {\n throw new \\InvalidArgumentException($field . ' is required when creating this object.');\n }\n\n // If a value was set, encode it properly\n if (isset($values[$field])) {\n $values[$field] = \\TinyDb\\Internal\\SqlDataAdapters::encode($info->type, $values[$field]);\n }\n }\n\n $id = \\TinyDb\\Query::create()->insert()->into(static::$table_name, array_keys($values))->values(array_values($values))->exec();\n\n // If the primary key is composite, generate the primary key\n if (is_array(static::tinydb_get_table_info()->primary_key)) {\n $id = array();\n foreach (static::tinydb_get_table_info()->primary_key as $field) {\n $id[$field] = $data[$field];\n }\n // If the primary key was provided, use that\n } else if (isset($values[static::tinydb_get_table_info()->primary_key])) {\n $id = $values[static::tinydb_get_table_info()->primary_key];\n }\n\n $query = \\TinyDb\\Query::create()->select('*')->from(static::$table_name);\n $query = static::tinydb_add_where_for_pkey($id, $query);\n $rows = $query->exec();\n $this->tinydb_datafill($rows[0]);\n }", "public static function fill($data=[])\n {\n if(!empty($data)){\n foreach ($data as $item){\n self::add($item);\n }\n }\n\n }", "public function __construct(Model $data)\n {\n parent::__construct($data);\n\n $metas = $data->hasMany('Andriynto\\Ebri\\Models\\UserMeta')->getResults();\n\n if ( ! $metas->isEmpty()) {\n $metas = $metas->toArray();\n\n foreach ($metas as $item) {\n $this->setAttribute($item['key'], $item['value']);\n }\n\n unset($metas);\n }\n\n unset($metas);\n }", "public function assign(array $data, $whiteList = null, $dataColumnMap = null): ModelInterface;", "public function populate(array $data);", "public function populate($data = array())\n {\n $this->id = $data['id'];\n $this->nome = $data['nome'];\n $date = new \\DateTime(\"now America/Sao_Paulo\");\n $this->data_cadastro = $date;\n $this->data_alteracao = $data['data_alteracao'];\n \n }", "public function initialize()\n {\n $this->belongsTo(\n 'users_id',\n Users::class,\n 'id',\n ['alias' => 'user']\n );\n\n $this->belongsTo(\n 'companies_id',\n Companies::class,\n 'id',\n ['alias' => 'company']\n );\n\n $this->setSource('users_associated_company');\n }", "public function createData($data){\n return $resultSet = $this->model->create($data);\n }", "public function initialize()\n {\n \t$this->belongsTo('id_usuario', 'IbcUsuario', 'id_usuario', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_periodo', 'CobPeriodo', 'id_periodo', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_contrato', 'CobActaconteo', 'id_contrato', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_ajuste_reportado', 'CobAjusteReportado', 'id_ajuste_reportado', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_actaconteo_persona_facturacion', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona_facturacion', array(\n \t\t\t'reusable' => true\n \t));\n }", "public function bulkCreate($data)\n {\n $this->model::insert($data);\n }", "public function fill_db()\n {\n include('create_tables.php');\n\n $this->db->query($CLEAN);\n $this->db->query($APPTYPE);\n $this->db->query($BOOKINGS);\n $this->db->query($BUSINESSOWNER);\n $this->db->query($CUSTOMERS);\n $this->db->query($EMPLOYEES);\n $this->db->query($TIMESLOTS);\n $this->db->query($CANWORK);\n $this->db->query($HAVESKILL);\n $this->db->query($BUSINESS);\n $this->db->query($HOURS);\n }", "public function fillOutDb()\n {\n /* Fill out the Contacts table. BatchInsert is a good idea for that */\n $this->batchInsert('Contacts', ['name', 'surname', 'description'], self::InitialContacts);\n\n /* Prepare array for batchInsert request at first */\n $list = [];\n foreach(self::InitialPhoneNumbers as $name => $numbers){\n $query = new \\yii\\db\\Query();\n $contact_id = $query->select('id')->from('Contacts')->where(['name' => $name])->one();\n foreach($numbers as $number){\n $list[] = ['number' => $number, 'contact_id' => $contact_id['id']];\n }\n }\n\n /* Fill out the Numbers table */\n $this->batchInsert('Numbers', ['number', 'contact_id'], $list);\n }", "public function FillTable(){\n\n $helpers = Helper::all();\n\n foreach ($helpers as $key=>$helper){\n\n $helper->update(['id'=>$key+1]);\n }\n }", "protected function fillTable()\n {\n $names = [\n 'Anna', 'Betty', 'Clara', 'Donna', 'Fiona',\n 'Gertrude', 'Hanna', 'Ione', 'Julia', 'Kara',\n ];\n\n $stm = \"INSERT INTO {$this->table} (name) VALUES (:name)\";\n foreach ($names as $name) {\n $this->connection->perform($stm, ['name' => $name]);\n }\n }", "public function __construct(Model $data)\n {\n $schemas = $data->getSchemas();\n if ($data->getTmpSave()) {\n foreach ($data->getTmpSave() as $key => $val) {\n $this->doRelateSave($key, $schemas, $val, $data);\n }\n }\n\n $data->afterSave($data);\n }", "private function fillEntity(array $data)\n {\n $this->entity->setData($data);\n }", "public function __construct($data)\n {\n foreach ($this->attributes as $attribute) {\n $this->data[$attribute] = (array_key_exists($attribute, $data)) ? $data[$attribute] : NULL;\n }\n }", "private function tinydb_datafill($data)\n {\n // Fix up access information\n $this->tinydb_access_manager = new \\TinyDb\\Internal\\AccessManager($this->tinydb_get_reflector());\n foreach (static::tinydb_get_table_info()->table_info() as $name => $field) {\n unset($this->$name);\n }\n\n // Set the information from the database\n $this->tinydb_rowdata = $data;\n }", "public static function buildObject($table, $data)\n {\n $objectClass = $table->getPersistClassName();\n $object = new $objectClass;\n $errors = array();\n foreach($table->getFields() as $field) {\n $name = $field->getName();\n if (!isset($data[$name])) {\n $data[$name] = null;\n }\n $postfix = '';\n foreach($table->getBinds() as $bind) {\n if($bind->getLeftField() === $field->getName()){\n $postfix = $bind->getLeftField() === $field->getName() ? OrmUtils::BIND_PREFIX : \"\";\n break;\n }\n }\n $setter = \"set\" . ucfirst($name).$postfix;\n $object->$setter($data[$name]);\n }\n return array($object, $errors);\n }", "public function load_data($data) {\n if(!is_array($data) || sizeof($data) <= 0)\n return;\n\n $columns_info = array();\n\n foreach($this->get_columns_information() as $column) \n $columns_info[] = $column['column_name'];\n\n foreach($data as $column => $value)\n if(in_array($column, $columns_info))\n $this->$column = $this->{'_' . $column} = $value;\n\n $this->new_register = false;\n }", "public function __fill(array $data = []): self\n {\n foreach ($data as $key => $value) {\n $setter = 'set' . snakeToCamel($key);\n\n if (method_exists($this, $setter)) {\n $this->$setter($value);\n }\n }\n\n return $this;\n }", "abstract public function populate();", "public function fill(array $data) {\n if(isset($data['scheduled_match_id'])) {\n $this->id = $data['scheduled_match_id'];\n }\n\t\t\n $this->leagueId = $data['scheduled_match_league_id'];\n\t\t$this->teamOneId = $data['scheduled_match_team_id_1'];\n\t\t$this->teamTwoId = $data['scheduled_match_team_id_2'];\n\t\t$this->fieldId = $data['scheduled_match_field_id'];\n\t\t$this->matchTime = $data['scheduled_match_time'];\n\t\t$this->dateId = $data['scheduled_match_date_id'];\n\t\t$this->playoffTeamOneString = $data['scheduled_match_playoff_team_1'];\n\t\t$this->playoffTeamTwoString = $data['scheduled_match_playoff_team_2'];\n\t\t$this->venueNumInWeek = $data['scheduled_match_venue_num_in_week'];\n }", "public function fill(array $data) {\n if(isset($data['user_history_id'])) {\n $this->id = $data['user_history_id'];\n }\n\t\t\n $this->userId = $data['user_history_user_id'];\n\t\t$this->username = $data['user_history_username'];\n\t\t$this->type = $data['user_history_type'];\n\t\t$this->description = $data['user_history_description'];\n\t\t$this->time = $data['user_history_timestamp'];\n\t}", "public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }", "public function fill($data){\n\n\t\t$not_added = array();\n\t\t\n\t\tif($this->check_fields){\n\t\t\tforeach($data as $key => $value){\n\t\t\t\tif(in_array($key, $this->fields)){\n\t\t\t\t\t$this->data[$key] = $value;\n\t\t\t\t}else{\n\t\t\t\t\t$not_added[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$this->data = $data;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function factory(array $data = [])\n {\n $model = $this->newQuery()->getModel()->newInstance();\n\n $this->setModelData($model, $data);\n\n return $model;\n }", "function initCompaniesArray($roo, $data)\n {\n $tn = $this->tableName();\n \n foreach($data as $d){\n $com = DB_DataObject::factory($tn);\n $com->setFrom($d);\n if(!$com->find(true)){\n $com->created_dt = Date('Y-m-d H:i:s');\n $com->updated_dt = Date('Y-m-d H:i:s');\n $com->is_system = 1;// new column.. block the user changing the code and name..\n $com->insert();\n }\n }\n \n \n }", "public function populate($data)\n {\n $set_data = [];\n\n foreach ((array)$data as $row_key => $row_value) {\n if (is_array($row_value) && isset($this->groups[$row_key])) {\n foreach ($row_value as $row_subkey => $row_subvalue) {\n $set_data[$row_key . '_' . $row_subkey] = $row_subvalue;\n }\n } else {\n $set_data[$row_key] = $row_value;\n }\n }\n\n foreach ($set_data as $field_name => $field_value) {\n if (isset($this->fields[$field_name])) {\n $field = $this->fields[$field_name];\n $field->setValue($field_value);\n }\n }\n }", "public function initialize()\n {\n $this->hasMany('id', 'Aulas', 'id_materia', array('alias' => 'Aulas'));\n $this->hasMany('id', 'Aulas', 'id_materia', NULL);\n }", "public function populateModels()\n {\n }", "private function __construct(array $row)\n {\n /** @var Model $modelClass */\n $modelClass = self::getClass();\n $lowercaseModelName = strtolower(self::getClassName());\n\n $modelScheme = $modelClass::getScheme();\n\n foreach ($modelScheme->getFieldColumnMap() as $fieldName => $columnName) {\n $this->_row[$fieldName] = null;\n\n if (empty($row)) {\n continue;\n }\n\n if (array_key_exists($fieldName, $row)) {\n $this->set($fieldName, $row[$fieldName]);\n unset($row[$fieldName]);\n continue;\n }\n\n $length = strlen($lowercaseModelName);\n if (strpos($fieldName, $lowercaseModelName) === 0) {\n $field = '/' . substr($fieldName, $length + 1);\n if (array_key_exists($field, $row)) {\n $this->set($fieldName, $row[$field]);\n unset($row[$field]);\n continue;\n }\n }\n\n foreach (['__json', '__fk', '_geo'] as $ext) {\n $field = strstr($fieldName, $ext, true);\n if ($field !== false && array_key_exists($field, $row)) {\n $this->set($field, $row[$field]);\n unset($row[$field]);\n\n continue 2;\n }\n }\n }\n\n $this->_data = $row;\n }", "public function __construct($data = [])\n {\n $this->massAssign($data);\n }", "protected function init()\n {\n if (!isset($this['fields'])) {\n $model = $base = [];\n if (isset($this->options['base_model']) && $this->options['base_model']) {\n $base = static::getTableInfo($this->options['base_model']) ? : [];\n }\n if (isset($this->options['table_name']) && (!$base || $this->options['table_name'] != $base['table_name'])) {\n $model = $this->getTableInfo($this->options['table_name']) ? : [];\n }\n \n if ($model && $base) {\n $model['ext_table'] = $model['table_name'];\n $model['ext_fields'] = isset($model['master_fields']) ? $model['master_fields'] : array_keys($model['fields']);\n \n $model['master_table'] = $base['table_name'];\n $model['master_fields'] = isset($base['master_fields']) ? $base['master_fields'] : array_keys($base['fields']);\n }\n \n // merge\n $model = ArrayHelper::merge($base, $model);\n $this->setOption($model);\n }\n }", "public function initialize()\n {\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', array('alias' => 'Cargaestudiantes'));\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', array('alias' => 'Datosprofesiona'));\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', NULL);\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', NULL);\n }", "protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "private function _populate()\n {\n // populate Rgion\n foreach ($this->regionData as $region)\n {\n $this->region->create(\n $region['name'],\n $region['promotor_ID']\n );\n }\n \n // Populate branch\n foreach ($this->branchData as $branch)\n {\n $this->branch->create(\n $branch['name'],\n $branch['region_ID'],\n $branch['promotor_ID']\n );\n }\n\n // Popular Dealer \n foreach ($this->dealerData as $dealer)\n { \n $data = [\n 'region_ID' => $dealer['region_ID'],\n 'branch_ID' => $dealer['branch_ID'],\n 'dealer_account_ID' => $dealer['dealer_account_ID'],\n 'dealer_channel_ID' => $dealer['dealer_channel_ID'],\n 'dealer_type_ID' => $dealer['dealer_type_ID'],\n 'code' => $dealer['code'],\n 'name' => $dealer['name'],\n 'company' => $dealer['company'],\n 'address' => $dealer['address']\n ];\n\n $this->dealer->create($data);\n }\n\n foreach ($this->dealerChannelData as $dealerChannel)\n {\n $this->dealerChannel->create(\n $dealerChannel['name']\n );\n }\n\n // Populate dealer account\n foreach ($this->dealerAccountData as $dealerAccount)\n {\n $this->dealerAccount->create(\n $dealerAccount['name'],\n $dealerAccount['branch_ID'],\n $dealerAccount['promotor_ID']\n );\n }\n\n //Populate token\n foreach ($this->tokenData as $token)\n {\n $this->token->create(\n $token['dashboard_account_ID'],\n $token['token']\n );\n }\n\n // Populate promotor\n foreach ($this->promotorData as $promotor)\n { \n $this->promotor->create(\n $promotor['dealer_ID'],\n $promotor['phone'],\n $promotor['password'],\n $promotor['name'],\n $promotor['gender'],\n $promotor['type'],\n $promotor['parent_ID']\n );\n }\n\n // Populate report\n foreach ($this->reportData as $data)\n {\n return $this->report->create($data);\n\n }\n \n // Populate dashboard \n $accountIDs = [];\n\n foreach ($this->accountData as $account)\n {\n $accountIDs[] = $this->account->create(\n $account['email'],\n $account['name'],\n $account['last_access']\n );\n }\n\n return $accountIDs;\n }", "public function populate($data = array())\n\t{\n\t $this->id = $data['id'];\n\t $this->code = $data['code'];\n\t $this->name = $data['name'];\n\t}", "public function loadFromArray(array $data = array())\n {\n $relations = $this->getRelations();\n\n foreach ($data as $key => $value) {\n if (array_key_exists($key, $relations)) {\n $class = $relations[$key];\n $model = new $class();\n\n if (!($model instanceof Base)) {\n throw new \\Exception(sprintf(\n 'Invalid relation object. Relation object must be instance of %s, %s given.',\n 'Model\\WealthbotRebalancer\\Base',\n $class\n ));\n }\n\n $model->loadFromArray($value);\n $this->$key = $model;\n\n } else {\n $this->$key = $value;\n }\n }\n }", "public function populate($data = array())\n {\n $this->id = $data['id'];\n\t\t$this->id_anuncio = $data['id_anuncio'];\n $this->id_plano = $data['id_plano'];\n $this->status = $data['status'];\n $this->data_inicio = $data['data_inicio'];\n $this->data_fim = $data['data_fim'];\n\t\t$this->media_clique = $data['media_clique'];\n $this->posicao_media = $data['posicao_media'];\n\t\t$this->tipo = $data['tipo'];\n $this->url_site = $data['url_site'];\n\t\t$date = new \\DateTime(\"now America/Sao_Paulo\");\n $this->data_cadastro = $date;\n $this->data_alteracao = $data['data_alteracao'];\n $this->data_finalizado = $data['data_finalizado'];\n \n }", "public function __construct($data = Array()){\n\n if(is_object($data)){\n $data = (array) $data;\n }//if\n\n if(count($data)){\n $this->data = array_merge( array_intersect_key($data, array_flip(array_keys($this->definition) ) ) );\n }//if\n\n }", "public function populate($data = array())\n {\n $this->id = (isset($data['id'])) ? $data['id'] : null;\n $this->name = (isset($data['name'])) ? $data['name'] : null;\n $this->surname = (isset($data['surname'])) ? $data['surname'] : null;\n $this->username = (isset($data['username'])) ? $data['username'] : null;\n $this->email = (isset($data['email'])) ? $data['email'] : null;\n }", "public function initialize()\n {\n $this->belongsTo(\n 'companies_id',\n 'Canvas\\Models\\Companies',\n 'id',\n ['alias' => 'company']\n );\n\n $this->belongsTo(\n 'apps_id',\n 'Canvas\\Models\\Apps',\n 'id',\n ['alias' => 'app']\n );\n\n $this->belongsTo(\n 'users_id',\n 'Canvas\\Models\\Users',\n 'id',\n ['alias' => 'user']\n );\n\n $this->belongsTo(\n 'system_modules_id',\n 'Canvas\\Models\\SystemModules',\n 'id',\n ['alias' => 'systemModule']\n );\n\n $this->setSource('email_templates_variables');\n }", "abstract protected function prepareModels();", "public function createModels() {\n // On itère sur notre tableau de K,V\n // Où la K = nom de la marque\n // Où la V = tableau de K,V entre nom du modèle et de la catégorie\n foreach ($this->getModels() as $brandName=> $arrayInfosModels) {\n // On itère sur notre tableau de K,V\n // Où la K = nom du modèle\n // Où la V = nom de la catégorie\n foreach ($arrayInfosModels as $modelName => $categoryName) {\n // On peut donc récupérer en BDD nos catégories et nos marques respestives en fonction\n // des données de notre tableau\n $category = $this->categRepository->findOneBy(['name' => $categoryName]);\n $brand = $this->brandRepository->findOneBy(['name' => $brandName]);\n // Afin de pouvoir créer nos Model\n $model = (new Model())\n ->setName($modelName)\n ->setBrand($brand)\n ->setCategory($category)\n ;\n $this->em->persist($model);\n }\n }\n $this->em->flush();\n }", "public function initialize()\n {\n $this->hasMany('id', 'MapsScore', 'map_id', array('alias' => 'MapsScore'));\n $this->hasMany('id', 'Matchs', 'current_map', array('alias' => 'Matchs'));\n $this->hasMany('id', 'PlayerKill', 'map_id', array('alias' => 'PlayerKill'));\n $this->hasMany('id', 'Players', 'map_id', array('alias' => 'Players'));\n $this->hasMany('id', 'PlayersHeatmap', 'map_id', array('alias' => 'PlayersHeatmap'));\n $this->hasMany('id', 'Round', 'map_id', array('alias' => 'Round'));\n $this->hasMany('id', 'RoundSummary', 'map_id', array('alias' => 'RoundSummary'));\n $this->belongsTo('match_id', 'Matchs', 'id', array('alias' => 'Matchs'));\n }", "public function initialize()\n {\n $this->setSource('tblEntry');\n\n $this->hasOne('userId', '\\Soul\\Model\\User', 'userId', ['alias' => 'user']);\n $this->belongsTo('eventId', '\\Soul\\Model\\Event', 'eventId', ['alias' => 'event']);\n $this->hasOne('paymentId', '\\Soul\\Model\\Payment', 'paymentId', ['alias' => 'payment']);\n }", "public function populate($data = array())\n\t{\n\t\t$this->id = $data['id'];\n\t\t$this->name = $data['name'];\n\t}", "protected static function createObject(array $data): AbstractModel\n {\n $data['stories'] = [];\n if ($storyId = $data['id'] ?? null) {\n $stories = Story::getMultiple('', $storyId);\n $data['stories'] = $stories;\n }\n\n if ($userId = $data['user_id'] ?? null) {\n $user = User::getOne('user_id', $userId);\n $data['user_name'] = \"{$user->getUserName}\";\n }\n\n $data['themes'] = [];\n if ($themeId = $data['id'] ?? null) {\n $themes = Theme::getMultiple('theme_id', $themeId);\n $data['themes'] = $themes;\n }\n\n\n\n return parent::createObject($data);\n }", "private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function createMany(array $data): Model\n {\n return $this->model->createMany($data);\n }", "public function __construct(array $data)\n {\n if (isset($data['id'])) {\n $this->id = $data['id'];\n }\n $this->firstname = $data['firstname'];\n $this->lastname = $data['lastname'];\n $this->weight = $data['weight'];\n $this->birthday = $data['birthday'];\n $this->sex = $data['sex'];\n }", "public function initialize()\n {\n $this->setSchema(\"\");\n $this->hasMany(\n 'id',\n 'App\\Models\\Flats',\n 'house_id',\n array('alias' => 'Flats', \"reusable\" => true)\n );\n\n $this->belongsTo(\n \"street_id\",\n \"App\\Models\\Streets\",\n \"id\",\n array(\"alias\" => \"Streets\", \"reusable\" => true)\n );\n }", "public function initialize()\n {\n $this->setSchema(\"kp_si_disat\");\n $this->setSource(\"data_diksar\");\n $this->belongsTo('id_sertifikat', '\\Sertifikat', 'id_sertifikat', ['alias' => 'Sertifikat']);\n $this->belongsTo('id_kesehatan', '\\Kesehatan', 'id_kesehatan', ['alias' => 'Kesehatan']);\n }", "public function initialize()\n {\n $this->setSchema(\"taff\");\n $this->setSource(\"boardchecklist\");\n $this->hasMany('checklistId', 'Boardchecklistitem', 'checklistId', ['alias' => 'Boardchecklistitem']);\n $this->belongsTo('cardId', '\\Boardcard', 'cardId', ['alias' => 'Boardcard']);\n }", "public function initTable(){\n\t\t\t\n\t\t}", "function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }", "public function __construct($data = array()) {\n \n if(!is_array($data)){\n return;\n }\n \n foreach ($data as $key => $value) {\n $key = $this->_getKey($key);\n if(!$key) {\n continue;\n }\n \n $this->$key = $value;\n }\n }", "public function creating(array $data);", "function init()\n {\n foreach ($GLOBALS['_PX_models'] as $model=>$val) {\n if (isset($val['relate_to'])) {\n foreach ($val['relate_to'] as $related) {\n if ($this->_model == $related) {\n // The current model is related to $model\n // through one or more foreign key. We load\n // the $model to check on which fields the\n // foreign keys are set, as it is possible in\n // one model to have several foreign keys to\n // the same other model.\n if ($model != $this->_model) {\n $_m = new $model();\n $_fkeys = $_m->getForeignKeysToModel($this->_model);\n } else {\n $_fkeys = $this->getForeignKeysToModel($this->_model);\n }\n foreach ($_fkeys as $_fkey=>$_fkeyval) {\n //For each foreign key, we add the\n //get_xx_list method that can have a\n //custom name through the relate_name\n //value.\n if (isset($_fkeyval['relate_name'])) {\n $mname = $_fkeyval['relate_name'];\n } else {\n $mname = strtolower($model);\n }\n $this->_methods_list['get_'.$mname.'_list'] = array($model, $_fkey);\n }\n break;\n }\n }\n }\n if (isset($val['relate_to_many']) && \n in_array($this->_model, $val['relate_to_many'])) {\n $this->_methods_list['get_'.strtolower($model).'_list'] = $model;\n $this->_manytomany[$model] = 'manytomany';\n }\n }\n foreach ($this->_cols as $col=>$val) {\n $field = new $val['type']($col);\n if ($field->type == 'foreignkey') {\n $this->_methods_get['get_'.strtolower($col)] = array($val['model'], $col);\n $this->_fk[$col] = 'foreignkey';\n }\n if ($field->type == 'manytomany') {\n $this->_methods_list['get_'.strtolower($col).'_list'] = $val['model'];\n $this->_manytomany[$val['model']] = 'manytomany';\n }\n foreach ($field->add_methods as $method) {\n $this->_methods_extra[$method[0]] = array(strtolower($col), $method[1]);\n }\n }\n }", "public function initialize()\n {\n $this->setSchema(\"mydb\");\n $this->setSource(\"paying\");\n $this->belongsTo('cid', 'Customers', 'cid', array('alias' => 'alias_customers'));\n $this->belongsTo('loanid', 'LoanInformation', 'loanid', array('alias' => 'alias_loan'));\n $this->hasManyToMany(\n 'payingid',\n 'Tracking',\n 'payingid', 'oid',\n 'DeptTrackers',\n 'oid',\n array(\n 'alias' => 'alias_depttrackers'\n )\n );\n }", "public function create(array $data) {\r\n return $this->model->create($data);\r\n }", "protected function prepareModel($data = [])\n {\n return $this->getModel();\n }", "public function initialize()\n {\n $this->belongsTo('id_deuda', 'NbDeudas', 'id_deuda', array('alias' => 'NbDeudas'));\n $this->belongsTo('id_deuda', 'Nbdeudas', 'id_deuda', array('foreignKey' => true));\n }", "public function populate();", "protected function _initsTable() {}", "public function initialize()\n {\n $this->hasMany('id', 'Message', 'idFil', array('alias' => 'Message'));\n $this->belongsTo('idFil', 'Message', 'id', array('alias' => 'Message'));\n $this->belongsTo('idProjet', 'Projet', 'id', array('alias' => 'Projet'));\n $this->belongsTo('idUser', 'User', 'id', array('alias' => 'User'));\n }", "function setFields(&$data)\n {\n if (empty($data)) {\n return false;\n }\n $row = $data[key($data)];\n $columns = array();\n $models = array_keys($row);\n foreach ($models as $model) {\n $fields = Set::extract($row, \"/$model\");\n // Fields provided without model, add default Model\n if (!is_array($fields[0])) {\n $columns[] = sprintf('%s.%s', $this->defaultModel, $model);\n continue;\n }\n $fields = array_keys($fields[0][$model]);\n foreach ($fields as $field) {\n $columns[] = sprintf('%s.%s', $model, $field);\n }\n }\n $this->fields = $columns;\n\n return true;\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function loadData(Array $data): void\n {\n foreach($data as $fieldName => $fData) {\n if (property_exists($this, $fieldName)) {\n $this->{$fieldName} = $fData;\n }\n }\n }", "public function fill($data)\n {\n }", "public function populate($data = array())\n {\n parent::populate($data);\n }", "public function initialize()\n {\n $this->hasMany('cd', 'ShouhinMrs', 'shu_souko_mr_cd', array('alias' => 'ShouhinMrs'));\n $this->hasMany('cd', 'ShiireMeisaiDts', 'souko_mr_cd', array('alias' => 'ShiireMeisaiDts'));\n $this->hasMany('cd', 'UriageMeisaiDts', 'souko_mr_cd', array('alias' => 'UriageMeisaiDts'));\n $this->belongsTo('tantou_mr_cd', 'TantouMrs', 'cd', array('alias' => 'TantouMrs'));\n }", "public function _populate($data){\n\t\t$object = new Model_Aclusuariosonline();\n\t\tif($data == null)return $object;\n\t\t$label = null;\n\t\tif(array_key_exists(\"aclusuariosonline_id\", $data))$object->setId($data[\"aclusuariosonline_id\"]);\n\t\tif(array_key_exists(\"ultimoacceso\", $data))$object->setUltimoacceso($data[\"ultimoacceso\"]);\n\t\tif(array_key_exists(\"tiempo\", $data))$object->setTiempo($data[\"tiempo\"]);\n\t\tif(array_key_exists(\"ip\", $data))$object->setIp($data[\"ip\"]);\n\tif(array_key_exists(\"usuario_id\", $data)){\n\t\t$object->setUsuario_id($data[\"usuario_id\"]);\n\t\tif($this->getPerezoso()){\n\t\t\t$usuario_idDB = new Model_AclusuariosMapper();\n\t\t\t$usuario_idDB->setPerezoso(false);\n\t\t\t//$objectRelacion = $usuario_idDB->getById(0);\t\n\t\t\t$objectRelacion = $usuario_idDB->getById($data[\"usuario_id\"]);\t\n\t\t\t$object->setUsuario_idObject($objectRelacion);\n\t\t}\t\n\t}\n\n\n \t\treturn $object;\n\t}", "public function initialize()\n {\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaExcusa', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo', 'CobActaconteo', 'id_actaconteo', array(\n 'reusable' => true\n ));\n }", "public function create(array $data) {\n \n }", "public function populate($data = array())\n {\n }", "public function create(array $data) {\n // Create the model\n $model = $this->model->fill($data);\n\n if ($model->save()) {\n $this->syncRelation($model, $data, 'insuranceBlocks');\n $this->syncRelation($model, $data, 'cards');\n\n return $model;\n }\n\n return false;\n }", "public function __construct($data) { \n foreach ($data as $key => $value) {\n if (array_key_exists($key, $this->data)) $this->data[$key] = $value;\n }\n}", "public function init()\r\n {\r\n $dbTable = new Application_Model_DbTable_Fournisseur();\r\n $this->mapper = new Application_Model_Mapper_Fournisseur($dbTable);\r\n }", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);" ]
[ "0.66733825", "0.6374431", "0.61551684", "0.61491483", "0.6143746", "0.6140344", "0.6117816", "0.6104798", "0.6102643", "0.6100186", "0.6094662", "0.60858464", "0.60426337", "0.60395235", "0.60011333", "0.5993555", "0.5980663", "0.5971696", "0.5967581", "0.5949078", "0.59481394", "0.59261984", "0.59135294", "0.58841985", "0.58788335", "0.586726", "0.58567685", "0.58533585", "0.58430123", "0.58373296", "0.58278435", "0.5817328", "0.5811572", "0.5802524", "0.579589", "0.57746464", "0.5773189", "0.57703215", "0.5756631", "0.5755911", "0.5754209", "0.5753844", "0.57357067", "0.5730143", "0.57206553", "0.5718173", "0.5716555", "0.5716294", "0.5711407", "0.5706729", "0.5700021", "0.5695709", "0.5692957", "0.5690764", "0.56747454", "0.5673216", "0.56697536", "0.56639725", "0.56627756", "0.56489384", "0.56471896", "0.5639234", "0.56318134", "0.5630059", "0.5625016", "0.5615605", "0.561554", "0.56059146", "0.5601334", "0.5595461", "0.5595429", "0.55907494", "0.5584916", "0.5577433", "0.5577287", "0.5568075", "0.5567467", "0.55660725", "0.5558647", "0.5558048", "0.55519396", "0.55450726", "0.5544205", "0.55417687", "0.5539949", "0.5539367", "0.5534627", "0.5530806", "0.552951", "0.552802", "0.5526638", "0.5523717", "0.5520259", "0.55196303", "0.5517955", "0.5517955", "0.5517955", "0.5517955", "0.5517955", "0.5517955", "0.5517955" ]
0.0
-1
Gets query for [[Gejala]].
public function getGejala() { return $this->hasOne(Gejala::className(), ['id_gejala' => 'id_gejala']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsGoogleQuery(){\r\n\t\treturn $this->name . \" \" . $this->address . \" \" . $this->zipCode . \" \" . $this->city;\r\n\t}", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery() {}", "public function getQuery() {}", "function getQuery() ;", "public function getElasticaQuery()\n {\n return $this->elasticaQuery;\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public abstract function getQuery();", "public abstract function get_query();", "public function getQuery() {\n if ($this->query == null) {\n $this->query = new PgQuery();\n }\n return $this->query;\n }", "public function getQuery()\n {\n return $this->get(self::_QUERY);\n }", "public function getAllDataGejala()\n {\n $query = $this->db->query('SELECT * FROM tb_gejala');\n return $query->result();\n }", "function getGeoSearchUrl($ar){\n $p = new XParam($ar, array());\n $table = $p->get('table');\n $fieldname = $p->get('fieldname');\n $moid = $this->_moid;\n $templates = 'googlesearch.html';\n return $GLOBALS['TZR_SESSION_MANAGER']::complete_self(true, true).\"skip=1&&moid={$moid}&class=XModMap&table={$table}&field={$fieldname}&provider=google&function=geoSearch&template=xmodmap/geosearch.html&tplentry=br\";\n }", "public function query(): string;", "public function getQuery(){\n \n return $this->query;\n \n }", "public function getQuery()\n {\n return $this->_data['query'];\n }", "public function getClientQuery(): string;", "abstract protected function getQuery();", "public function getQuery() {\n return $this->query;\n }", "public function getQuery(): array;", "public function get_query() {\n\t return $this->decodedWebhook['queryResult']['queryText'];\n }", "function getQuery() {\n return $this->query;\n }", "public function getQUERY()\n {\n return $this->QUERY;\n }", "public function getQuery()\n {\n return $this->getOption('query');\n }", "public function getquery(){\n\t\treturn $this->query;\n\t}", "public function getGql()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('gql');\n }", "protected function _getQuery()\n {\n return Mage::helper('catalogsearch')->getQuery();\n }", "public function getQuery() {\n return $this->query;\n }", "public function get_query(){\n return $this->build_query()->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "function listQueryPeriodeGA() {\n $sql = \"select * from \" . static::table('ga_periodegaji');\n\n return $sql;\n }", "protected function getLatitudeQuery()\n {\n return $this->latitudeQuery;\n }", "public function getQuery()\r\n\t{\r\n\t\treturn $this->query;\r\n\t}", "public function getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function getQuery()\n {\n return $this->getQ();\n }", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "public function getQueryAsString();", "public function getQuery()\r\n {\r\n return $this->m_query;\r\n }", "public static function getQuery()\n {\n return self::$__query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public static function query();", "public function getQuery()\n {\n return $this->_query;\n }", "public function getQuery() {\n return $this->query;\n }", "public function getQuery(): string\r\n {\r\n return $this->query;\r\n }", "protected function _getQuery()\n {\n return $this->_queryFactory->get();\n }", "public function getQuery()\n {\n return $this->readOneof(2);\n }", "function listQueryKGB() {\n\t\t\t$sql = \"select p.nik,\".static::schema.\".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as namalengkap,\n\t\t\t\t\tr.*,substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),3,2)+' bulan' as mklama,\n\t\t\t\t\tsubstring(right(replicate('0', 4) + cast(r.mkgbaru as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkgbaru as varchar), 4),3,2)+' bulan' as mkbaru,\n\t\t\t\t\tpl.golongan as golonganlama, pb.golongan as golonganbaru\n\t\t\t\t\tfrom \".self::table('pe_kgb').\" r \n\t\t\t\t\tleft join \".self::table('ms_pegawai').\" p on p.idpegawai=r.idpegawai\n\t\t\t\t\tleft join \".self::table('ms_unit').\" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pl on pl.idpangkat=r.pangkatlama\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pb on pb.idpangkat=r.pangkatbaru\";\n\t\t\t\n\t\t\tif(Modul::getRole() == 'Jab'){ //bila atasan\n\t\t\t\t$sql .= \" where p.emailatasan = '\".Modul::getUserEmail().\"'\";\n\t\t\t}\n\t\t\t\n\t\t\treturn $sql;\n\t\t}", "public function getQuery()\n {\n return $this->wrapped->getQuery();\n }", "function listQueryGajiHonorer() {\n $sql = \"select p.idpegawai,\" . static::schema() . \"f_namalengkap(gelardepan,namadepan,namatengah,namabelakang,gelarbelakang) as namalengkap,\n\t\t\t\t\tnamapendidikan,namaunit,th.nominal as tarif,g.isfinish,g.gajiditerima\n\t\t\t\t\tfrom \" . static::table('ga_gajipeg') . \" g \n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai=g.idpegawai\n\t\t\t\t\tleft join \" . static::table('lv_jenjangpendidikan') . \" j on j.idpendidikan=p.idpendidikan\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \" . static::table('ga_tarifhonorer') . \" th on th.idpendidikan=p.idpendidikan\n\t\t\t\t\twhere p.idstatusaktif in (select idstatusaktif from \" . static::table('lv_statusaktif') . \" where isdigaji='Y')\n\t\t\t\t\tand idhubkerja in ('HP')\";\n return $sql;\n }", "public function getQuery($name = null);", "function getGeoViewUrl($ar){\n $p = new XParam($ar, array());\n $table = $p->get('table');\n $fieldname = $p->get('fieldname');\n $moid = $this->_moid;\n $templates = 'googlesearch.html';\n return $GLOBALS['TZR_SESSION_MANAGER']::complete_self(true, true).\"skip=1&moid={$moid}&class=XModMap&table={$table}&field={$fieldname}&provider=google&function=geoSearch&template=xmodmap/geosearch.html&readonly=readonly&tplentry=br\";\n }", "public static function get_query()\n\t{\n\t\treturn self::new_instance_records()->get_query();\n\t}", "public function get() {\n\t\treturn $this->query;\n\t}", "public function getQuery()\n {\n /* Return self->query */\n return $this->query;\n }", "public function getDataGejala($id_gejala)\n {\n $query = $this->db->query('SELECT * FROM tb_gejala WHERE `id_gejala` =' . $id_gejala);\n return $query->row();\n }", "protected function getLongitudeQuery()\n {\n return $this->longitudeQuery;\n }", "abstract public function\r\n\t\tget_query_for_something();", "public function getQuery()\n {\n return $this->readOneof(5);\n }", "function query() {\n $this->ensure_my_table();\n $value = $this->parse_gis_location();\n $this->query->add_where($this->options['group'], \"$this->table_alias.$this->real_field\", $value, $this->operator);\n }", "protected function getQuery()\n {\n return self::$_query;\n }", "private function makeQuery(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['select'][] = '(SELECT i.image FROM listing_images i WHERE l.listing_id=i.listing_id ORDER BY i.sort_order ASC LIMIT 1) AS image';\n\t\t$this->searchQ['from'] = 'listing_level e, listing_type y, pages p, listing l '; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t//$this->searchQ['orderby'][] = '(distance - ((l.level_id-1)*16000)) ASC'; // (x^3 -400^3)^(1/3)\n\t\t\t\n\t\t\t// using a exponential function to order distances based on the listing level and multiplying by 16000 m = 16km = 10 miles\n\t\t\t// then raising to power 3, deleteing the distance cubed and then 1/3 (cube root), so only makes a diffenrce within that area\n\t\t\t\n\t\t\t$this->searchQ['orderby'][] = ' POW( (POW( distance ,3) - POW(((l.level_id-1)*' . $this->levelMultiplier. '),3)),(1/3)) ASC ';\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t\t$this->doSearch = true;\n\t\t}else{\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t}\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\n\t\treturn $q;\n\t\t\n\t}", "function getQuery() {\n\n\t\t$qpa = db_construct_qpa() ;\n\n\t\tif (forge_get_config('use_fti')) {\n\t\t\t$words = $this->getFTIwords();\n\t\t\t$qpa = db_construct_qpa($qpa,\n\t\t\t\t\t\t 'SELECT x.* FROM (SELECT forum.group_forum_id, forum.msg_id, ts_headline(forum.subject, $1::tsquery) AS subject, forum.post_date, users.realname, forum.subject||$2||forum.body as full_string_agg, forum_idx.vectors FROM forum, users, to_tsquery($1) AS q, forum_idx WHERE forum.group_forum_id = $3 AND forum.posted_by = users.user_id AND forum_idx.msg_id = forum.msg_id GROUP BY forum.group_forum_id, forum.msg_id, subject, body, post_date, realname, forum_idx.vectors) AS x WHERE vectors @@ $1::tsquery ',\n\t\t\t\t\t\t array ($words,\n\t\t\t\t\t\t\t$this->field_separator,\n\t\t\t\t\t\t\t$this->forumId)) ;\n\t\t\t$phraseOp = $this->getOperator();\n\n\t\t\tif(count($this->phrases)) {\n\t\t\t\t$qpa = db_construct_qpa($qpa,\n\t\t\t\t\t\t\t 'AND (') ;\n\t\t\t\t$qpa = $this->addMatchCondition($qpa, 'full_string_agg');\n\t\t\t\t$qpa = db_construct_qpa($qpa,\n\t\t\t\t\t\t\t ') ') ;\n\t\t\t}\n\t\t\t$qpa = db_construct_qpa($qpa,\n\t\t\t\t\t\t 'ORDER BY ts_rank(vectors, $1) DESC',\n\t\t\t\t\t\t array($words)) ;\n\t\t} else {\n\t\t\t$qpa = db_construct_qpa($qpa,\n\t\t\t\t\t\t 'SELECT x.* FROM (SELECT forum.group_forum_id, forum.msg_id, forum.subject, forum.post_date, users.realname, forum.subject||$1||forum.body as full_string_agg FROM forum,users WHERE users.user_id=forum.posted_by AND forum.group_forum_id=$2 GROUP BY forum.group_forum_id, msg_id, subject, post_date, realname, body) AS x WHERE ',\n\t\t\t\t\t\t array ($this->field_separator,\n\t\t\t\t\t\t\t$this->forumId)) ;\n\t\t\t$qpa = $this->addIlikeCondition ($qpa, 'full_string_agg') ;\n\t\t\t$qpa = db_construct_qpa($qpa,\n\t\t\t\t\t\t ' ');\n\t\t}\n\t\treturn $qpa ;\n\t}", "function queryToUrl_min($query, $country=\"US\") {\n return \"http://www.google.com/search?\" . http_build_query(array(\n // Query\n //\"q\" => urlencode($query),\n \"q\" => $query,\n \"tbm\" => \"isch\",\n // Country (geolocation presumably)\n \"gl\" => $country,\n ), true);\n\n }", "public function getLanguageQueryKey(): string;", "public function getQuery()\n {\n return isset($this->query) ? $this->query : null;\n }", "public function getQuery($conjunction = 'AND') {\n // TODO: Implement getQuery() method.\n }", "public function get($where = array()){\n // yapmak için kullanacagimiz kodlar gelecek\n\n }", "public function getQueryString() {\n\t\t\n\t}", "protected function getQuery() {\n $query = new Query();\n if($this->valid()) {\n $query->setQuery(new GtNode($this->dataStore->getIdentifier(), $this->key()));\n }\n $query->setLimit(new LimitNode($this->limit));\n $query->setSort(new SortNode([\n $this->dataStore->getIdentifier() => SortNode::SORT_ASC\n ]));\n return $query;\n }", "public function createDefaultSearchQuery()\n {\n $qB = SearchEngine::getElasticaQueryBuilder();\n\n $keyword = Utility::convertArrayToString($this->searchEvent->getKeyword());\n $where = $this->searchEvent->getWhere();\n\n $keywordQuery = null;\n $whereQuery = null;\n $content = 0;\n if ($where) {\n if ($geoDistance = $this->container->get(\"nearby.handler\")->getGeoDistanceInfoByWhere()) {\n $whereQuery = $qB->query()->bool();\n $whereQuery->addShould(\n $qB->query()->match()->setFieldQuery(\"searchInfo.location\",$where)\n ->setFieldType(\"searchInfo.location\", \"phrase\")\n ->setFieldBoost(\"searchInfo.location\", 2)\n ->setFieldParam('searchInfo.location', 'slop', 30)\n );\n $whereQuery->addShould(\n $qB->query()->geo_distance(\n 'geoLocation',\n [\n 'lat' => $geoDistance['latitude'],\n 'lon' => $geoDistance['longitude'],\n ],\n $geoDistance['radius'])\n );\n $content |= 1;\n } else {\n $whereQuery = $qB->query()->match()->setFieldQuery('searchInfo.location',$where)\n ->setFieldType('searchInfo.location', 'phrase')\n ->setFieldParam('searchInfo.location', 'slop', 30);\n $content |= 1;\n }\n }\n\n if ($keyword) {\n $keywordQuery = $qB->query()->multi_match();\n\n $keywordQuery->setQuery($keyword)\n ->setTieBreaker(0.3)\n ->setOperator(\"and\")\n ->setFields([\n 'friendlyUrl^500',\n 'title.raw^200',\n 'title.analyzed^10',\n 'description^5',\n 'searchInfo.keyword^1',\n 'searchInfo.location^1',\n ]);\n\n $content |= 2;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_setup_query\", [\n \"content\" => &$content,\n \"whereQuery\" => &$whereQuery,\n \"keywordQuery\" => &$keywordQuery\n ]);\n\n switch ($content) {\n case 1:\n $query = $whereQuery;\n break;\n case 2:\n $query = $keywordQuery;\n break;\n case 3:\n $query = $qB->query()->bool();\n $query->addMust($keywordQuery);\n $query->addMust($whereQuery);\n break;\n default:\n $query = $qB->query()->match_all();\n break;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_return_query\", [\n \"query\" => &$query,\n ]);\n\n return $query;\n }", "public function query();", "public function query();", "public function query();" ]
[ "0.63838774", "0.6339582", "0.6339582", "0.6339582", "0.6339582", "0.6339582", "0.6339582", "0.6339582", "0.6339582", "0.6339582", "0.6091791", "0.6091791", "0.6085888", "0.60017765", "0.59211206", "0.59211206", "0.59211206", "0.59211206", "0.59211206", "0.59211206", "0.59211206", "0.59211206", "0.59211206", "0.58621454", "0.5855225", "0.5842749", "0.5818604", "0.57792765", "0.577842", "0.5732132", "0.571336", "0.57070166", "0.56749374", "0.56582916", "0.5636067", "0.5621931", "0.5613469", "0.55972934", "0.5591362", "0.5576999", "0.55735224", "0.5557287", "0.5552104", "0.5544301", "0.55437905", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55437404", "0.55358666", "0.5494869", "0.54942447", "0.54810166", "0.5473471", "0.5469215", "0.5451382", "0.5441662", "0.5436816", "0.54305667", "0.54305667", "0.54305667", "0.543034", "0.5429447", "0.5415496", "0.54154515", "0.54132366", "0.5398342", "0.53898907", "0.5378998", "0.53558594", "0.5348653", "0.5338997", "0.53339034", "0.5327741", "0.53210205", "0.531463", "0.5313098", "0.5301706", "0.52850467", "0.52768606", "0.52736026", "0.5269727", "0.5256183", "0.52529204", "0.52455854", "0.52355236", "0.52305907", "0.52263916", "0.5205105", "0.5187943", "0.51730716", "0.51724046", "0.51724046", "0.51724046" ]
0.62435675
10
Gets query for [[Penyakit]].
public function getPenyakit() { return $this->hasOne(Penyakit::className(), ['id_penyakit' => 'id_penyakit']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQuery()\n {\n return $this->get(self::_QUERY);\n }", "public function getQuery() {}", "public function getQuery() {}", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery();", "public function getQuery() {\n return $this->query;\n }", "public function getQuery() {\n if ($this->query == null) {\n $this->query = new PgQuery();\n }\n return $this->query;\n }", "public function getQuery()\n {\n return $this->_data['query'];\n }", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "public function getQuery(){\n \n return $this->query;\n \n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->query;\n }", "public abstract function get_query();", "public function getQuery()\n {\n return $this->getQ();\n }", "public function getQuery() {\n return $this->query;\n }", "public function getQuery()\r\n\t{\r\n\t\treturn $this->query;\r\n\t}", "public function query(): string;", "public function getQuery(): string\r\n {\r\n return $this->query;\r\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function getQUERY()\n {\n return $this->QUERY;\n }", "public function getquery(){\n\t\treturn $this->query;\n\t}", "function getQuery() {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->_query;\n }", "public function getQuery() {\n return $this->query;\n }", "public function getQuery()\n {\n return $this->wrapped->getQuery();\n }", "public function get() {\n\t\treturn $this->query;\n\t}", "public function get_query(){\n return $this->build_query()->query;\n }", "public function getQuery()\n {\n return $this->getOption('query');\n }", "public function query()\n {\n return $this->_query;\n }", "public function query() {\n\t\treturn Documents::instance()->query();\n\t}", "public static function getQuery()\n {\n return self::$__query;\n }", "function query_peminjam(){\n\t\t\t$query = $this->db->query (\"SELECT * FROM peminjam\");\n\t\t\t$query = $query->result();\n\t\t\treturn $query;\n\t\t}", "protected function getQuery()\n {\n return self::$_query;\n }", "public function searchPlurk()\n\t{\n\t\t$url = sprintf('%sPlurkSearch/search', self::HTTP_URL);\n\t\t$args = array(\n\t\t\t'query'\t\t=>\t$this->_setting->query,\n\t\t\t'offset'\t=>\t$this->_setting->offset\n\t\t);\n\n\t\t$this->setResultType(PlurkResponseParser::RESULT_SEARCH_PLURK);\n\t\treturn $this->sendRequest($url, $args);\n\t}", "public abstract function getQuery();", "public function getQuery()\n {\n /* Return self->query */\n return $this->query;\n }", "public function getQuery()\r\n {\r\n return $this->m_query;\r\n }", "function query()\n\t{\n\t\treturn $this->query;\n\t}", "public function getAllDataPenyakit()\n {\n $query = $this->db->query('SELECT * FROM tb_penyakit');\n return $query->result();\n }", "public final function getQuery() {\n return $this->queryString;\n }", "public function getQuery(): string\n {\n return (string) $this->query;\n }", "public function get_query() {\n\t return $this->decodedWebhook['queryResult']['queryText'];\n }", "function getQuery() ;", "public static function get_query()\n\t{\n\t\treturn self::new_instance_records()->get_query();\n\t}", "protected function _getQuery()\n {\n return $this->_queryFactory->get();\n }", "public function politik()\n {\n \n $this->db->select('*');\n $this->db->from('politik');\n \n $query = $this->db->get();\n return $query;\n }", "public function getQueryOppo()\n {\n return $this->get(self::_QUERY_OPPO);\n }", "public function getQueryOppo()\n {\n return $this->get(self::_QUERY_OPPO);\n }", "abstract protected function getQuery();", "public function where()\n {\n return $this->query; \n }", "public function getQuery(): array;", "function get_pasien()\n\t{\n\t\t$query = $this->db->get('pasien');\n\t\treturn $query;\n\t}", "public function queryString() : string;", "function &getQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function getQuery()\n {\n return $this->readOneof(2);\n }", "protected function getSecretQuery()\n {\n return $this->secretQuery;\n }", "public function getQuery()\n {\n return isset($this->query) ? $this->query : null;\n }", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "public function query() {\n // Leave empty to avoid a query on this field.\n }", "function listQueryPajak() {\n $sql = \"select * from \" . static::table('ms_pajak');\n\n return $sql;\n }", "abstract public function\r\n\t\tget_query_for_something();", "public function toQuery();", "public function queryString();", "function get_penyerapan($thang=\"2011\", $kddept=null, $kdunit=null, $kdprogram=null, $kdsatker=null, $kdgiat=null)\r\n{\r\n\t$ci = & get_instance();\r\n\t$ci->load->database();\r\n\t$sql = 'select sum( realisasi ) as jmlrealisasi, sum( pagu ) as jmlpagu, round(( sum( realisasi ) / sum( pagu ) ) *100, 2) as p\r\n\tfrom tb_penyerapan_anggaran\r\n\twhere thang='.$thang.' ';\r\n\t\r\n\tif(isset($kddept)):\r\n\t\t$sql .= 'and kddept='.$kddept.' ';\r\n\tendif;\r\n\tif(isset($kdunit)):\r\n\t\t$sql .= 'and kdunit='.$kdunit.' ';\r\n\tendif;\r\n\tif(isset($kdprogram)):\r\n\t\t$sql .= 'and kdprogram='.$kdprogram.' ';\r\n\tendif;\r\n\tif(isset($kdsatker)):\r\n\t\t$sql .= 'and kdsatker='.$kdsatker.' ';\r\n\tendif;\r\n\tif(isset($kdgiat)):\r\n\t\t$sql .= 'and kdgiat='.$kdgiat.' ';\r\n\tendif;\r\n\treturn $ci->db->query($sql)->row();\r\n}", "public function getQueryDataProvider() {}", "public function getJsonp()\n\t{\n\t\treturn $this->getQuery($this->jsonpKey);\n\t}", "protected function _getQuery()\n {\n return Mage::helper('catalogsearch')->getQuery();\n }", "public function getQueryString() {\n\t\t\n\t}", "public function readByKeyQuery(): string\n {\n return 'SELECT * FROM products WHERE id = :id';\n }", "public function getQuery(): string {\n\t\t// Store previous output before changing to temp\n\t\t$output = $this->get('output');\n\t\t\n\t\ttry {\n\t\t\t$this->set('output', SqlAdapter::SQL_QUERY);\n\t\t\t$result = $this->run();\n\t\t} finally {\n\t\t\t$this->set('output', $output);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getQuery()\n {\n return $this->readOneof(5);\n }", "public function getQueryObject() {\n return parent::getQueryObject();\n }", "function query() {\n $this->query = new DrupalConnectAppsQuery($this);\n\n return $this->query;\n }" ]
[ "0.63001096", "0.6270179", "0.6270179", "0.6255055", "0.6255055", "0.6255055", "0.6255055", "0.6255055", "0.6255055", "0.6255055", "0.6255055", "0.6255055", "0.62227416", "0.62227416", "0.62227416", "0.62227416", "0.62227416", "0.62227416", "0.62227416", "0.62227416", "0.62227416", "0.61921716", "0.6188307", "0.61443746", "0.6103462", "0.61033857", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.6091834", "0.608028", "0.6078793", "0.6076845", "0.6068904", "0.60679156", "0.6066816", "0.60505027", "0.60505027", "0.60505027", "0.6033463", "0.6031241", "0.6025784", "0.60135686", "0.59731203", "0.5962214", "0.5960232", "0.59528995", "0.59518045", "0.5940503", "0.5899166", "0.58932143", "0.5891351", "0.5882933", "0.58774805", "0.58734447", "0.5865779", "0.58609754", "0.5850314", "0.58337235", "0.5825915", "0.58185023", "0.5774162", "0.5773889", "0.577385", "0.57429886", "0.57428277", "0.570335", "0.57004184", "0.57004184", "0.5679301", "0.5665185", "0.5663274", "0.5630843", "0.5621197", "0.56049323", "0.55953103", "0.55848885", "0.5578755", "0.5560951", "0.555392", "0.55452216", "0.5527872", "0.5526626", "0.55143523", "0.55029565", "0.55019563", "0.5495066", "0.5490537", "0.5476553", "0.54663205", "0.5466067", "0.54571164", "0.5452901", "0.5445312" ]
0.6182934
23
/ Form Elements & Other Definitions Here ...
public function init() { $this->SetName('Login'); $this->setMethod('POST'); $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl().'/Login/auth'); $this->setAttrib('class','login_form'); //UserName $usernameElement = new Zend_Form_Element_Text('username'); $usernameElement->setLabel('Username'); $usernameElement->setRequired(true); //$usernameElement->setAttrib('class','form-group form-control'); $usernameElement->addFilter(new Zend_Filter_StripTags()); $usernameElement->addFilter(new Zend_Filter_HtmlEntities()); $usernameElement->addFilter(new Zend_Filter_StringToLower()); // $usernameElement->addValidator(new My_Validate_Text_Username()); $this->addElement($usernameElement); //Password $passwordElement = new Zend_Form_Element_Password('password'); $passwordElement->setLabel('Password'); $passwordElement->setRequired(true); // $passwordElement->setAttrib('class','form-group form-control'); $passwordElement->addFilter(new Zend_Filter_HtmlEntities()); $passwordElement->addFilter(new Zend_Filter_StripTags()); $this->addElement($passwordElement); //Submit $submitButton = new Zend_Form_Element_Submit('submit'); $submitButton->setLabel('Log In'); $submitButton->setAttrib('class','btn btn-primary btn-success'); $this->addElement($submitButton); // $this->getElement('username')->addDecorator('Label',array('placement'=>'APPEND')); // $this->getElement('username')->addDecorator('HtmlTag',array('tag'=>'dl','class'=>'login_form')); // $this->getElement('password')->addDecorator('Label',array('placement'=>'APPEND')); // $this->getElement('password')->addDecorator('HtmlTag',array('tag'=>'dl','class'=>'login_form')); // $this->getElement('submit')->addDecorator('Label',array('placement'=>'APPEND')); // $this->getElement('submit')->addDecorator('HtmlTag',array('tag'=>'dl','class'=>'login_form')); // $this->addDisplayGroup(array("username","password","submit"),'submitButtons',array( // 'decorators'=>array( // 'FormElements', // array('HtmlTag',array('tag'=>'div'), 'class' => 'form-buttons') // ) // ) // ); // $this->addDisplayGroup(array('submit', 'delete'), 'submitButtons', array( // 'decorators' => array( // 'FormElements', // array('HtmlTag', array('tag' => 'div', 'class' => 'form-buttons')), // ), // )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function setupform();", "function process_form()\n {\n }", "abstract public function forms();", "abstract public function getForm() : void;", "abstract protected function getForm();", "abstract function form();", "abstract function getForm();", "public function valiteForm();", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n }", "public function buildForm()\n {\n }", "function form();", "function YOUR_THEME_form($variables) {\n $element = $variables['element'];\n if (isset($element['#action'])) {\n $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);\n }\n element_set_attributes($element, array('method', 'id'));\n if (empty($element['#attributes']['accept-charset'])) {\n $element['#attributes']['accept-charset'] = \"UTF-8\";\n }\n return '<form' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</form>';\n}", "protected function Form_Run() {}", "abstract public function getFormDesc();", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "public function cs_generate_form() {\n global $post;\n }", "function form_init_elements()\r\n {\r\n // Swimmer handling\r\n $swimmer = new FERadioGroup(\"Swimmers\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimmer->set_br_flag(false) ;\r\n $this->add_element($swimmer) ;\r\n\r\n // Swim Meets handling\r\n $swimmeets = new FERadioGroup(\"Swim Meets\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimmeets->set_br_flag(false) ;\r\n $this->add_element($swimmeets) ;\r\n\r\n // Swim Teams handling\r\n $swimteams = new FERadioGroup(\"Swim Teams\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimteams->set_br_flag(false) ;\r\n $this->add_element($swimteams) ;\r\n }", "function ooForm( ) {\n\n $this->templateobj = new ooFormTemplate(); // $this->templateobj = new ooFormTemplate('templates'); this has to be changed to pass generic options to template engine as required by the engine, each is different, you can't put 'template' in here, you've got to pass an array of options meaningful to the engine.\n\n$this->params_list = $_REQUEST;\n\n//if( $this->debug ) {\n//\tprint \"<pre>\";\n//\tprint \"Dumping Constructor\\n\";\n//\tprint \"Field List\\n\";\n//\tprint_r( $this->fields_list );\n//\tprint \"CGI Parameters\\n\";\n//\tprint_r( $this->params_list );\n// \tprint \"</pre>\";\n//}\n\n }", "public function populateForm() {}", "public function getForm();", "protected abstract function printFormElements();", "private function setDefaults() {\r\n\t\t$this->type=formElement::TYPE_TEXT;\r\n\t\t$this->mulitple=false;\r\n\t\t$this->readOnly=false;\r\n\t\t$this->size=50;\r\n\t\t$this->max=0;\r\n\t\t$this->cols=100;\r\n\t\t$this->rows=10;\r\n\t\t$this->fieldWidth=300;\r\n\r\n\r\n\t\t$this->CSS='\r\n.form_text {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n\tbackground-color:#FFFFFF;\r\n}\r\n\r\n.form_text_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:2px solid #980000;\r\n\tbackground-color:#FFFFFF;\r\n}\r\n\r\n.form_select {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n}\r\n\r\n.form_select_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tfont-weight:bold;\r\n\tborder:2px solid #980000;\r\n\tbackground-color:#980000;\r\n\tcolor:#FFFFFF;\r\n}\r\n\r\n.form_checkbox {\r\n\r\n}\r\n\r\n.form_textarea {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:1px solid #3a5f7b;\r\n}\r\n\r\n.form_textarea_error {\r\n\tfont-family:tahoma,verdana;\r\n\tfont-size:12px;\r\n\tborder:2px solid #980000;\r\n}';\r\n\r\n\t\t$this->JS='\r\nfunction submitIfEnter(event, frm) {\r\n \tif (event && event.keyCode == 13) {\r\n \t\tfrm.onsubmit();\r\n \t} else {\r\n \t\treturn true;\r\n \t}\r\n}';\r\n\t}", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n\r\n\t\t// Org Code field\r\n\r\n $orgcode = new FEListBox(\"Organization\", true, \"150px\");\r\n $orgcode->set_list_data(SDIFCodeTableMappings::GetOrgCodes()) ;\r\n $this->add_element($orgcode) ;\r\n\r\n\t\t// Meet Name field\r\n\r\n $meetname = new FEText(\"Meet Name\", true, \"300px\");\r\n $this->add_element($meetname) ;\r\n\r\n\t\t// Meet Address 1 field\r\n\r\n $meetaddress1 = new FEText(\"Meet Address 1\", false, \"300px\");\r\n $this->add_element($meetaddress1) ;\r\n\r\n\t\t// Meet Address 2 field\r\n\r\n $meetaddress2 = new FEText(\"Meet Address 2\", false, \"300px\");\r\n $this->add_element($meetaddress2) ;\r\n\r\n // Meet State\r\n\r\n $meetstate = new FEUnitedStates(\"Meet State\", FT_US_ONLY, \"150px\");\r\n $this->add_element($meetstate) ;\r\n\r\n\t\t// Meet Postal Code field\r\n\r\n $meetpostalcode = new FEText(\"Meet Postal Code\", false, \"200px\");\r\n $this->add_element($meetpostalcode) ;\r\n\r\n // Meet Country\r\n\r\n $meetcountry = new FEListBox(\"Meet Country\", true, \"250px\");\r\n $meetcountry->set_list_data(SDIFCodeTableMappings::GetCountryCodes()) ;\r\n $meetcountry->set_readonly(FT_US_ONLY) ;\r\n $this->add_element($meetcountry) ;\r\n\r\n\t\t// Meet Code field\r\n\r\n $meetcode = new FEListBox(\"Meet Code\", true, \"150px\");\r\n $meetcode->set_list_data(SDIFCodeTableMappings::GetMeetCodes()) ;\r\n $this->add_element($meetcode) ;\r\n\r\n // Meet Start Field\r\n\r\n $meetstart = new FEDate(\"Meet Start\", true, null, null,\r\n \"Fdy\", date(\"Y\") - 3, date(\"Y\") + 7) ;\r\n $this->add_element($meetstart) ;\r\n\r\n // Meet End Field\r\n\r\n $meetend = new FEDate(\"Meet End\", true, null, null,\r\n \"Fdy\", date(\"Y\") - 3, date(\"Y\") + 7) ;\r\n $this->add_element($meetend) ;\r\n\r\n\t\t// Pool Altitude field\r\n\r\n $poolaltitude = new FENumber(\"Pool Altitude\", true, \"150px\") ;\r\n $this->add_element($poolaltitude) ;\r\n\r\n\t\t// Course Code field\r\n\r\n $coursecode = new FEListBox(\"Course Code\", true, \"150px\");\r\n $coursecode->set_list_data(SDIFCodeTableMappings::GetCourseCodes()) ;\r\n $this->add_element($coursecode) ;\r\n }", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n //Crea una caja de texto llamada nombre y longitud 50\r\n $elemT = new FEText(\"Asunto\", FALSE, 50);\r\n //$elemT->set_style_attribute('align', 'right');\r\n //Le asignamos el id nombre y la tecla de acceso n (ctrl+n)\r\n $elemT->set_attribute(\"id\",\"asunto\");\r\n $elemT->set_attribute(\"accesskey\",\"n\"); \r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemT);\r\n\t\r\n //Creamos un Area de Texto llamada comentario\r\n $elemTA = new FETextArea(\"Comentario\", FALSE, 10, 60,\"500px\", \"100px\");\r\n $elemTA->set_attribute('wrap', 'physical');\r\n //Le asignamos el id email y la tecla de acceso c (ctrl+c) \r\n $elemTA->set_attribute(\"id\",\"comentario\");\r\n $elemTA->set_attribute(\"accesskey\",\"d\");\r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemTA);\r\n\r\n //Añade un campo oculto llamado id. En ocasiones este campo se utiliza para indicar ciertas operaciones.\r\n //OJO!! es un punto sensible porque el usuario podría cambiar su valor de forma inexperada para el código.\r\n// $this->add_hidden_element(\"id\");\r\n\r\n //Añade un boton con la acción submit\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"miguel_Enter\"));\r\n //$submit->set_attribute('id',''); \r\n $submit->set_attribute('accesskey','e'); \r\n $this->add_element($submit); \r\n\t\t\t\t\r\n\t\t\t\t$this->add_hidden_element('status');\r\n \t\t$this->set_hidden_element_value('status', 'new');\r\n }", "public function form_elements() {\n\n\t\t\t// Instantiate Widget Inputs\n\t\t\t$form_elements = new Layers_Form_Elements();\n\n\t\t\t// Return design bar\n\t\t\treturn $form_elements;\n\n\t\t}", "function build_basic_form()\r\n {\r\n $this->addElement('select', LanguagePack :: PROPERTY_BRANCH, Translation :: get('Branch'), LanguagePack :: get_branch_options());\r\n \r\n \t$this->addElement('file', 'file', Translation :: get('FileName'));\r\n $allowed_upload_types = array('zip');\r\n $this->addRule('file', Translation :: get('OnlyZIPAllowed'), 'filetype', $allowed_upload_types);\r\n $this->addRule('file', Translation :: get('ThisFieldIsRequired', null, Utilities :: COMMON_LIBRARIES), 'required');\r\n \r\n // Submit button\r\n //$this->addElement('submit', 'user_settings', 'OK');\r\n $buttons[] = $this->createElement('style_submit_button', 'submit', Translation :: get('Import', null, Utilities :: COMMON_LIBRARIES), array('class' => 'positive'));\r\n $buttons[] = $this->createElement('style_reset_button', 'reset', Translation :: get('Reset', null, Utilities :: COMMON_LIBRARIES), array('class' => 'normal empty'));\r\n \r\n $this->addGroup($buttons, 'buttons', null, '&nbsp;', false);\r\n }", "protected function createFormFields() {\n\t}", "public function render(){\n\t\t$fhp; // form_helper_params\n\t\t$value = $this->_data['value'];\n\t\t$form_helper = 'input';\n\t\t$attributes = Arr::extract($this->_data,['id','required','maxlength','title','pattern','readonly','class','size','placeholder','multiple','accept','options']);\n\t\tif(!in_array($this->_data['type'],['radio'])) unset($attributes['options']);\n\t\tif($attributes['required']!==true) unset($attributes['required']);\n\t\tif($attributes['readonly']!==true) unset($attributes['readonly']);\n\t\tif(!$attributes['maxlength']) unset($attributes['maxlength']);\n\t\tif(!$attributes['size']) unset($attributes['size']);\n\t\t$fhp = [$this->_data['name'],$value,$attributes];\n\t\t//$name = $this->_data['name'];\n\t\t//open,close,input,button,checkbox,file,hidden,image,label,password,radio,select,submit,textarea,\n\t\t//$attr\n\t\tswitch($this->_data['type']){\n\t\t\tcase'form':\n\t\t\t\t$form_helper = $this->_data['data_type']; $fhp=[];\n\t\t\t\tbreak;\n\t\t\tcase'select':\n\t\t\t\t//unset\n\t\t\t\t$form_helper='select'; $fhp=[$this->_data['name'],$this->_data['options'],$value,$attributes];\n\t\t\t\tbreak;\n\t\t\tcase'checkbox':\n\t\t\t\t$fhp = [$this->_data['name'],1,!!($value),$attributes];\n\t\t\t\t$form_helper='checkbox';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//if($this->_data['type'] == 'radio') $fhp[2]['options'] = Arr::get($this->_data,'options');\n\t\t\t\tif(in_array($this->_data['type'],['file','select','checkbox','radio','hidden'])) $this->_data['inputtype'] = $this->_data['type'];\n\t\t\t\t//if()\n\t\t\t\tswitch($this->_data['data_type']){\n\t\t\t\t\tcase'int':\n\t\t\t\t\t\t$fhp[2]['type']='number';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase'text':\n\t\t\t\t\t\t$form_helper='textarea';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\tif($form_helper=='input') $fhp[2]['type']=$this->_data['inputtype'];\n\t\t/*switch($this->_data['data_type']){\n\t\t\tcase'form':\n\t\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\treturn call_user_func_array([$this,$form_helper],$fhp);\n\t\t//->($this->_data['name']);\n\t\t//return json_encode($this->_datations);\n\t\t//return \n\t\t}", "abstract public function createForm();", "abstract public function createForm();", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function CreateForm();", "function InputForm()\n\t{\t\n\t\tif (!$data = $this->details)\n\t\t{\t$data = $_POST;\n\t\t\tif (!$data)\n\t\t\t{\t$data = array('live'=>1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$form = new Form('pageedit.php?id=' . (int)$this->id, 'pageedit');\n\t\t$form->AddTextInput('Page title', 'pagetitle', $this->InputSafeString($data['pagetitle']), '', 50);\n\t\t$form->AddCheckBox('Hide title on page', 'hideheader', 1, $data['hideheader']);\n\t\t\n\t\tif ($parents = $this->GetPossibleParents())\n\t\t{\t$form->AddSelectWithGroups('Parent page', 'parentid', $data['parentid'], '', $parents, 1, 0, '');\n\t\t\t$form->AddCheckBox('Display as section of parent', 'inparent', 1, $data['inparent']);\n\t\t}\n\t\t\n\t\t$form->AddTextInput('Order in menu', 'pageorder', (int)$data['pageorder'], 'num', 4);\n\t\tif ($this->CanAdminUser('technical'))\n\t\t{\t$form->AddTextInput('Extra page to include', 'includefile', $this->InputSafeString($data['includefile']), '', 50);\n\t\t\t$form->AddCheckBox('Allow galleries', 'galleries', 1, $data['galleries']);\n\t\t}\n\t\t$form->AddCheckBox('Make live', 'pagelive', 1, $data['pagelive']);\n\t\t$form->AddCheckBox('Leave out of search results', 'nosearch', 1, $data['nosearch']);\n\t\t$form->AddCheckBox('Show social media links?', 'socialbar', 1, $data['socialbar']);\n\t\t$form->AddCheckBox('In header menu?', 'headermenu', 1, $data['headermenu']);\n\t\tif ($this->CanAdminUser('technical'))\n\t\t{\t$form->AddTextInput('Class for header menu', 'menuclass', $this->InputSafeString($data['menuclass']), '', 50);\n\t\t}\n\t\t$form->AddCheckBox('In footer menu?', 'footermenu', 1, $data['footermenu']);\n\t\t$form->AddCheckBox('Header only (no content)', 'headeronly', 1, $data['headeronly']);\n\t\t$form->AddTextInput('Redirect link (full address if external)', 'redirectlink', $this->InputSafeString($data['redirectlink']), 'long', 255);\n\t\t\n\t\tif ($this->id)\n\t\t{\t$form->AddTextInput('Slug (for URL)', 'pagename', $this->InputSafeString($data['pagename']), 'long', 255);\n\t\t\tif ($link = $this->Link())\n\t\t\t{\t$form->AddRawText('<p><label>Link to page</label><span><a href=\"' . $link . '\" target=\"_blank\">' . $link . '</a></span><br /></p>');\n\t\t\t}\n\t\t}\n\t\t$form->AddCheckBox('Display block link in parent (if any)', 'blocklink', 1, $data['blocklink']);\n\t\t$form->AddTextArea('Block link text', $name = 'pageintro', stripslashes($data['pageintro']), 'tinymce', 0, 0, 10, 60);\n\t\t$form->AddTextArea('Page content', $name = 'pagetext', stripslashes($data['pagetext']), 'tinymce', 0, 0, 50, 60);\n\t\t$form->AddRawText('<p><label></label><a href=\"#\" onclick=\"javascript:window.open(\\'newsimagelist.php\\', \\'newsimages\\', \\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=550\\'); return false;\">view available images</a></p>');\n\t\t$form->AddFileUpload('Subpage image:', 'imagefile');\n\t\tif ($src = $this->HasImage('thumbnail'))\n\t\t{\t$form->AddRawText('<label>Current image</label><img src=\"' . $src . '?' . time() . '\" height=\"200px\" /><br />');\n\t\t\t$form->AddCheckBox('Delete this', 'delphoto');\n\t\t}\n\t\t\n\t\tob_start();\n\t\techo '<label>Banner:</label><br /><label id=\"bannerPicked\">', ($data['banner'] && ($banner = new BannerSet($data['banner'])) && $banner->id) ? $this->InputSafeString($banner->details['title']) : 'none','</label><input type=\"hidden\" name=\"banner\" id=\"bannerValue\" value=\"', (int)$data['banner'], '\" /><span class=\"dataText\"><a onclick=\"BannerPicker();\">change this</a></span><br />';\n\t\t$form->AddRawText(ob_get_clean());\n\n\n\t\t$form->AddSubmitButton('', $this->id ? 'Save' : 'Create', 'submit');\n\t\techo $this->BannerPickerPopUp();\n\t\t\n\t\t$form->Output();\n\t}", "public function getFormFiller() {}", "public function getFormFiller() {}", "public function form( &$form )\n\t{\n\t}", "public static function getForm();", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: save PHP/CSS code');\r\n\r\n $code[] =& $this->createElement('checkbox', 'P', null, 'PHP');\r\n $code[] =& $this->createElement('checkbox', 'C', null, 'CSS');\r\n $this->addGroup($code, 'phpcss', 'PHP and/or StyleSheet source code:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('next','apply'));\r\n }", "function minorite_form($variables) {\n $element = $variables['element'];\n if (isset($element['#action'])) {\n $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);\n }\n element_set_attributes($element, array('method', 'id'));\n if (empty($element['#attributes']['accept-charset'])) {\n $element['#attributes']['accept-charset'] = \"UTF-8\";\n }\n return '<form' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</form>';\n}", "function buildSettingsForm() {}", "public function accessForm(): IFormElement;", "private function makeform() {\n\n\t$form=new llform($this);\n\t$form->addFieldset('upload','Upload a New Image');\n\t$form->addFieldset('filter','Filter Images');\n\t$form->addFieldset('sort','Sort Order');\n\t$form->addFieldset('boundingbox','Bounding Box');\n\t$form->addFieldset('display','Display Options');\n\t$form->addFieldset('gotopage','Go to page');\n\t\n\t$form->addControl('upload',new ll_edit($form,'imagename',25,40,'Image name (leave blank for file name)'));\n\t$form->addControl('upload',new ll_file($form,'file',5*1024*1024));\n\t$form->addControl('upload',new ll_button($form,'upload','Upload'));\n\t\n\t$form->addControl('filter',$rgf=new ll_radiogroup($form,'filter'));\n\t$rgf->setOptionArrayDual(array('showall','byname'),array('Show All Entries','Show those whose name starts ...'));\n\t$form->addControl('filter',new ll_edit($form,'filterstring',12,20,'... with the following string:'));\n\t$form->addControl('sort',$rgs=new ll_radiogroup($form,'sorttype'));\n\t$rgs->setOptionArrayDual(array('newestfirst','oldestfirst','name'),array('Newest First','Oldest First','By Name'));\n\t$form->addControl('display',new ll_edit($form,'numperpage',3,3,'Number of images per page'));\n\t$form->addControl('display',new ll_button($form,'update','Update Display'));\n\t$form->addControl('display',new ll_button($form,'defaults','Restore Defaults'));\n\t$form->addControl('boundingbox',new ll_edit($form,'maxwidth',3,3,'Max Width'));\n\t$form->addControl('boundingbox',new ll_edit($form,'maxheight',3,3,'Max Height'));\n\t\n\t$form->addControl('gotopage',new ll_button($form,'firstpage','<<< First Page'));\n\t$form->addControl('gotopage',new ll_button($form,'prevpage','<< Prev Page'));\n\t$form->addControl('gotopage',new ll_dropdown($form,'pagenum'));\n\t$form->addControl('gotopage',new ll_button($form,'nextpage','Next Page >>'));\n\t$form->addControl('gotopage',new ll_button($form,'lastpage','Last Page >>>'));\n\t\n\treturn $form;\n}", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "public function htmlForm(htmlPrps $htmlprps,$fields){\n\n }", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "function _setupForm(){\n\n //Defines the call back function for HTML Quickform to use when validating the form.\n $this->form->addFormRule(array(&$this,'XINValidate'));\n\n // display test name\n $this->form->addElement('header', 'instrument_title', \"Radiology Review Form\");\n\n // automatically adds examiner & date of administration\n $this->_addMetadataFields();\n\n $yes_no_option= array(NULL=>\"\", \"no\"=>\"No\", \"yes\"=>\"Yes\", \"not_answered\"=>\"Not Answered\");\n \t$normal_option= array(NULL=>\"\", \"normal\"=>\"Normal\",\"abnormal\"=>\"Abnormal\", \"atypical\"=>\"Atypical\", \"not_answered\"=>\"Not Answered\");\n \t$exclusionaryOrNot = array(NULL=>\"\", \"exclusionary\"=>\"Exclusionary\", \"non_exclusionary\"=>\"Non-Exclusionary\", \"not_answered\"=>\"Not Answered\");\n\n $this->form->addElement('header', null, '3D T1 MP-Rage');\n $this->form->addElement('select', 'Scan_done', 'Was an MRI performed?', $yes_no_option);\n \t$this->form->addElement('static', null, 'If Yes?'); \n\n \t//These date fields were first not added to $this->dateTimeFields so they weren't saving.\n// $this->form->addElement('date', 'MRI_date', 'Date of MRI acquisition');\n//\t $this->form->addElement('date', 'Review_date', 'Date of local radiology review');\n\n $this->addDateElement('MRI', 'Date of MRI acquisition');\n $this->XINRegisterRule(\"MRI_date\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\", \"MRI_date_group\");\n $this->addDateElement('Review', 'Date of local radiology review');\n $this->XINRegisterRule(\"Review_date\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\", \"Review_date_group\");\n\n $this->form->addElement('select', 'Review_results', 'Results of local radiology review?', $normal_option);\n $this->XINRegisterRule(\"Review_results\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\");\n\n $this->form->addElement('select', 'abnormal_atypical_exclusionary', $this->indent . \"If the results are ABNORMAL or ATYPICAL:\", $exclusionaryOrNot);\n $this->XINRegisterRule('abnormal_atypical_exclusionary', array('Review_results{@}=={@}abnormal|atypical'), \"Please indicate if the Abnormal or Atypical review is Exclusionary or Not.\");\n \n \t$this->form->addElement('static', null, $this->indent . $this->indent . 'If Abnormal or Atypical, describe incidental finding(s)'); \n// $this->form->addElement('textarea', 'Incidental_findings', 'Description of incidental findings:');\n $this->addTextAreaElement('Incidental_findings', $this->indent . $this->indent . 'Description of incidental findings:', array(\"Review_results{@}=={@}abnormal\"), \"Please describe the abnormality\");\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $table->add_row($this->element_label($this->getUploadFileLabel()),\r\n $this->element_form($this->getUploadFileLabel())) ;\r\n\r\n $td = html_td(null, null, $this->element_form('Override Z0 Record Validation')) ;\r\n $td->set_tag_attribute('colspan', 2) ;\r\n $table->add_row($td) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}", "abstract function setupForm(&$mform);", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n // Course Info \r\n $elemT1 = new FEText( \"courseName\", true, 10);\r\n $elemT1->set_style_attribute('align', 'left');\r\n $elemT1->set_attribute(\"id\",\"coursename\");\r\n $elemT1->set_attribute(\"accesskey\",\"n\"); \r\n $this->add_element($elemT1);\r\n\r\n $elemP1 = new FETextArea(\"coursedataDescripcion\", true, 10, 50, null, 300);\r\n $elemP1->set_style_attribute('align', 'left');\r\n $elemP1->set_attribute(\"id\",\"coursedatadescripcion\"); \r\n $elemP1->set_attribute(\"accesskey\",\"d\"); \r\n $this->add_element($elemP1);\r\n\r\n include(Util::app_Path(\"andromeda/include/classes/nls.inc.php\"));\r\n $language = $this->_formatElem(\"FEListBox\", \"courseLanguage\", \"courseLanguage\", FALSE, \"100px\", NULL, $nls['languages_form']);\r\n $language->set_style_attribute('align', 'left');\r\n $language->set_attribute(\"id\",\"courselanguage\");\r\n $language->set_attribute(\"accesskey\",\"l\"); \r\n $this->add_element($language);\r\n \r\n $elemT2 = new FEText( \"coursedataVersion\", FALSE, 10);\r\n $elemT2->set_style_attribute('align', 'left');\r\n $elemT2->set_attribute(\"id\",\"coursedataversion\");\r\n $elemT2->set_attribute(\"accesskey\",\"v\"); \r\n $this->add_element($elemT2);\r\n \r\n $elemP2 = new FETextArea(\"coursedataPalabrasClaves\", false, 10, 50, null, 300);\r\n $elemP2->set_style_attribute('align', 'left');\r\n $elemP2->set_attribute(\"id\",\"coursedatapalabrasclaves\");\r\n $elemP2->set_attribute(\"accesskey\",\"w\"); \r\n $this->add_element($elemP2);\r\n\r\n $elemT3 = new FEText( \"coursedataDestinatarios\", FALSE, 10);\r\n $elemT3->set_style_attribute('align', 'left');\r\n $elemT3->set_attribute(\"id\",\"coursedatadestinatarios\");\r\n $elemT3->set_attribute(\"accesskey\",\"u\"); \r\n $this->add_element($elemT3);\r\n \r\n $elemP3 = new FETextArea(\"coursedataConocimientosPrevios\", false, 10, 50, null, 300);\r\n $elemP3->set_style_attribute('align', 'left');\r\n $elemP3->set_attribute(\"id\",\"coursedataconocimientosprevios\");\r\n $elemP3->set_attribute(\"accesskey\",\"k\"); \r\n $this->add_element($elemP3);\r\n\r\n $elemT4 = new FEText( \"coursedataMetodologia\", FALSE, 10);\r\n $elemT4->set_style_attribute('align', 'left');\r\n $elemT4->set_attribute(\"id\",\"coursedatametodologia\");\r\n $elemT4->set_attribute(\"accesskey\",\"m\"); \r\n $this->add_element($elemT4);\r\n\r\n $elemCB1 = new FECheckBox('courseActive', agt('Poner el curso activo.') );\r\n $elemCB1->set_style_attribute('align', 'left');\r\n $elemCB1->set_attribute(\"id\",\"courseactive\"); \r\n $elemCB1->set_attribute(\"accesskey\",\"o\"); \r\n $this->add_element( $elemCB1 );\r\n\r\n $elemCB2 = new FECheckBox('courseAccess', agt('Poner el curso accesible.') ); \r\n $elemCB2->set_style_attribute('align', 'left');\r\n $elemCB2->set_attribute(\"id\",\"courseaccess\");\r\n $elemCB2->set_attribute(\"accesskey\",\"p\"); \r\n $this->add_element( $elemCB2 ); \r\n\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"Insertar Curso\"));\r\n $submit->set_attribute(\"id\",\"submit\"); \r\n $submit->set_attribute(\"accesskey\",\"e\"); \r\n $this->add_element($submit);\r\n }", "private function StartForm(){\r\n\t\t\t$this->formHTML .= \"<form method=\\\"{$this->method}\\\" action=\\\"{$this->action}\\\"\";\r\n\t\t\tif($this->enctype){\r\n\t\t\t\t$this->formHTML .= \" enctype=\\\"{$this->enctype}\\\"\";\r\n\t\t\t}\r\n\t\t\t$this->formHTML .= \" name=\\\"{$this->formName}\\\" class=\\\"c{$this->formName}\\\" id=\\\"i{$this->formName}\\\"\";\r\n\t\t\t$this->formHTML .= \">\";\r\n\t\t}", "function _renderForm( $data )\r\n {\r\n \t$user = JFactory::getUser();\r\n $vars = new JObject();\r\n $vars->onselection_text = $this->params->get('onselection', '');\r\n $html = $this->_getLayout('form', $vars);\r\n return $html;\r\n }", "abstract protected function _setNewForm();", "function _c_form($options)\n\t{\t \n\t\t\n\n\t\t\trequire_once(TEMPLATEPATH . '/template-helpers/contact_form.php');\n\t\t\t\n\t\t\t\n\t}", "public function createForm();", "public function createForm();", "function form( $instance ) {\n\n require( 'src/widget-fields.php' );\n }", "function weldata_form_alter(&$form, &$form_state){\n\n}", "protected function _readFormFields() {}", "abstract function builder_form(): string;", "function acf_form_head()\n{\n}", "function renderConfigForm() {\n\t}", "public function hookForm() {\n }", "function create_form(){\n\t\n\t$table =\"<html>\";\n\t$table.=\"<head>\";\n\t$table.=\"\t<title>New Article Entry Page</title>\";\n\t$table.=\"</head>\";\n\t\n\t// URL for the wordpress post handling page\n\t$link_admin_post = admin_url('admin-post.php');\n\t$table.=\"<form name = 'myform' method=\\\"POST\\\" action='\" . $link_admin_post . \"' id = \\\"form1\\\">\";\n\n\t// Input for Faculty member\n\t$table.= \"\t<br>\";\n\t$table.= \" <div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Tag\\\">Faculty Member/Tag: </label></p>\";\n\t$list_of_names = wp_post_tag_names();\n\t$table.=\"\t<select name=\\\"Tag\\\">\" . $list_of_names . \"</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for PMID\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"PMID\\\">PMID*: </label></p>\";\n\t$table.=\"\t<input type=\\\"number\\\" name=\\\"PMID\\\" id=\\\"PMID\\\" required>\";\n\t\n\t//autofill button\n\t$table.=' <a class=\"pmid\" data-test=\"hi\"><button id=\"autofill_btn\" type=\"button\" >Auto-Fill</button></a>';\n\t$table.=\"\t</div>\";\n\t\t\n\t// Input for Journal Issue\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label style=\\\"width: 200px;\\\" for=\\\"Journal_Issue\\\">Journal Issue: </label></p>\";\n\t$table.=\"\t<input id = 'issue' type=\\\"number\\\" name=\\\"Journal_Issue\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Volume\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Volume\\\">Journal Volume: </label></p>\";\n\t$table.=\"\t<input id = 'journal_volume' type=\\\"number\\\" name=\\\"Journal_Volume\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Title\\\">Journal Title: </label></p>\";\n\t$table.=\"\t<input id = 'journal_title' type=\\\"text\\\" name=\\\"Journal_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Year\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Year\\\">Journal Year: </label></p>\";\n\t$table.=\"\t<input id = 'year' value=\\\"2000\\\" type=\\\"number\\\" name=\\\"Journal_Year\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Month\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Month\\\">Journal Month: </label></p>\";\n\t$table.=\"\t<select id='journal_month' name=\\\"Journal Month\\\">\";\n\t$table.=\"\t\t<option value=\\\"01\\\">Jan</option>\";\n\t$table.=\"\t\t<option value=\\\"02\\\">Feb</option>\";\n\t$table.=\"\t\t<option value=\\\"03\\\">Mar</option>\";\n\t$table.=\"\t\t<option value=\\\"04\\\">Apr</option>\";\n\t$table.=\"\t\t<option value=\\\"05\\\">May</option>\";\n\t$table.=\"\t\t<option value=\\\"06\\\">Jun</option>\";\n\t$table.=\"\t\t<option value=\\\"07\\\">Jul</option>\";\n\t$table.=\"\t\t<option value=\\\"08\\\">Aug</option>\";\n\t$table.=\"\t\t<option value=\\\"09\\\">Sep</option>\";\n\t$table.=\"\t\t<option value=\\\"10\\\">Oct</option>\";\n\t$table.=\"\t\t<option value=\\\"11\\\">Nov</option>\";\n\t$table.=\"\t\t<option value=\\\"12\\\">Dec</option>\";\n\t$table.=\"\t</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Day\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Day\\\">Journal Day: </label></p>\";\n\t$table.=\"\t<input id = 'journal_day' type=\\\"text\\\" name=\\\"Journal_Day\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Date\\\">Journal Date: </label></p>\";\n\t$table.=\"\t<input id = 'journal_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Journal_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Abbreviation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Abbreviation\\\">Journal Abbreviation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_ab' type=\\\"text\\\" name=\\\"Journal_Abbreviation\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Journal Citation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Citation\\\">Journal Citation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_citation' type=\\\"text\\\" name=\\\"Journal_Citation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Title\\\">Article Title: </label></p>\";\n\t$table.=\"\t<input id=\\\"article_title\\\" type=\\\"text\\\" name=\\\"Article_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for article abstract\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Abstract\\\">Article Abstract: </label></p>\";\n\t$table.=\" <textarea id='abstract' rows = '4' cols = '60' name=\\\"Article_Abstract\\\"></textarea>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article URL\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_URL\\\">Article URL: </label></p>\";\n\t$table.=\"\t<input id = 'article_url' type=\\\"text\\\" name=\\\"Article_URL\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Pagination\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Pagination\\\">Article Pagination: </label></p>\";\n\t$table.=\"\t<input id='pages' type=\\\"text\\\" name=\\\"Article_Pagination\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Date\\\">Article Date: </label></p>\";\n\t$table.=\"\t<input id='article_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Article_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Authors\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Authors\\\">Article Authors: </label></p>\";\n\t$table.=\"\t<input id='article_authors' type=\\\"text\\\" name=\\\"Article_Authors\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Affiliations\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Affiliation\\\">Article Affiliation: </label></p>\";\n\t$table.=\"\t<input id = 'article_affiliation' type=\\\"text\\\" name=\\\"Article_Affiliation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Created\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Created\\\">Date Created: </label></p>\";\n\t$table.=\"\t<input id='date_created' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Created\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Completed\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Completed\\\">Date Completed: </label></p>\";\n\t$table.=\"\t<input id='date_completed' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Completed\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Date Revised\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Revised\\\">Date Revised: </label></p>\";\n\t$table.=\"\t<input id='date_revised' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Revised\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Hidden input (for specifying hook)\n\t$table.=\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new_article_form\\\">\";\n\t\n\t// Submit and reset buttons\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div id=\\\"form_btns\\\">\"; \n\t$table.=\"\t<button class=\\\"form_btn\\\"><input type=\\\"reset\\\" value=\\\"Reset!\\\" onclick=\\\"window.location.reload()\\\"></button>\";\n\t$table.=\"\t<input class=\\\"form_btn\\\" type=\\\"submit\\\" value=\\\"Submit\\\">\"; \n\t$table.=\"\t</div>\";\n\t$table.=\"</form>\";\n\n\t// Styling of the form (needs to be put in a seperate stylesheet)\n\t$table.=\"<style type=\\\"text/css\\\">\";\n\t$table.=\"\t#form_btns {\";\n\t$table.=\"\t\tmargin-left: 150px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.form_btn {\";\n\t$table.=\"\t\twidth: 80px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.label {\";\n\t$table.=\"\t\twidth: 150px;\";\n\t$table.=\"\t\tmargin: 0;\";\n\t$table.=\"\t\tfloat: left;\";\n\t$table.=\"\t}\";\n\t$table.=\"\tinput::placeholder {\";\n\t$table.=\"\t\tcolor: #a4a4a4;\";\n\t$table.=\"\t}\";\n\t$table.=\"</style>\";\n\t\n\t$table.=\"<script type='text/javascript' src=\" . plugin_dir_url(__FILE__) . \"js/autofill_ajax.js></script>\";\n\n \techo $table;\n}", "public function __construct($module = null, $fname = null, $group = null,\n $name = null, $title = null, $show = null, \n $disabled = null, $required = null, $type = null, \n $regex = null, $length = null, $min = null, \n $max = null, $selected = null, $checked = null, \n $value = null, $size = null, $cols = null,\n $rows = null, $source = null, $multiple = null,\n $btype = null, $text = null, $tclasses = null,\n $iclasses = null, $defines = null, $filters = null,\n $roles = null) {\n global $filelogger;\n\n $filelogger->debug(\"FormElement = [\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%) ]\",\n array(\n \"module\",$module,gettype($module),\"fname\",$fname,gettype($fname),\n \"group\",$group,gettype($group),\"btype\",$btype,gettype($btype),\n \"name\",$name,gettype($name),\"title\",$title,gettype($title),\n \"show\",$show,gettype($show),\"disabled\",$disabled,gettype($disabled),\n \"required\",$required,gettype($required),\"type\",$type,gettype($type),\n \"regex\",$regex,gettype($regex),\"length\",$length,gettype($length),\n \"min\",$min,gettype($min),\"max\",$max,gettype($max),\n \"selected\",$selected,gettype($selected),\"checked\",$checked,gettype($checked),\n \"value\",$value,gettype($value),\"size\",$size,gettype($size),\n \"cols\",$cols,gettype($cols),\"rows\",$rows,gettype($rows),\n \"source\",$source,gettype($source),\"multiple\",$multiple,gettype($multiple),\n \"text\",$text,gettype($text),\"tclasses\",$tclasses,gettype($tclasses),\n \"iclasses\",$iclasses,gettype($iclasses),\"defines\",$defines,gettype($defines),\n \"filters\",$filters,gettype($filters),\"roles\",$roles,gettype($roles)\n )\n ); \n \n $this->module = $module;\n $this->fname = $fname;\n $this->groupid = (Validator::equals($group,\"globals\") ? \"g\" : \"e\");\n $this->name = $name;\n $this->title = $title;\n $this->text = $text;\n\n $this->show = $show;\n $this->disabled = (Validator::equals($disabled,\"y\")\n ? \"disabled=\\\"disabled\\\"\" : \"\");\n $this->required = $required;\n\n $this->type = $type;\n $this->btype = $btype;\n\n $this->size = (Validator::matches($size,\"/^[1-9]{1}[0-9]*$/\")&&$size>0\n ? $size : 1);\n $this->length = (Validator::matches($length,\"/^[1-9]{1}[0-9]*$/\")&&$length>0\n ? $length : 254);\n $this->min = (Validator::matches($min,\"/^[1-9]{1}[0-9]*$/\")&&$min>0\n ? $min : 0);\n $this->max = (Validator::matches($max,\"/^[1-9]{1}[0-9]*$/\")&&$max>0\n ? $max : 100);\n\n $this->cols = (Validator::matches($cols,\"/^[1-9]{1}[0-9]*$/\")&&$cols>0\n ? $cols : 30);\n $this->rows = (Validator::matches($rows,\"/^[1-9]{1}[0-9]*$/\")&&$rows>0\n ? $rows : 3);\n\n $this->regex = $regex; // used to check values inserted on submit\n $this->value = $value;\n $this->source = $source;\n\n $this->selected = (Validator::equals($selected,\"y\")\n ? \"selected=\\\"selected\\\"\" : \"\");\n $this->checked = (Validator::equals($checked,\"y\")\n ? \"checked=\\\"checked\\\"\" : \"\");\n $this->multiple = (Validator::equals($multiple,\"y\")\n ? \"multiple=\\\"multiple\\\"\" : \"\");\n\n $this->tclasses = $tclasses;\n $this->iclasses = $iclasses;\n\n $this->defines = $defines; \n\n $this->filters = (Validator::matches($filters,\n \"/^[a-z]+(_{0,1}[a-z]+)*(,[a-z]+(_{0,1}[a-z]+)*)*$/\") \n ? $filters : \"string\"); \n $this->roles = (Validator::equals($roles,\"\") \n ? array(\"*\") : explode(\",\",$roles));\n\n }", "function do_form(){\n\t\tob_start();\n\t\t\n\t\t$op = ($this->id_base == $this->id)? __('Add', JCF_TEXTDOMAIN) : __('Edit', JCF_TEXTDOMAIN);\n\t\t?>\n\t\t<div class=\"jcf_edit_field\">\n\t\t\t<h3 class=\"header\"><?php echo $op . ' ' . $this->title; ?></h3>\n\t\t\t<div class=\"jcf_inner_content\">\n\t\t\t\t<form action=\"#\" method=\"post\" id=\"jcform_edit_field\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id\" value=\"<?php echo $this->id; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_number\" value=\"<?php echo $this->number; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id_base\" value=\"<?php echo $this->id_base; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"fieldset_id\" value=\"<?php echo $this->fieldset_id; ?>\" />\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->form( $this->instance );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// need to add slug field too\n\t\t\t\t\t\t\t$slug = esc_attr($this->slug);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('slug'); ?>\"><?php _e('Slug:', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('slug'); ?>\" name=\"<?php echo $this->get_field_name('slug'); ?>\" type=\"text\" value=\"<?php echo $slug; ?>\" />\n\t\t\t\t\t\t\t<br/><small><?php _e('Machine name, will be used for postmeta field name.', JCF_TEXTDOMAIN); ?></small>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// enabled field\n\t\t\t\t\t\t\tif( $this->is_new ){\n\t\t\t\t\t\t\t\t$this->instance['enabled'] = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('enabled'); ?>\">\n\t\t\t\t\t\t\t\t<input class=\"checkbox\" type=\"checkbox\" \n\t\t\t\t\t\t\t\t\t\tid=\"<?php echo $this->get_field_id('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tname=\"<?php echo $this->get_field_name('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tvalue=\"1\" <?php checked(true, @$this->instance['enabled']); ?> />\n\t\t\t\t\t\t\t\t<?php _e('Enabled', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"field-control-actions\">\n\t\t\t\t\t\t\t<div class=\"alignleft\">\n\t\t\t\t\t\t\t\t<?php if( $op != __('Add', JCF_TEXTDOMAIN) ) : ?>\n\t\t\t\t\t\t\t\t<a href=\"#remove\" class=\"field-control-remove\"><?php _e('Delete', JCF_TEXTDOMAIN); ?></a> |\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<a href=\"#close\" class=\"field-control-close\"><?php _e('Close', JCF_TEXTDOMAIN); ?></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"alignright\">\n\t\t\t\t\t\t\t\t<?php echo print_loader_img(); ?>\n\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save', JCF_TEXTDOMAIN); ?>\" class=\"button-primary\" name=\"savefield\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<br class=\"clear\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\t\t\n\t\t$html = ob_get_clean();\n\t\treturn $html;\n\t}", "function formelement($form,$lable,$name,$value,$type,$cattype=0,$tables=0,$opt=0,$mult=0){\n\tswitch ($type){\n\t\tcase 'hidden':\n\t\t\t$form->hiddenfield($name,$value);\n\t\tbreak;\n\t\tcase 'image':\n\t\t\tfor($i=0; $i<sizeof($tables); $i++){\n\t\t\t\tif($tables[$i]['table'] == $cattype) $n = $i;\n\t\t\t}\n\t\t\tif(isset($tables[$n]['imageproperties'])){\n\t\t\t\t$form->hiddenfield(\"imageproperties[$name][width]\",$tables[$n]['imageproperties'][\"$name\"]['width']);\n\t\t\t\t$form->hiddenfield(\"imageproperties[$name][height]\",$tables[$n]['imageproperties'][\"$name\"]['height']);\n\t\t\t\t$form->hiddenfield(\"imageproperties[$name][frame]\",$tables[$n]['imageproperties'][\"$name\"]['frame']);\n\t\t\t\t$note = \"Image will be cropped and resized to \".$tables[$n]['imageproperties'][\"$name\"]['width'].\" x \".$tables[$n]['imageproperties'][\"$name\"]['height'].\"\";\n\t\t\t}\n\t\t\t$form->hiddenfield('filelocation',$cattype);\n\t\t\t$imagename = $_GET['pg'].\"_\".$_GET['id'].\"_lg.jpg\";\n\t\t\t$form->filefield($lable,$name,'',$_GET['pg'],$_GET['id'],'image',$note);\n\t\t\tbreak;\n\t\tcase 'file':\n\t\t\tfor($i=0; $i<sizeof($tables); $i++){\n\t\t\t\tif($tables[$i]['table'] == $cattype) $n = $i;\n\t\t\t}\n\t\t\tif($opt && trim($opt) != '') $note = $opt;\n\t\t\telse $note = \"Upload .jpg, .pdf or .doc (Word document) file\";\n\t\t\t$form->hiddenfield('filelocation',$cattype);\n\t\t\t$form->filefield($lable,$name,$value,$_GET['pg'],$_GET['id'],'file',$note);\n\t\t\tbreak;\n\t\tcase 'textfield':\n\t\t\t$form->textfield($lable,$name,$value,$opt);\n\t\tbreak;\n\t\tcase 'textarea':\n\t\t\t$n = getKey($tables, $cattype);\n\t\t\tfor($i=0; $i<sizeof($tables[$n]['field']); $i++){\n\t\t\t\tif($tables[$n]['field'][$i] == $name) $x = $i;\n\t\t\t}\n\t\t\tif($tables[$n]['note'][$x] && $tables[$n]['note'][$x]!=\"\") $note = $tables[$n]['note'][$x];\n\t\t\telse $note = 0;\n\t\t\tif($name == 'description') $s = '250'; else $s = '60';\n\t\t\t$form->textarea($lable,$name,$value,$s,$note);\n\t\tbreak;\n\t\tcase 'selectbox':\n\t\t\t// **************************************************************\n\t\t\t// NOTE FOR JK: TRY TO MAKE THIS CONDITIONAL DATA WITHIN THE CONFIG FILE\n\t\t\t// **************************************************************\n\t\t\tif($name == 'category'){\n\t\t\t\t// GET ALL CATEGORIES FOR THIS PARTICULAR TYPE\n\t\t\t\t$x = mysql_query(\"SELECT * FROM `category` WHERE `type`='$cattype' AND `parent`='0'\");\n\t\t\t\twhile($xd = mysql_fetch_assoc($x)){\n\t\t\t\t\t$nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t\t\t$xdid = $xd['id'];\n\t\t\t\t\t$sx = mysql_query(\"SELECT * FROM `category` WHERE `type`='$cattype' AND `parent`='$xdid'\");\n\t\t\t\t\tif(mysql_num_rows($sx) > 0){\n\t\t\t\t\t\twhile($sxd = mysql_fetch_assoc($sx)) $nmvals .= $sxd['id'].',&nbsp;&middot;'.$sxd['title'].'|';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if($name == 'sub'){\n\t\t\t\tif($_GET['pg'] == 'bb_categories'){\n\t\t\t\t\t// GET ALL FORUM CATEGORIES\n\t\t\t\t\t$x = mysql_query(\"SELECT * FROM `bb_categories` WHERE `sub`='0'\");\n\t\t\t\t\twhile($xd = mysql_fetch_assoc($x)) $nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t\t} else {\n\t\t\t\t\t// GET ALL TOP LEVEL CATEGORIES\n\t\t\t\t\t$x = mysql_query(\"SELECT * FROM `category` WHERE `sub`=''\");\n\t\t\t\t\twhile($xd = mysql_fetch_assoc($x)) $nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t\t}\n\t\t\t} else if($name == 'products'){\n\t\t\t\t// GET ALL CATEGORIES FOR THIS PARTICULAR TYPE\n\t\t\t\t$x = mysql_query(\"SELECT * FROM `category` WHERE `type`='products' AND `subof`='0'\");\n\t\t\t\twhile($xd = mysql_fetch_assoc($x)){\n\t\t\t\t\t$nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t\t\t$xdid = $xd['id'];\n\t\t\t\t\t$sx = mysql_query(\"SELECT * FROM `products` WHERE `category`='$xdid' AND `active`='0' ORDER BY `title` ASC\");\n\t\t\t\t\tif(mysql_num_rows($sx) > 0){\n\t\t\t\t\t\twhile($sxd = mysql_fetch_assoc($sx)) $nmvals .= $sxd['id'].',&nbsp;&middot;'.$sxd['title'].'|';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if($name == 'options'){\n\t\t\t\t$x = mysql_query(\"SELECT * FROM `options` WHERE `active`='0' ORDER BY `title` ASC\");\n\t\t\t\twhile($xd = mysql_fetch_assoc($x)) $nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t\t\n\t\t\t} else if(TableExists($name, $default_dbname)){\n\t\t\t\t// IF THERE'S A DATABASE BY IT'S NAME, LIST ALL\n\t\t\t\t$x = mysql_query(\"SELECT * FROM `$name` ORDER BY `title`\");\n\t\t\t\tif(mysql_num_rows($x) > 0){\n\t\t\t\t\twhile($xd = mysql_fetch_assoc($x)) $nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t\t}\n\t\t\t\n\t\t\t} else {\n\t\t\t\t// **************************************************************\n\t\t\t\t// NOTE FOR JK: FOR THE MOST PART, THIS IS ALL THE CONDITIONAL YOU NEED\n\t\t\t\t// (FOR EVERYTHING OTHER THAN TYPE... as long as names are kept consistent)\n\t\t\t\t// **************************************************************\n\t\t\t\t$n = getKey($tables, $cattype);\n\t\t\t\tif( $tables[$n]['select'][\"$name\"] && eregi(\"\\|\",$tables[$n]['select'][\"$name\"]) ){\n\t\t\t\t\t$nmvals = $tables[$n]['select'][\"$name\"];\n\t\t\t\t} else if($tables[$n]['select'][\"$name\"]) {\n\t\t\t\t\t$db = $tables[$n]['select'][\"$name\"];\n\t\t\t\t\t$key = getKey($tables, $name);\n\t\t\t\t\t$listme = $tables[$key]['listme'];\n\t\t\t\t\t$x = mysql_query(\"SELECT * FROM `$db`\");\n\t\t\t\t\twhile($xd = mysql_fetch_assoc($x)){\n\t\t\t\t\t\tif(!is_array($listme) && $xd[\"$listme\"]){\n\t\t\t\t\t\t\t\t$title = stripslashes($qd[\"$listme\"]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tforeach($listme AS $k => $v){\n\t\t\t\t\t\t\t\tif($xd[$v]) $title .= $xd[$v];\n\t\t\t\t\t\t\t\telse $title .= $v;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$nmvals .= $xd['id'].','.$title.'|';\n\t\t\t\t\t\tunset($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tif(!isset($nmvals)) $form->errorfield($lable,$name,\"\".strtoupper($name).\" NEED TO BE ADDED\");\n\t\t\telse $form->selectbox($lable,$name,$nmvals,$value,$mult);\n\t\tbreak;\n\t\tcase 'selectmult':\n\t\t\tif(TableExists($name, $default_dbname)){\n\t\t\t\t// IF THERE'S A DATABASE BY IT'S NAME, LIST ALL\n\t\t\t\t$x = mysql_query(\"SELECT * FROM `$name` ORDER BY `title`\");\n\t\t\t\twhile($xd = mysql_fetch_assoc($x)) $nmvals .= $xd['id'].','.$xd['title'].'|';\n\t\t\t} else {\n\t\t\t\t// **************************************************************\n\t\t\t\t// NOTE FOR JK: FOR THE MOST PART, THIS IS ALL THE CONDITIONAL YOU NEED\n\t\t\t\t// (FOR EVERYTHING OTHER THAN TYPE... as long as names are kept consistent)\n\t\t\t\t// **************************************************************\n\t\t\t\t$n = getKey($tables, $cattype);\n\t\t\t\tif( $tables[$n]['select'][\"$name\"] && eregi(\"\\|\",$tables[$n]['select'][\"$name\"]) ){\n\t\t\t\t\t$nmvals = $tables[$n]['select'][\"$name\"];\n\t\t\t\t} else if($tables[$n]['select'][\"$name\"]) {\n\t\t\t\t\t$db = $tables[$n]['select'][\"$name\"];\n\t\t\t\t\t$key = getKey($tables, $name);\n\t\t\t\t\t$listme = $tables[$key]['listme'];\n\t\t\t\t\t$x = mysql_query(\"SELECT * FROM `$db`\");\n\t\t\t\t\twhile($xd = mysql_fetch_assoc($x)){\n\t\t\t\t\t\tif(!is_array($listme) && $xd[\"$listme\"]){\n\t\t\t\t\t\t\t\t$title = stripslashes($qd[\"$listme\"]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tforeach($listme AS $k => $v){\n\t\t\t\t\t\t\t\tif($xd[$v]) $title .= $xd[$v];\n\t\t\t\t\t\t\t\telse $title .= $v;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$nmvals .= $xd['id'].','.$title.'|';\n\t\t\t\t\t\tunset($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($nmvals)) $form->errorfield($lable,$name,\"\".strtoupper($name).\" NEED TO BE ADDED (mult)\");\n\t\t\telse $form->selectmult($lable,$name,$nmvals,$value);\n\t\tbreak;\n\t\tcase 'radiobuttonlist':\n\t\t\t// **************************************************************\n\t\t\t// NOTE FOR JK: TRY TO MAKE THIS CONDITIONAL DATA WITHIN THE CONFIG FILE\n\t\t\t// **************************************************************\n\t\t\tif($name == 'active'){\n\t\t\t\t$nmvals = '0,Yes|1,No';\n\t\t\t\tif($value == \"\") $value = '1';\n\t\t\t} else if($name == 'featured' && $nmvals == \"\"){\n\t\t\t\t$nmvals = '0,Featured|1,Not featured';\n\t\t\t\tif($value == \"\") $value = '1';\n\t\t\t}\n\t\t\t$form->radiobuttonlist($lable,$name,$nmvals,$value);\n\t\tbreak;\n\t\tcase 'checkbox':\n\t\t\t$form->checkbox($lable,$name,$value);\n\t\tbreak;\n\t\tcase 'textlist':\n\t\t\t$form->textlist($lable,$name,$value);\n\t\tbreak;\n\t\tcase 'text':\n\t\t\t$form->text($lable,$name,$value);\n\t\tbreak;\n\t}\n}", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }", "function item_form()\n\t{\n\t\t$its = new item_search($this->pg);\n\t\t$its->action = $_SESSION['root_admin'].'utilities/preorder.php';\n\t\t$its->form_head();\n\t\t$its->upc();\n\t\t$its->title();\n\t\t$its->platform();\n\t\t$its->form_foot('upc');\n\t}", "public function renderUploadForm() {}", "function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}", "public function createForm()\n {\n }", "static function build_form_standard($form) {\n if (!isset($_REQUEST['value'])) {\n $_REQUEST['value'] = \"\";\n }\n if (!isset($_REQUEST['option'])) {\n $_REQUEST['option'] = \"\";\n }\n if (!isset($_REQUEST['queryStatus'])) {\n $_REQUEST['queryStatus'] = false;\n }\n if (!isset($_REQUEST['oldsubaction'])) {\n $_REQUEST['oldsubaction'] = \"\";\n }\n if (!isset($form['unableInsert'])) {\n $form['unableInsert'] = false;\n }\n if (!isset($form['unableQuery'])) {\n $form['unableQuery'] = false;\n }\n if (!isset($form['unableUpdate'])) {\n $form['unableUpdate'] = false;\n }\n if (!isset($form['unableDelete'])) {\n $form['unableDelete'] = false;\n }\n if (!isset($form['unableBrowse'])) {\n $form['unableBrowse'] = false;\n }\n if (!isset($form['unableReport'])) {\n $form['unableReport'] = false;\n }\n if (!isset($form['fieldsPerRow'])) {\n $form['fieldsPerRow'] = 1;\n }\n if (!isset($form['show_not_nulls'])) {\n $form['show_not_nulls'] = false;\n }\n if (!isset($form['msj_not_null'])) {\n $form['msj_not_null'] = \"* Campos Requeridos!\";\n }\n if (!isset($form['buttons'])) {\n $form['buttons'] = array();\n $form['buttons'][\"insert\"] = \"Adicionar\";\n $form['buttons'][\"query\"] = \"Consultar\";\n $form['buttons'][\"browse\"] = \"Visualizar\";\n $form['buttons'][\"report\"] = \"Reporte\";\n \n } else {\n \tif (!isset($form['buttons'][\"insert\"])) {\n \t\t$form[\"buttons\"][\"insert\"] = \"Adicionar\";\n \t}\n \tif (!isset($form['buttons'][\"query\"])) {\n \t\t$form[\"buttons\"][\"query\"] = \"Consultar\";\n \t}\n \tif (!isset($form['buttons'][\"browse\"])) {\n \t\t$form[\"buttons\"][\"browse\"] = \"Visualizar\";\n \t}\n \tif (!isset($form['buttons'][\"report\"])) {\n \t\t$form[\"buttons\"][\"report\"] = \"Reporte\";\n \t}\n }\n $controller = Dispatcher::get_controller();\n $controller_name = Router::get_controller();\n if (!array_key_exists('dataRequisite', $form)) {\n $form['dataRequisite'] = 1;\n }\n if (!$form['dataRequisite']) {\n Generator::forms_print(\"<font style='font-size:11px'><div align='center'><i><b>No hay datos en consulta</b></i></div></font>\");\n } else {\n Generator::forms_print(\"<center>\");\n if ($_REQUEST['oldsubaction'] == 'Modificar') {\n $_REQUEST['queryStatus'] = true;\n }\n if ($controller->view != 'browse') {\n if (!$_REQUEST['queryStatus']) {\n if (!$form['unableInsert']) {\n $caption = $form['buttons']['insert'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='adiciona' value='$caption' lang='Adicionar' onclick='enable_insert(this)'>&nbsp;\");\n }\n if (!$form['unableQuery']) {\n $caption = $form['buttons']['query'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='consulta' value='$caption' lang='Consultar' onclick='enable_query(this)'>&nbsp;\\r\\n\");\n }\n $ds = \"disabled='disabled'\";\n } else {\n $query_string = get_kumbia_url(\"$controller_name/fetch/\");\n Generator::forms_print(\"<input type='button' id='primero' class='controlButton' onclick='window.location=\\\"{$query_string}0/&amp;queryStatus=1\\\"' value='Primero'>&nbsp;\");\n Generator::forms_print(\"<input type='button' id='anterior' class='controlButton' onclick='window.location=\\\"{$query_string}\" . ($_REQUEST['id'] - 1) . \"/&amp;queryStatus=1\\\"' value='Anterior'>&nbsp;\");\n Generator::forms_print(\"<input type='button' id='siguiente' class='controlButton' onclick='window.location=\\\"{$query_string}\" . ($_REQUEST['id'] + 1) . \"/&amp;queryStatus=1\\\"' value='Siguiente'>&nbsp;\");\n Generator::forms_print(\"<input type='button' id='ultimo' class='controlButton' onclick='window.location=\\\"{$query_string}last/&amp;queryStatus=1\\\"' value='Ultimo'>&nbsp;\");\n $ds = \"\";\n }\n //El Boton de Actualizar\n if ($_REQUEST['queryStatus']) {\n if (!$form['unableUpdate']) {\n if (isset($form['buttons']['update'])) {\n $caption = $form['buttons']['update'] ? $form['buttons']['update'] : \"Modificar\";\n } else {\n $caption = \"Modificar\";\n }\n if (isset($form['updateCondition'])) {\n if (strpos($form['updateCondition'], '@')) {\n ereg(\"[\\@][A-Za-z0-9_]+\", $form['updateCondition'], $regs);\n foreach($regs as $reg) {\n $form['updateCondition'] = str_replace($reg, $_REQUEST[\"fl_\" . str_replace(\"@\", \"\", $reg) ], $form['updateCondition']);\n }\n }\n $form['updateCondition'] = \" \\$val = (\" . $form['updateCondition'] . \");\";\n eval($form['updateCondition']);\n if ($val) {\n Generator::forms_print(\"<input type='button' class='controlButton' id='modifica' value='$caption' lang='Modificar' $ds onclick=\\\"enable_update(this)\\\">&nbsp;\");\n }\n } else {\n Generator::forms_print(\"<input type='button' class='controlButton' id='modifica' value='$caption' lang='Modificar' $ds onclick=\\\"enable_update(this)\\\">&nbsp;\");\n }\n }\n //El de Borrar\n if (!$form['unableDelete']) {\n if (isset($form['buttons']['delete'])) {\n $caption = $form['buttons']['delete'] ? $form['buttons']['delete'] : \"Borrar\";\n } else {\n $caption = \"Borrar\";\n }\n Generator::forms_print(\"<input type='button' class='controlButton' id='borra' value='$caption' lang='Borrar' $ds onclick=\\\"enable_delete()\\\">\\r\\n&nbsp;\");\n }\n }\n if (!$_REQUEST['queryStatus']) {\n if (!$form['unableBrowse']) {\n $caption = $form['buttons']['browse'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='visualiza' value='$caption' lang='Visualizar' onclick='enable_browse(this, \\\"$controller_name\\\")'>&nbsp;\\r\\n\");\n }\n }\n //Boton de Reporte\n if (!$_REQUEST['queryStatus']) {\n if (!$form['unableReport']) {\n $caption = $form['buttons']['report'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='reporte' value='$caption' lang='Reporte' onclick='enable_report(this)'>&nbsp;\\r\\n\");\n }\n } else {\n Generator::forms_print(\"<br /><br />\\n<input type='button' class='controlButton' id='volver' onclick='window.location=\\\"\" . get_kumbia_url(\"$controller_name/back\") . \"\\\"' value='Atr&aacute;s'>&nbsp;\\r\\n\");\n }\n Generator::forms_print(\"</center><br />\\r\\n\");\n Generator::forms_print(\"<table align='center'><tr>\\r\\n\");\n $n = 1;\n //La parte de los Componentes\n Generator::forms_print(\"<td align='right' valign='top'>\\r\\n\");\n foreach($form['components'] as $name => $com) {\n switch ($com['type']) {\n case 'text':\n Component::build_text_component($com, $name, $form);\n break;\n case 'combo':\n Component::build_standard_combo($com, $name);\n break;\n case 'helpText':\n Component::build_help_context($com, $name, $form);\n break;\n case 'userDefined':\n Component::build_userdefined_component($com, $name, $form);\n break;\n case 'time':\n Component::build_time_component($com, $name, $form);\n break;\n case 'password':\n Component::build_standard_password($com, $name);\n break;\n case 'textarea':\n Component::build_text_area($com, $name);\n break;\n case 'image':\n Component::build_standard_image($com, $name);\n break;\n //Este es el Check Chulito\n \n case 'check':\n if ($com['first']) {\n Generator::forms_print(\"<b>\" . $com['groupcaption'] . \"</b></td><td><table cellpadding=0>\");\n }\n Generator::forms_print(\"<tr><td>\\r\\n<input type='checkbox' disabled name='fl_$name' id='flid_$name' style='border:1px solid #FFFFFF'\");\n if ($_REQUEST['fl_' . $name] == $com['checkedValue']) {\n Generator::forms_print(\" checked='checked' \");\n }\n if ($com[\"attributes\"]) {\n foreach($com[\"attributes\"] as $nitem => $item) {\n Generator::forms_print(\" $nitem='$item' \");\n }\n }\n Generator::forms_print(\">\\r\\n</td><td>\" . $com['caption'] . \"</td></tr>\");\n if ($com[\"last\"]) Generator::forms_print(\"</table>\");\n break;\n //Textarea\n \n case 'textarea':\n Generator::forms_print(\"<b>\" . $com['caption'] . \" :</br></td><td><textarea disabled='disabled' name='fl_$name' id='flid_$name' \");\n foreach($com['attributes'] as $natt => $vatt) {\n Generator::forms_print(\"$natt='$vatt' \");\n }\n Generator::forms_print(\">\" . $_REQUEST['fl_' . $name] . \"</textarea>\");\n break;\n //Oculto\n \n case 'hidden':\n if (!isset($_REQUEST['fl_' . $name])) {\n $_REQUEST['fl_' . $name] = \"\";\n }\n Generator::forms_print(\"<input type='hidden' name='fl_$name' id='flid_$name' value='\" . (isset($com['value']) ? $com['value'] : $_REQUEST['fl_' . $name]) . \"'/>\\r\\n\");\n break;\n }\n if ($form['show_not_nulls']) {\n if ($com['type'] != 'hidden') {\n if (isset($com['notNull']) && $com['valueType'] != 'date') {\n Generator::forms_print(\"*\\n\");\n }\n }\n }\n if ($com['type'] != 'hidden') {\n Generator::forms_print(\"</td>\");\n if ($com['type'] == 'check') {\n if ($com['last']) {\n if (!($n % $form['fieldsPerRow'])) {\n Generator::forms_print(\"</tr><tr>\\r\\n\");\n }\n $n++;\n Generator::forms_print(\"<td align='right' valign='top'>\");\n }\n } else {\n if (!($n % $form['fieldsPerRow'])) {\n Generator::forms_print(\"</tr><tr>\\r\\n\");\n }\n $n++;\n Generator::forms_print(\"<td align='right' valign='top'>\");\n }\n }\n }\n if ($form['show_not_nulls']) {\n Generator::forms_print(\"</td></tr><tr><td colspan='2' align='center'><i class='requerido'>\" . $form['msj_not_null'] . \"</i></tr></td>\");\n }\n Generator::forms_print(\"<br /></td></tr><tr>\n\t\t\t\t<td colspan='2' align='center'>\n\t\t\t\t<div id='reportOptions' style='display:none' class='report_options'>\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t<td align='right'>\n\t\t\t\t<b>Formato Reporte:</b>\n\t\t\t\t\t<select name='reportType' id='reportType'>\n\t\t\t\t\t\t<option value='pdf'>PDF</option>\n\t\t\t\t\t\t<option value='xls'>EXCEL</option>\n\t\t\t\t\t\t<option value='doc'>WORD</option>\n\t\t\t\t\t\t<option value='html'>HTML</option>\n\t\t\t\t\t</select>\n\t\t\t\t</td>\n\t\t\t\t<td align='center'>\n\t\t\t\t<b>Ordenar Por:</b>\n\t\t\t\t\t<select name='reportTypeField' id='reportTypeField'>\");\n reset($form['components']);\n for ($i = 0;$i <= count($form['components']) - 1;$i++) {\n if (!isset($form['components'][key($form['components']) ]['notReport'])) {\n $form['components'][key($form['components']) ]['notReport'] = false;\n }\n if (!$form['components'][key($form['components']) ]['notReport']) {\n if (isset($form['components'][key($form['components']) ]['caption'])) {\n Generator::forms_print(\"<option value ='\" . key($form['components']) . \"'>\" . $form['components'][key($form['components']) ]['caption'] . \"</option>\");\n }\n }\n next($form['components']);\n }\n Generator::forms_print(\"</select>\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\t<br />\n\t\t\t\t</td>\n\t\t\t\t</tr>\");\n Generator::forms_print(\"</table><br />\\r\\n\");\n } else {\n /**\n * @see Browse\n */\n require_once \"library/kumbia/generator/browse.php\";\n Browse::formsBrowse($form);\n }\n //Todos los Labels\n Generator::forms_print(\"<script type='text/javascript'>\\nvar Labels = {\");\n $aLabels = \"\";\n foreach($form['components'] as $key => $com) {\n if (isset($com['caption'])) {\n $aLabels.= $key . \": '\" . $com['caption'] . \"',\";\n } else {\n $aLabels.= $key . \": '$key',\";\n }\n }\n $aLabels = substr($aLabels, 0, strlen($aLabels) - 1);\n Generator::forms_print(\"$aLabels};\\r\\n\");\n //Todos los campos\n Generator::forms_print(\"var Fields = [\");\n reset($form['components']);\n for ($i = 0;$i <= count($form['components']) - 1;$i++) {\n Generator::forms_print(\"'\" . key($form['components']) . \"'\");\n if ($i != (count($form['components']) - 1)) Generator::forms_print(\",\");\n next($form['components']);\n }\n Generator::forms_print(\"];\\r\\n\");\n //Campos que no pueden ser nulos\n Generator::forms_print(\"var NotNullFields = [\");\n reset($form['components']);\n $NotNullFields = \"\";\n for ($i = 0;$i <= count($form['components']) - 1;$i++) {\n if (!isset($form['components'][key($form['components']) ]['notNull'])) {\n $form['components'][key($form['components']) ]['notNull'] = false;\n }\n if (!isset($form['components'][key($form['components']) ]['primary'])) {\n $form['components'][key($form['components']) ]['primary'] = false;\n }\n if ($form['components'][key($form['components']) ]['notNull'] || $form['components'][key($form['components']) ]['primary']) {\n $NotNullFields.= \"'\" . key($form['components']) . \"',\";\n }\n next($form['components']);\n }\n $NotNullFields = substr($NotNullFields, 0, strlen($NotNullFields) - 1);\n Generator::forms_print(\"$NotNullFields];\\r\\n\");\n Generator::forms_print(\"var DateFields = [\");\n $dFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (isset($value['valueType'])) {\n if ($value['valueType'] == 'date') $dFields.= \"'\" . $key . \"',\";\n }\n }\n $dFields = substr($dFields, 0, strlen($dFields) - 1);\n Generator::forms_print(\"$dFields];\\r\\n\");\n //Campos que no son llave\n Generator::forms_print(\"var UFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!$value['primary']) {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos E-Mail\n Generator::forms_print(\"var emailFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (isset($value['valueType'])) {\n if ($value['valueType'] == 'email') {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos Time\n Generator::forms_print(\"var timeFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if ($value['type'] == 'time') {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos Time\n Generator::forms_print(\"var imageFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if ($value['type'] == 'image') {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos que son llave\n Generator::forms_print(\"var PFields = [\");\n $pFields = \"\";\n foreach($form['components'] as $key => $value) {\n if ($value['primary']) {\n $pFields.= \"'\" . $key . \"',\";\n }\n }\n $pFields = substr($pFields, 0, strlen($pFields) - 1);\n Generator::forms_print(\"$pFields];\\r\\n\");\n //Campos que son Auto Numericos\n Generator::forms_print(\"var AutoFields = [\");\n $aFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (isset($value['auto_numeric'])) {\n if ($value['auto_numeric']) {\n $aFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n Generator::forms_print(\"var queryOnlyFields = [\");\n $rFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['valueType'])) {\n $value['valueType'] = \"\";\n }\n if (!isset($value['queryOnly'])) {\n $value['queryOnly'] = false;\n }\n if ($value['valueType'] != 'date') {\n if ($value['queryOnly']) {\n $rFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $rFields = substr($rFields, 0, strlen($rFields) - 1);\n Generator::forms_print(\"$rFields];\\r\\n\");\n Generator::forms_print(\"var queryOnlyDateFields = [\");\n $rdFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['valueType'])) $value['valueType'] = \"\";\n if (!isset($value['queryOnly'])) $value['queryOnly'] = false;\n if ($value['valueType'] == 'date') {\n if ($value['queryOnly']) {\n $rdFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $rdFields = substr($rdFields, 0, strlen($rdFields) - 1);\n Generator::forms_print(\"$rdFields];\\r\\n\");\n Generator::forms_print(\"var AddFields = [\");\n $aFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['auto_numeric'])) {\n $value['auto_numeric'] = false;\n }\n if (!isset($value['attributes']['value'])) {\n $value['attributes']['value'] = false;\n }\n if ((!$value['auto_numeric']) && (!$value['attributes']['value'])) {\n $aFields.= \"'\" . $key . \"',\";\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n Generator::forms_print(\"var AutoValuesFields = [\");\n $aFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['auto_numeric'])) {\n $value['auto_numeric'] = false;\n }\n if ($value['auto_numeric']) {\n $aFields.= \"'\" . $key . \"',\";\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n Generator::forms_print(\"var AutoValuesFFields = [\");\n $aFields = \"\";\n if (!isset($db)) {\n $db = db::raw_connect();\n }\n foreach($form['components'] as $key => $value) {\n if (!isset($value['auto_numeric'])) $value['auto_numeric'] = false;\n if ($value['auto_numeric']) {\n ActiveRecord::sql_item_sanizite($key);\n ActiveRecord::sql_item_sanizite($form['source']);\n $q = $db->query(\"select max($key)+1 from \" . $form['source']);\n $row = $db->fetch_array($q);\n $aFields.= \"'\" . ($row[0] ? $row[0] : 1) . \"',\";\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n if (!isset($_REQUEST['param'])) {\n $_REQUEST['param'] = \"\";\n }\n Generator::forms_print(\"\\nnew Event.observe(window, \\\"load\\\", function(){\\n\");\n if ($controller->keep_action) {\n Generator::forms_print(\"\\tkeep_action('\" . $controller->keep_action . \"');\\n\");\n }\n Generator::forms_print(\"\\tregister_form_events()\\n})\\n</script>\\n\");\n if ($controller->view != 'browse') {\n Generator::forms_print(\"<center><input type='button' class='controlButton' id='aceptar' value='Aceptar' disabled='disabled' onclick='form_accept()' />&nbsp;\");\n Generator::forms_print(\"<input type='button' class='controlButton' id='cancelar' value='Cancelar' disabled='disabled' onclick='cancel_form()' />&nbsp;</center>\");\n Generator::forms_print(\"<input type='hidden' id='actAction' value='' />\\n\n\t\t\t\t</form>\n <form id='saveDataForm' method='post' action='' style='display:none' enctype=\\\"multipart/form-data\\\"></form>\");\n }\n }\n }", "public function Form() {\n\t\t$fields = new FieldSet();\n\t\t$fieldValidation = array();\n\t\t$fieldValidationRules = array();\n\t\t$CustomDisplayRules = \"\";\n\t\t$defaults = \"\";\n\t\t$this->SubmitButtonText = ($this->SubmitButtonText) ? $this->SubmitButtonText : _t('UserDefinedForm.SUBMITBUTTON', 'Submit');\n\t\tif($this->Fields()) {\n\t\t\tforeach($this->Fields() as $field) {\n\t\t\t\n\t\t\t\t$fieldToAdd = $field->getFormField();\n\t\t\t\t\n\t\t\t\tif(!$fieldToAdd) break;\n\t\t\t\t\n\t\t\t\t$fieldValidationOptions = array();\n\t\t\t\t\n\t\t\t\t// Set the Error Messages\n\t\t\t\t$errorMessage = sprintf(_t('Form.FIELDISREQUIRED').'.', strip_tags(\"'\". ($field->Title ? $field->Title : $field->Name) . \"'\"));\n\t\t\t\t$errorMessage = ($field->CustomErrorMessage) ? $field->CustomErrorMessage : $errorMessage;\n\t\t\t\t$fieldToAdd->setCustomValidationMessage($errorMessage);\n\t\t\t\t\n\t\t\t\t// Is this field required\n\t\t\t\tif($field->Required) {\n\t\t\t\t\t$fieldValidation[$field->Name] = $errorMessage;\n\t\t\t\t\t$fieldValidationOptions['required'] = true;\n\t\t\t\t\t$fieldToAdd->addExtraClass('requiredField');\n\t\t\t\t\tif(UserDefinedForm::$required_identifier) {\n\t\t\t\t\t\t$title = $fieldToAdd->Title() .\" <span class='requiredIdentifier'>\". UserDefinedForm::$required_identifier . \"</span>\";\n\t\t\t\t\t\t$fieldToAdd->setTitle($title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add field to the form\n\t\t\t\t$fields->push($fieldToAdd);\n\t\t\t\t\n\t\t\t\t// Ask our form field for some more information on hour it should be validated\n\t\t\t\t$fieldValidationOptions = array_merge($fieldValidationOptions, $field->getValidation());\n\t\t\t\t\n\t\t\t\t// Check if we have need to update the global validation\n\t\t\t\tif($fieldValidationOptions) {\n\t\t\t\t\t$fieldValidationRules[$field->Name] = $fieldValidationOptions;\n\t\t\t\t}\n\t\t\t\t$fieldId = $field->Name;\n\t\t\t\t\n\t\t\t\tif($field->ClassName == 'EditableFormHeading') { \n\t\t\t\t\t$fieldId = 'Form_Form_'.$field->Name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Is this Field Show by Default\n\t\t\t\tif(!$field->ShowOnLoad) {\n\t\t\t\t\t$defaults .= \"$(\\\"#\" . $fieldId . \"\\\").hide();\\n\";\n\t\t\t\t}\n\n\t\t\t\t// Check for field dependencies / default\n\t\t\t\tif($field->Dependencies()) {\n\t\t\t\t\tforeach($field->Dependencies() as $dependency) {\n\t\t\t\t\t\tif(is_array($dependency) && isset($dependency['ConditionField']) && $dependency['ConditionField'] != \"\") {\n\t\t\t\t\t\t\t// get the field which is effected\n\t\t\t\t\t\t\t$formName = Convert::raw2sql($dependency['ConditionField']);\n\t\t\t\t\t\t\t$formFieldWatch = DataObject::get_one(\"EditableFormField\", \"\\\"Name\\\" = '$formName'\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!$formFieldWatch) break;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// watch out for multiselect options - radios and check boxes\n\t\t\t\t\t\t\tif(is_a($formFieldWatch, 'EditableDropdown')) {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"select[name='\".$dependency['ConditionField'].\"']\\\")\";\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// watch out for checkboxs as the inputs don't have values but are 'checked\n\t\t\t\t\t\t\telse if(is_a($formFieldWatch, 'EditableCheckboxGroupField')) {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"input[name='\".$dependency['ConditionField'].\"[\".$dependency['Value'].\"]']\\\")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$fieldToWatch = \"$(\\\"input[name='\".$dependency['ConditionField'].\"']\\\")\";\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// show or hide?\n\t\t\t\t\t\t\t$view = (isset($dependency['Display']) && $dependency['Display'] == \"Hide\") ? \"hide\" : \"show\";\n\t\t\t\t\t\t\t$opposite = ($view == \"show\") ? \"hide\" : \"show\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// what action do we need to keep track of. Something nicer here maybe?\n\t\t\t\t\t\t\t// @todo encapulsation\n\t\t\t\t\t\t\t$action = \"change\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($formFieldWatch->ClassName == \"EditableTextField\" || $formFieldWatch->ClassName == \"EditableDateField\") {\n\t\t\t\t\t\t\t\t$action = \"keyup\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// is this field a special option field\n\t\t\t\t\t\t\t$checkboxField = false;\n\t\t\t\t\t\t\tif(in_array($formFieldWatch->ClassName, array('EditableCheckboxGroupField', 'EditableCheckbox'))) {\n\t\t\t\t\t\t\t\t$action = \"click\";\n\t\t\t\t\t\t\t\t$checkboxField = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and what should we evaluate\n\t\t\t\t\t\t\tswitch($dependency['ConditionOption']) {\n\t\t\t\t\t\t\t\tcase 'IsNotBlank':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '$(this).attr(\"checked\")' :'$(this).val() != \"\"';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'IsBlank':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '!($(this).attr(\"checked\"))' : '$(this).val() == \"\"';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'HasValue':\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '$(this).attr(\"checked\")' : '$(this).val() == \"'. $dependency['Value'] .'\"';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueLessThan':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() < parseFloat(\"'. $dependency['Value'] .'\")';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueLessThanEqual':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() <= parseFloat(\"'. $dependency['Value'] .'\")';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueGreaterThan':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() > parseFloat(\"'. $dependency['Value'] .'\")';\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ValueGreaterThanEqual':\n\t\t\t\t\t\t\t\t\t$expression = '$(this).val() >= parseFloat(\"'. $dependency['Value'] .'\")';\n\n\t\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$expression = ($checkboxField) ? '!($(this).attr(\"checked\"))' : '$(this).val() != \"'. $dependency['Value'] .'\"';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// put it all together\n\t\t\t\t\t\t\t$CustomDisplayRules .= $fieldToWatch.\".$action(function() {\n\t\t\t\t\t\t\t\tif(\". $expression .\" ) {\n\t\t\t\t\t\t\t\t\t$(\\\"#\". $fieldId .\"\\\").\".$view.\"();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$(\\\"#\". $fieldId .\"\\\").\".$opposite.\"();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';\n\t\t\n\t\t// Keep track of the referer\n\t\t$fields->push( new HiddenField( \"Referrer\", \"\", $referer ) );\n\t\t\t\t\n\t\t// Build actions\n\t\t$actions = new FieldSet(\n\t\t\tnew FormAction(\"process\", $this->SubmitButtonText)\n\t\t);\n\t\t\n\t\t// Do we want to add a clear form.\n\t\tif($this->ShowClearButton) {\n\t\t\t$actions->push(new ResetFormAction(\"clearForm\"));\n\t\t}\n\t\t\n\t\t// return the form\n\t\t$form = new Form($this, \"Form\", $fields, $actions, new RequiredFields(array_keys($fieldValidation)));\n\t\t$form->loadDataFrom($this->failover);\n\t\t\n\t\t$FormName = $form->FormName();\n\n\t\t// Set the Form Name\n\t\t$rules = $this->array2json($fieldValidationRules);\n\t\t$messages = $this->array2json($fieldValidation);\n\t\t\n\n\t\t// set the custom script for this form\n\t\tRequirements::customScript(<<<JS\n\t\t\t(function($) {\n\t\t\t\t$(document).ready(function() {\n\t\t\t\t\t$defaults\n\t\t\t\t\t$(\"#$FormName\").validate({\n\t\t\t\t\t\terrorClass: \"required\",\t\n\t\t\t\t\t\tmessages:\n\t\t\t\t\t\t\t$messages\n\t\t\t\t\t\t,\n\t\t\t\t\t\t\n\t\t\t\t\t\trules: \n\t\t\t\t\t\t \t$rules\n\t\t\t\t\t});\n\t\t\t\t\t$CustomDisplayRules\n\t\t\t\t});\n\t\t\t})(jQuery);\nJS\n);\n\n\t\treturn $form;\n\t}", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: run demo');\r\n\r\n $this->addElement('static', 'progressBar',\r\n 'Your progress meter looks like:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('reset','process'));\r\n }", "function initialize () {\n $this->set_openingtag ( \"<FORM[attributes]>\" );\n\t$this->set_closingtag ( \"</FORM>\" );\n }", "public function buildForm()\n {\n $this\n ->addMeasureList()\n ->addAscendingList()\n ->addTitles(['class' => 'indicator_title_title_narrative', 'narrative_true' => true])\n ->addDescriptions(['class' => 'indicator_description_title_narrative'])\n ->addCollection('reference', 'Activity\\Reference', 'reference', [], trans('elementForm.reference'))\n ->addAddMoreButton('add_reference', 'reference')\n ->addBaselines()\n ->addPeriods()\n ->addAddMoreButton('add_period', 'period')\n ->addRemoveThisButton('remove_indicator');\n }", "public function getFormAttribs() \n\t {\n return [\n 'EMP_ID'=>['type'=>Form::INPUT_TEXT, 'options'=>['placeholder'=>'Enter ...']],\n 'EMP_NM'=>['type'=>Form::INPUT_TEXT, 'options'=>['placeholder'=>'Enter ...']],\n 'EMP_IMG'=>['type'=>Form::INPUT_TEXT],\n // 'actions'=>['type'=>Form::INPUT_RAW, 'value'=>Html::submitButton('Submit', ['class'=>'btn btn-primary'])];\n ];\n }", "function InputForm()\n\t{\t\n\t\t$form = new Form($_SERVER[\"SCRIPT_NAME\"] . \"?id=\" . $this->id, \"crewcvForm\");\n\t\t$form->AddTextInput(\"City name\", \"cityname\", $this->InputSafeString($this->details[\"cityname\"]), \"\", 100);\n\t\t$form->AddSelect(\"Country\", \"country\", $this->id ? $this->details[\"country\"] : $_GET[\"ctry\"], \"\", $this->CountriesList(), true, true, \"onchange='GetFromEmail(\\\"country\\\", \\\"country\\\")';\");\n\t\t$form->AddTextInput(\"\\\"From\\\" email address\", \"emailfrom\", $this->InputSafeString($this->details[\"emailfrom\"]), \"long\", 255);\n\t\tif ($this->details[\"country\"])\n\t\t{\t$country = new Country($this->details[\"country\"]);\n\t\t\t$defemail = $country->EmailFrom();\n\t\t} else\n\t\t{\t$defemail = $this->GetParameter(\"emailfrom\");\n\t\t}\n\t\t$form->AddRawText(\"<label>Default \\\"From\\\" if not defined here</label><label id='ad_ak_emailfrom' class='content_label'>$defemail</label><br />\\n\");\n\t\t$form->AddSubmitButton(\"\", $this->id ? \"Save Changes\" : \"Create New City\", \"submit\");\n\t\tif ($histlink = $this->DisplayHistoryLink(\"cities\", $this->id))\n\t\t{\techo \"<p>\", $histlink, \"</p>\";\n\t\t}\n\t\tif ($this->CanDelete())\n\t\t{\techo \"<p><a href='\", $_SERVER[\"SCRIPT_NAME\"], \"?id=\", $this->id, \"&delete=1\", \n\t\t\t\t\t$_GET[\"delete\"] ? \"&confirm=1\" : \"\", \"'>\", $_GET[\"delete\"] ? \"please confirm you really want to \" : \"\", \n\t\t\t\t\t\"delete this city</a></p>\\n\";\n\t\t}\n\t\t$form->Output();\n\t}", "abstract public function bindForm();", "abstract public function bindForm();", "public function beforeHtml() {\n $form_name = $this->getAttribute('id');\n\n if ($this->getAttribute('method') == 'post') {\n\n $uni = session::getInstance()->createToken($form_name);\n\n $this->addHidden('token')->setValue($uni)->setId('token_' . $form_name);\n $this->addHidden('token_name')->setId('token_name' . $form_name)->setValue($form_name);\n }\n\n $classe = 'form';\n\n if ($this->getAttribute('class'))\n $classe = $this->getAttribute('class') . ' ' . $classe;\n\n $this->setAttribute('class',$classe);\n\n\t\treturn parent::beforeHtml(array(), 'form_' . $form_name);\n //return $this->processElementsWrap();\n\n\n //Old process code!!\n\n $hidden = array();\n\n $wrap_class = 'form_output_handler_' . $this->_wrapper;\n $wrapper = new $wrap_class($form_name);\n\n foreach ($this->_elements as $element) {\n if (!is_object($element))\n $wrapper->wrap($element,true);\n else {\n switch ($element->type) {\n case 'hidden':\n if ($element->getAttribute('name') == 'MAX_FILE_SIZE')\n $wrapper->wrap($element,true);\n else\n $hidden[] = $element->html();\n break;\n case 'submit':\n case 'reset':\n $wrapper->wrapSubmit($element);\n break;\n default:\n $wrapper->wrap($element);\n }\n }\n }\n\n return array(\n 'elements' => $wrapper->output($form_name) .\n implode(\"\\n\",$hidden)\n );\n }", "abstract protected function getFormIntroductionFields();", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "function minim_add_google_form_elements(&$vars) {\n $google_form = array(\n '#attached' => array(\n 'js' => array(\n '//docs.google.com/static/forms/client/js/1232204844-formviewer_prd.js' => array('type' => 'external'),\n drupal_get_path('theme', 'minim') . '/js/google/h5f.min.js',\n 1 => array(\n 'data' => 'H5F.setup(document.getElementById(\\'ss-form\\'));_initFormViewer(\"[100,\\x22#CCC\\x22,[[[1739364875,[[2,102,,\\x22\\x22]\\n]\\n]\\n]\\n]\\n]\\n\");', \n 'type' => 'inline',\n 'scope' => 'footer',\n ), \n ),\n 'css' => array(\n '//docs.google.com/static/forms/client/css/212514800-mobile_formview_ltr.css' => array('type' => 'external'),\n drupal_get_path('theme', 'minim') . '/css/google-form.css',\n ),\n ),\n );\n drupal_render($google_form);\n}", "function Form()\n\t{\n\t\tprint '<form name=\"myform\" action=\"' . THIS_PAGE . '\" method=\"post\">';\n\t\tforeach($this->aQuestion as $question)\n\t\t{//print data for each\n\t\t\t$this->createInput($question);\n\t\t}\n\t\tprint '<input type=\"hidden\" name=\"SurveyID\" value=\"' . $this->SurveyID . '\" />';\t\n\t\tprint '<input type=\"submit\" value=\"Submit!\" />';\t\n\t\tprint '</form>';\n\t}", "public function formAction() {}", "function options_form() {\n return array(\n );\n }", "function buildform( $elements, $type ) {\n $fixedelements = array(\n 'type' => array(\n 'type' => 'hidden',\n 'value' => $type\n ),\n 'mode' => array(\n 'type' => 'select',\n 'options' => array(\n 'd' => 'Display',\n 'xml' => 'Excel download'\n ),\n 'title' => 'Select output'\n ),\n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Generate report'\n ),\n );\n $formdef = array(\n 'name' => 'reportsetup',\n 'method' => 'post',\n 'autofocus' => 'true',\n 'elements' => array_merge( $elements, $fixedelements)\n );\n return $formdef;\n }", "function _renderForm($data) {\n\t\t$user = JFactory::getUser ();\n\t\t\n\t\t$vars = new JObject ();\n\t\t\n\t\t$html = $this->_getLayout ( 'form', $vars );\n\t\t\n\t\treturn $html;\n\t}", "function _renderForm($data) {\n\t\t$user = JFactory::getUser ();\n\t\t\n\t\t$vars = new JObject ();\n\t\t\n\t\t$html = $this->_getLayout ( 'form', $vars );\n\t\t\n\t\treturn $html;\n\t}", "public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('provider_activity_id', 'text', ['label' => trans('elementForm.provider_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('provider_org_narrative')\n ->addAddMoreButton('add_provider_org_narrative', 'provider_org_narrative');\n }", "function form($instance) {\r\n\t\t\t$defaults = array( \r\n\t\t\t\t'title' => __('Browser obsolete!', 'NoMoreIE6Please'), \r\n\t\t\t\t'nmwarning' => __('Browser has expired! Please install new one!', 'NoMoreIE6Please'),\r\n\t\t\t\t'nmiconsize' => '32',\r\n\t\t\t\t'nmbgwarning' => 'ffff00',\r\n\t\t\t\t'nmbrdwarning' => 'ea3d3d',\r\n\t\t\t\t'nmbrdwidthwarning' => '4',\r\n\t\t\t\t'nmmsie' => true,\r\n\t\t\t\t'nmfirefox' => true,\r\n\t\t\t\t'nmchrome' => true,\r\n\t\t\t\t'nmsafari' => true,\r\n\t\t\t\t'nmopera' => true,\r\n\t\t\t\t'nmversionmsie' => '7',\r\n\t\t\t\t'nmversionfirefox' => '3.6',\r\n\t\t\t\t'nmversionchrome' => '7',\r\n\t\t\t\t'nmversionsafari' => '4',\r\n\t\t\t\t'nmversionopera' => '8',\r\n\t\t\t\t'nmbrowserinvalidmsie' => true,\r\n\t\t\t\t'nmbrowserinvalidfirefox' => true,\r\n\t\t\t\t'nmbrowserinvalidchrome' => true,\r\n\t\t\t\t'nmbrowserinvalidsafari' => true,\r\n\t\t\t\t'nmbrowserinvalidopera' => true\r\n\t\t\t);\r\n\t\t\t$instance = wp_parse_args( (array) $instance, $defaults );\r\n\t\t\t\r\n\t?>\r\n<!-- Widget Title: Text Input -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id( 'title' ); ?>\">\r\n <?php _e('Title:', 'NoMoreIE6Please'); ?>\r\n </label>\r\n <input id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" value=\"<?php echo $instance['title']; ?>\" style=\"width:100%;\" />\r\n</p>\r\n<!-- Your Warning: Text Input -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id('nmwarning'); ?>\">\r\n <?php _e('Warning Message:', 'NoMoreIE6Please'); ?>\r\n </label>\r\n <input id=\"<?php echo $this->get_field_id('nmwarning'); ?>\" name=\"<?php echo $this->get_field_name( 'nmwarning' ); ?>\" value=\"<?php echo $instance['nmwarning']; ?>\" style=\"width:100%;\" />\r\n</p>\r\n<!-- Warning Backgroundcolor: Text Input -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id('nmbgwarning'); ?>\">\r\n <?php _e('Warning Background-Color (hex):', 'NoMoreIE6Please'); ?>\r\n </label><br />\r\n <input id=\"<?php echo $this->get_field_id('nmbgwarning'); ?>\" name=\"<?php echo $this->get_field_name( 'nmbgwarning' ); ?>\" value=\"<?php echo $instance['nmbgwarning']; ?>\" style=\"width:50px;\" />\r\n</p>\r\n<!-- Warning Bordercolor: Text Input -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id('nmbrdwarning'); ?>\">\r\n <?php _e('Warning Border-Color (hex) and Width (px):', 'NoMoreIE6Please'); ?>\r\n </label><br />\r\n <input id=\"<?php echo $this->get_field_id('nmbrdwarning'); ?>\" name=\"<?php echo $this->get_field_name( 'nmbrdwarning' ); ?>\" value=\"<?php echo $instance['nmbrdwarning']; ?>\" style=\"width:50px;\" />\r\n <input id=\"<?php echo $this->get_field_id('nmbrdwidthwarning'); ?>\" name=\"<?php echo $this->get_field_name( 'nmbrdwidthwarning' ); ?>\" value=\"<?php echo $instance['nmbrdwidthwarning']; ?>\" style=\"width:20px;\" />\r\n</p>\r\n<!-- Browsers: Check Boxes -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id('nmbrowsers'); ?>\">\r\n <?php _e('Available Browsers for Download:', 'NoMoreIE6Please'); ?>\r\n </label>\r\n <br />\r\n <input class=\"checkbox\" type=\"checkbox\" <?php checked( $instance['nmChrome'], true ); ?> id=\"<?php echo $this->get_field_id( 'nmChrome' ); ?>\" name=\"<?php echo $this->get_field_name( 'nmChrome' ); ?>\" />\r\n <label for=\"<?php echo $this->get_field_id( 'nmChrome' ); ?>\">Chrome</label>\r\n <br />\r\n <input class=\"checkbox\" type=\"checkbox\" <?php checked( $instance['nmFirefox'], true ); ?> id=\"<?php echo $this->get_field_id( 'nmFirefox' ); ?>\" name=\"<?php echo $this->get_field_name( 'nmFirefox' ); ?>\" />\r\n <label for=\"<?php echo $this->get_field_id( 'nmFirefox' ); ?>\">Firefox</label>\r\n <br />\r\n <input class=\"checkbox\" type=\"checkbox\" <?php checked( $instance['nmMSIE'], true ); ?> id=\"<?php echo $this->get_field_id( 'nmMSIE' ); ?>\" name=\"<?php echo $this->get_field_name( 'nmMSIE' ); ?>\" />\r\n <label for=\"<?php echo $this->get_field_id( 'nmMSIE' ); ?>\">MSIE</label>\r\n <br />\r\n <input class=\"checkbox\" type=\"checkbox\" <?php checked( $instance['nmOpera'], true ); ?> id=\"<?php echo $this->get_field_id( 'nmOpera' ); ?>\" name=\"<?php echo $this->get_field_name( 'nmOpera' ); ?>\" />\r\n <label for=\"<?php echo $this->get_field_id( 'nmOpera' ); ?>\">Opera</label>\r\n <br />\r\n <input class=\"checkbox\" type=\"checkbox\" <?php checked( $instance['nmSafari'], true ); ?> id=\"<?php echo $this->get_field_id( 'nmSafari' ); ?>\" name=\"<?php echo $this->get_field_name( 'nmSafari' ); ?>\" />\r\n <label for=\"<?php echo $this->get_field_id( 'nmSafari' ); ?>\">Safari</label>\r\n <br />\r\n</p>\r\n<!-- Icon Sizes: Select Box -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id( 'nmiconsize' ); ?>\">\r\n <?php _e('Icon Size in Pixels:', 'NoMoreIE6Please'); ?>\r\n </label>\r\n <select id=\"<?php echo $this->get_field_id( 'nmiconsize' ); ?>\" name=\"<?php echo $this->get_field_name( 'nmiconsize' ); ?>\" class=\"widefat\" style=\"width:100%;\">\r\n \r\n<?php\r\n $arr_icons = $this->ReturnIconSizes();\r\n\t\tforeach( $arr_icons as $size )\r\n\t\t{\r\n ?>\r\n <option <?php if ( $size == $instance['nmiconsize'] ) echo 'selected=\"selected\"'; ?>><?php echo $size; ?></option>\r\n <?php } ?>\r\n </select>\r\n</p>\r\n<!-- Expired Browser Name: Text Input -->\r\n<!-- Minimum Browser Version: Text Input -->\r\n<p>\r\n <label for=\"<?php echo $this->get_field_id('nmbrowserinvalid'); ?>\">\r\n <?php _e('Expired Browser(s) and minimum required version:', 'nmbrowserinvalid'); ?>\r\n </label>\r\n <div style=\"display:table;width:100%\">\r\n\t\t<?php\r\n\t\t$arr_browsers = $this->ReturnBrowsers();\r\n\t\tforeach( $arr_browsers as $code => $label )\r\n\t\t{\r\n\t\t?>\r\n\t\t<div style=\"display:table-row;\">\r\n\t\t\t<div style=\"display:table-cell;width:15px;\">\r\n\t\t\t<input type=\"checkbox\" <?php checked( $instance['nmbrowserinvalid'.$code], true ); ?> id=\"<?php echo $this->get_field_id( 'nmbrowserinvalid'.$code ); ?>\" name=\"<?php echo $this->get_field_name('nmbrowserinvalid'.$code); ?>\" />\r\n\t\t\t</div>\r\n\t\t\t<div style=\"display:table-cell;width:170px;text-align:left;\">\r\n\t\t\t<label for=\"<?php echo $this->get_field_id('nmbrowserinvalid'.$code); ?>\" ><?php echo $label; ?></label>\r\n\t\t\t</div>\r\n\t\t\t<div style=\"display:table-cell;\">\r\n\t\t\t<input id=\"<?php echo $this->get_field_id('nmversion'.$code); ?>\" name=\"<?php echo $this->get_field_name( 'nmversion'.$code ); ?>\" value=\"<?php echo $instance['nmversion'.$code]; ?>\" style=\"width:25px\" />\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t<?php\r\n\t }\r\n\t?>\r\n\t</div>\r\n</p>\r\n \r\n<?php\r\n\t$arr_browsers =\"\";\r\n\t\t}", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "private function _displayForm(){\n\t $moneda = Tools::getValue('moneda', $this->moneda);\n\t $iseuro = ($moneda == '978') ? ' selected=\"selected\" ' : '';\n\t $isdollar = ($moneda == '840') ? ' selected=\"selected\" ' : '';\n \t // Opciones para activar/desactivar SSL\n\t $ssl = Tools::getValue('ssl', $this->ssl);\n\t $ssl_si = ($ssl == 'si') ? ' checked=\"checked\" ' : '';\n\t $ssl_no = ($ssl == 'no') ? ' checked=\"checked\" ' : '';\n\t // Opciones para el comportamiento en error en el pago\n\t $error_pago = Tools::getValue('error_pago', $this->error_pago);\n\t $error_pago_si = ($error_pago == 'si') ? ' checked=\"checked\" ' : '';\n\t $error_pago_no = ($error_pago == 'no') ? ' checked=\"checked\" ' : '';\n\t // Opciones para activar los idiomas\n\t $idiomas_estado = Tools::getValue('idiomas_estado', $this->idiomas_estado);\n\t $idiomas_estado_si = ($idiomas_estado == 'si') ? ' checked=\"checked\" ' : '';\n\t $idiomas_estado_no = ($idiomas_estado == 'no') ? ' checked=\"checked\" ' : '';\n\t \n\t \n\t // Mostar formulario\n\t\t$this->_html .=\n\t\t'<form action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/contact.gif\" />'.$this->l('Configuraci&oacute;n del TPV').'</legend>\n\t\t\t\t<table border=\"0\" width=\"680\" cellpadding=\"0\" cellspacing=\"0\" id=\"form\">\n\t\t\t\t\t<tr><td colspan=\"2\">'.$this->l('Por favor completa la informaci&oacute;n requerida que te proporcionar&aacute; tu banco Servired.').'.<br /><br /></td></tr>\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('URL de llamada del entorno').'</td><td><input type=\"text\" name=\"urltpv\" value=\"'.Tools::getValue('urltpv', $this->urltpv).'\" style=\"width: 330px;\" /></td></tr>\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('Clave secreta de encriptaci&oacute;n').'</td><td><input type=\"password\" name=\"clave\" value=\"'.Tools::getValue('clave', $this->clave).'\" style=\"width: 200px;\" /></td></tr>\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('Nombre del comercio').'</td><td><input type=\"text\" name=\"nombre\" value=\"'.htmlentities(Tools::getValue('nombre', $this->nombre), ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td></tr>\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('N&uacute;mero de comercio (FUC)').'</td><td><input type=\"text\" name=\"codigo\" value=\"'.Tools::getValue('codigo', $this->codigo).'\" style=\"width: 200px;\" /></td></tr>\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('N&uacute;mero de terminal').'</td><td><input type=\"text\" name=\"terminal\" value=\"'.Tools::getValue('terminal', $this->terminal).'\" style=\"width: 80px;\" /></td></tr>\t\t\t\t\t\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('Tipo de moneda').'</td><td>\n\t\t\t\t\t<select name=\"moneda\" style=\"width: 80px;\"><option value=\"\"></option><option value=\"978\"'.$iseuro.'>EURO</option><option value=\"840\"'.$isdollar.'>DOLLAR</option></select></td></tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr><td width=\"215\" style=\"height: 35px;\">'.$this->l('Tipo de transacci&oacute;n').'</td><td><input type=\"text\" name=\"trans\" value=\"'.Tools::getValue('trans', $this->trans).'\" style=\"width: 80px;\" /></td></tr>\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/t/9.gif\" />'.$this->l('Personalizaci&oacute;n').'</legend>\n\t\t\t<table border=\"0\" width=\"680\" cellpadding=\"0\" cellspacing=\"0\" id=\"form\">\n\t\t<tr>\n\t\t\t<td colspan=\"2\">'.$this->l('Por favor completa los datos adicionales.').'.<br /><br /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td width=\"215\" style=\"height: 35px;\">'.$this->l('SSL en URL de validaci&oacute;n').'</td>\n\t\t\t<td>\n\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_1\" value=\"si\" '.$ssl_si.'/>\n\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Activado').'\" title=\"'.$this->l('Activado').'\" />\n\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_0\" value=\"no\" '.$ssl_no.'/>\n\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Desactivado').'\" title=\"'.$this->l('Desactivado').'\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td width=\"215\" style=\"height: 35px;\">'.$this->l('En caso de error, permitir elegir otro medio de pago').'</td>\n\t\t\t<td>\n\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_1\" value=\"si\" '.$error_pago_si.'/>\n\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Activado').'\" title=\"'.$this->l('Activado').'\" />\n\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_0\" value=\"no\" '.$error_pago_no.'/>\n\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Desactivado').'\" title=\"'.$this->l('Desactivado').'\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td width=\"215\" style=\"height: 35px;\">'.$this->l('Activar los idiomas en el TPV').'</td>\n\t\t\t<td>\n\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_si\" value=\"si\" '.$idiomas_estado_si.'/>\n\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Activado').'\" title=\"'.$this->l('Activado').'\" />\n\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_no\" value=\"no\" '.$idiomas_estado_no.'/>\n\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Desactivado').'\" title=\"'.$this->l('Desactivado').'\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t\t</fieldset>\t\n\t\t\t<br>\n\t\t<input class=\"button\" name=\"btnSubmit\" value=\"'.$this->l('Guardar configuraci&oacute;n').'\" type=\"submit\" />\n\t\t\t\t\t\n\t\t\t\n\t\t</form>';\n\t}", "function form_adcedc() {\n\tGLOBAL $mdbGlobal, $HTTP_REFERER, $TABLERELATIONS;\n echo \"\n <form method=\\\"post\\\" action=\\\"\\\">\n \".inputhidden('w', $mdbGlobal->w).\"\n \".inputhidden('op', $mdbGlobal->sw).\"\n \".(($mdbGlobal->Debug)? inputhidden('Debug', $mdbGlobal->Debug).\"\\n\" : \"\")\n .inputhidden('type', $this->contentType).\"\n \".inputhidden('ref', stripslashes($HTTP_REFERER)).\"\n <table border=\\\"0\\\">\";\n\n $startField = 3; \n $this->GetContentInfo();\n for ($it=$startField;$it<$this->nFields;$it++) {\n inputfield($this->fields[$it], $this->recordSet, $this->values[$it], $this->info, $this->relations);\n }\n $startField = 3; \n $this->GetExtraInfo();\n for ($it=$startField;$it<$this->nExtFields;$it++) {\n inputfield($this->extFields[$it], $this->recordSet, $this->extValues[$it], $this->extInfo, $this->extRelations);\n }\n echo \"\n <tr><td><br /></td><td>\".\n inputbtn('bt', _KINTUN).\n inputbtn('bt', _BATAL).\n </td></tr>\n </table>\n </form>\";\n }\n\n /**\n * @call this->GetContentField\n * @call this->GetExtraInfo\n * @call this->ParseFieldDefs\n * @call inputfield \n */\n function form_adc() {\n GLOBAL $mdbGlobal, $mDB, $MDBTABLE;\n \n $this->GetExtraInfo();\n echo \"\n <h2>\"._ADC.\"::\".$this->extInfo['name'].\"</h2>\"; \n $this->form_adcedc();\n\n }", "function renderForm()\t{\n\n\t\t$fields[] = $this->renderField( $GLOBALS['LANG']->getLL('settings'), 'divider', '');\n\t\t$fields[] = $this->renderField( $GLOBALS['LANG']->getLL('spaceTitle'), 'text', 'title');\n\t\n\t\tif(count($this->error) > 0) {\n\t\t\t$form .= \"<span style='display:block;color:red;font-weight:bold;padding:10px;'>\" .\n\t\t\t\t\t\t\t implode(\"<br />\", $this->error) . \n\t\t\t\t\t \"</span>\";\t\n\t\t}\n\n\t\t$form .= \"<form action=\" . t3lib_div::getThisUrl() . \"><table border='0' cellpadding='7'>\";\n\t\t$form .= implode(\"\\n\", $fields);\n\t\t$form .= \"<tr><td colspan='2' align='right'>\" .\n\t\t\t\t \"<input type='hidden' name='formPosted' value='1'>\" . \n\t\t\t\t \"<input type='submit' value='\" . $GLOBALS['LANG']->getLL('createSpace') . \"'></td></tr></table></form>\";\n\n\t\treturn $form;\n\t}" ]
[ "0.70815796", "0.7052315", "0.70244145", "0.6962559", "0.69529533", "0.6883156", "0.68140525", "0.679794", "0.6797373", "0.6731621", "0.6712162", "0.6701932", "0.6694654", "0.6683633", "0.6682502", "0.6675057", "0.66741616", "0.66686964", "0.6653027", "0.66251785", "0.65799326", "0.65796286", "0.65509963", "0.65142125", "0.6513766", "0.6511295", "0.6491769", "0.6490984", "0.6487913", "0.6487913", "0.64836097", "0.64766973", "0.6467291", "0.6466762", "0.6457965", "0.6457965", "0.6451818", "0.6436336", "0.6431321", "0.64255244", "0.64185095", "0.64163256", "0.641209", "0.6407873", "0.63991964", "0.63874686", "0.6382865", "0.63737285", "0.6343912", "0.63351303", "0.63231945", "0.6319556", "0.6319446", "0.6317118", "0.63115174", "0.6289404", "0.62711984", "0.6267429", "0.626487", "0.626487", "0.62619114", "0.62602115", "0.62552905", "0.6254746", "0.6253301", "0.6245419", "0.6241569", "0.62369514", "0.6214844", "0.6211992", "0.6211973", "0.62004817", "0.6199594", "0.618953", "0.61815894", "0.61780584", "0.6177318", "0.61767906", "0.6160855", "0.6141741", "0.6140854", "0.61349", "0.6131754", "0.61298263", "0.61298263", "0.61204714", "0.6119766", "0.6118267", "0.61123216", "0.61016697", "0.60917854", "0.60900927", "0.6086366", "0.6084481", "0.6084481", "0.6083053", "0.6082532", "0.60825205", "0.60751575", "0.6075087", "0.60738343" ]
0.0
-1
/ check user is a admin or not
public function adminCheck($userName) { $userName = mysqli_real_escape_string($GLOBALS['db'], $userName); $userCheck = "SELECT * FROM admin WHERE userName='$userName' LIMIT 1"; $result = mysqli_query($GLOBALS['db'], $userCheck); return mysqli_num_rows($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isAdminUser() {}", "function is_user_admin()\n {\n }", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "private function isAdmin() {\n\t\tif (Auth::user()->user == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function isAdmin();", "function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function isUserAdmin() {\r\n $user = $_SESSION['user'];\r\n return checkAdminStatus($user);\r\n }", "public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }", "public function isAdmin() {}", "public function isAdmin()\n {\n return ($this->username === \"admin\");\n }", "public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}", "public function checkIsAdmin()\n {\n return $this->user_admin;\n }", "public function checkAdmin();", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin() {\n return ($this->userType == 'admin');\n }", "protected function userIsAdmin ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n\n if($datosUsers->nombre==\"admin\")\n {\n return true;\n }\n else\n {\n return false;\n } \n }", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "public function isAdmin(){\n if($this->role==\"admin\"){\n return true;\n }\n return false;\n }", "function isAdmin(){\n\t\treturn ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME);\n\t}", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function isAdmin() {\n return $this->admin; // cerca la colonna admin nella tabella users\n }", "public function adminUserConditionMatchesAdminUser() {}", "public function getIsAdmin();", "public function getIsAdmin();", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "function isAdmin() {\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "public function isAdmin()\n {\n }", "function isAdmin() {\n\tif (isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'admin' ) {\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function isAdmin(){\n return $this->role=='admin';\n }", "function _isUserAdmin(){\n\n $output = 0;\n $userId = $this->session->userdata('userId');\n $user = $this->User_model->getUserByUserId($userId);\n $userRoleId = $user->user_roles_id;\n $userRole = $this->Roles_model->getUserRoleById($userRoleId);\n if($userRole->role === 'admin'){\n $output = 1;\n }\n return $output;\n }", "function is_admin()\n\t{\n\t\treturn strtolower($this->ci->session->userdata('DX_role_name')) == 'admin';\n\t}", "public function checkAdmin()\n {\n // there ..... need\n // END Check\n $auth = false;\n if($auth) {\n return true;\n }\n else{\n return false;\n }\n }", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "function is_admin(){\r\n if (isset($_SESSION['admin']) && $_SESSION['admin']){\r\n return true;\r\n }\r\n return false;\r\n }", "public function is_admin()\n\t{\n\t\t$user = $this->get_current_user();\n\t\tif($user !== NULL)\n\t\t{\n\t\t\tif($user['auth'] == 255)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function checkAdminLogin() \n{\n\tif(checkNotLogin())\n\t{\n\t\treturn false;\n\t}\n\t\n\t$user = $_SESSION['current_user'];\n\t\n\tif($user->isAdmin())\n\t{\n\t\treturn true;\n\t}\n\telse \n\t{\n\t\treturn false;\n\t}\n}", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "function isAdmin()\n\t{\n\t\treturn $this->role == 3;\n\t}", "static function getIsAdmin() {\n\t\t$user = ctrl_users::GetUserDetail();\n\t\tif($user['usergroupid'] == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function IsAdmin ();", "public function isAdmin()\n {\n return ($this->type === User::ADMIN_USER);\n }", "public function isAdmin()\n {\n return $this->role == 1;\n }", "public function isAdmin()\n {\n return $this->hasCredential('admin');\n }", "function checkAdmin()\n\t {\n\t \tif(!$this->checkLogin())\n\t \t{\n\t \t\treturn FALSE;\n\t \t}\n\t \treturn TRUE;\n\t }", "protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}", "public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }", "public static function isAdmin()\n {\n if (Yii::$app->user->isGuest) {\n return false;\n }\n $model = User::findOne(['username' => Yii::$app->user->identity->username]);\n if ($model == null) {\n return false;\n } elseif ($model->id_user_role == 1) {\n return true;\n }\n return false;\n }", "public function is_user_admin($user) {\n return $user['user_admin'] == 1;\n }", "public function isAdmin(){\n if($this->role->name = 'Administrator'){\n return true;\n }\n return false;\n }", "public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }", "private function isAdmin() : bool\n {\n return $this->role('admin');\n }", "public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }", "function IsAdmin()\n{\n\treturn false;\n}", "public function isAdmin()\n {\n return ((string) strtoupper($this->data->user_role) === \"ADMIN\") ? true : false;\n }", "private function isAdmin() : bool\n {\n return $this->user->hasRole('admin');\n }", "function is_admin() {\n\tif(\n\t\tisset($_SESSION['admin']->iduser) \n\t\t&& !empty($_SESSION['admin']->iduser) \n\t\t&& $_SESSION['admin']->type = 'admin'\n\t\t&& $_SESSION['active']->type = 1\n\t\t&& $_SESSION['confirmed']->type = 1\n\t) return TRUE;\n\t\t\t\n\treturn FALSE;\n}", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "function isAdmin() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 1) {\n return true;\n } else {\n return false;\n }\n }", "function iAmAdmin(){\n $adminIDs = Array( 1, 2 );\n \n return in_array( $_SESSION['userid'], $adminIDs );\n }", "function is_admin()\n{\n global $app;\n if (is_authenticated()) {\n $user = $app->auth->getUserData();\n return ($user['role'] === '1');\n } else {\n return false;\n }\n}", "public function isAdmin(): bool\n {\n return $this->is_admin === true;\n }", "public function isAdmin()\n {\n return $this->isSuperUser() || $this->isMemberOf('admin');\n }", "public function isAdmin(){\n $role = $this->role->type;\n\n return $role === 'admin';\n }", "public static function isAdmin(): bool {\n if ($user = self::user() && self::user()->isAdmin) {\n return true;\n }\n return false;\n }", "public static function isAdmin()\n\t{\n\t\treturn in_array( Auth::user()->username, Config::get( 'admin.usernames' ) );\n\t}", "function getIsAdmin(){\n\t\treturn ( $this->user && $this->user->access_level >= User::LEVEL_ADMIN );\n\t}", "public function getIsAdministrator() {}", "public function isAdmin()\n {\n return (\\Auth::user()->role == 'admin');\n }", "function user_is_admin() {\n\tif(user_is_connect() && $_SESSION['membre']['statut'] == 2) {\n\t\t// si l'utilisateur est connecté et que son statut est égal à 2 alors il est admin\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }", "public function isAdmin()\n {\n return ($this->role == 1) ? true : false;\n }", "function _lean_is_admin() {\n global $user;\n if (in_array('administrator', array_values($user->roles))) {\n return true;\n } else {\n return false;\n }\n}", "public static function isAdmin(){\n if(self::exists('auth_type')&& self::get('auth_type')=='admin'){\n return true;\n }else\n return false;\n\n }", "public function isAdmin()\n {\n return $this->role == 'admin';\n }", "function user_AuthIsAdmin() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['admin']) && ($AUTH['admin'] === 1);\n}", "public function isAdmin() {\n return $this->hasPermission('is_admin');\n }", "private function check_if_user_is_admin()\n {\n $user = wp_get_current_user();\n $tasks_performer = new TasksPerformer;\n if (!$tasks_performer->is_mtii_admin()) {\n exit(\"Woof Woof Woof\");\n }\n }", "function isAdminUser($userstatus) {\n\t\tif ($userstatus == 'Y') {\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "static public function isAdmin(){\n if ( isset($_SESSION['admin']) && ($_SESSION['admin'] == 1)){\n return true;\n } else {\n return false;\n }\n }", "function is_admin()\r\n{\r\n if(is_auth() && $_SESSION['user']['statut'] == 1)\r\n {\r\n return true;\r\n }\r\n return false;\r\n}", "public function isAdmin()\n {\n return $this->getAttribute('type') === User::ADMIN_TYPE;\n }", "function checkUserIsAdmin()\n {\n $user_db = new SafeMySQL();\n\n $user_id = htmlentities($_SESSION[SES_NAME]['user_id'], ENT_QUOTES, 'UTF-8');\n\n if($user_db->getRow(\"SELECT user_id FROM app_users WHERE user_status = 'Active' AND user_id = ?s\",$user_id)){\n return true;\n } else {\n return false;\n }\n\n }", "public function isAdmin() {\n return ($this->userlevel == ADMIN_LEVEL ||\n $this->username == ADMIN_NAME);\n }", "public function _isAdmin() {\n\t\t$user_id = $this->Auth->user('id');\n\t\t$aro = array('model' => 'User', 'foreign_key' => $user_id); \n\t\t$aco = 'role/super/admin';\n\t\treturn $this->Acl->check($aro, $aco);\n\t}", "public function isAdmin()\n {\n return $this->user_role === User::ROLE_ADMIN;\n }", "public static function isAdmin()\n {\n \t$user = Session::get('loginuser');\n \tif ($user == env('ADMINEMAIL')) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public function memberIsAdmin()\n {\n return $_SESSION['__COMMENTIA__']['member_role'] === 'admin';\n }", "protected static function isAdminUser() {\r\n throw new \\Excpetion('yet to implement');\r\n }", "public function isAdmin()\n {\n return $this->role == 'Administrator' ? true : false;\n }", "public static function requireAdmin() {\n\t$status = (Yii::$app->user->identity->roles == 'admin') ? true : false;\n return $status\n }", "public static function isAdmin()\n {\n return auth()->check() && auth()->user()->panichd_admin;\n }", "private function checkAdmin()\n {\n $admin = false;\n if (isset($_SESSION['admin'])) {\n F::set('admin', 1);\n $admin = true;\n }\n F::view()->assign(array('admin' => $admin));\n }", "function is_admin() {\n\tglobal $connection;\n\n\tif(isLoggedIn()) {\n\t\t$query = \"SELECT user_role FROM users WHERE user_id =\" . $_SESSION['user_id']. \"\";\n\t\t$result = mysqli_query($connection, $query);\n\t\tconfirm($result);\n\n\t\t$row = mysqli_fetch_array($result);\n\n\t\treturn $row['user_role'] === 'admin' ? true : false;\n\t}\n}", "private function checkIfUserIsAdmin($user)\n {\n return true;\n }", "private function isAdmin() {\n\t\t$user = $this->userSession->getUser();\n\t\tif ($user !== null) {\n\t\t\treturn $this->groupManager->isAdmin($user->getUID());\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.9059217", "0.8803054", "0.8685618", "0.8625834", "0.8623593", "0.8517481", "0.8450326", "0.8432522", "0.8422506", "0.84020555", "0.8390204", "0.83601296", "0.8356367", "0.83554244", "0.83417857", "0.83309317", "0.83309317", "0.8330796", "0.82925355", "0.82635057", "0.8256107", "0.82298195", "0.8225028", "0.8199165", "0.81935453", "0.8161219", "0.81494135", "0.8141513", "0.8141513", "0.8140831", "0.8123578", "0.8116989", "0.8116398", "0.8114953", "0.80952626", "0.8090086", "0.8083193", "0.8077437", "0.80763936", "0.8073842", "0.8071295", "0.8063725", "0.80580264", "0.8057222", "0.8050245", "0.80425924", "0.8039723", "0.803762", "0.8031548", "0.80312526", "0.8030558", "0.80269325", "0.8024912", "0.80225265", "0.80160683", "0.8012075", "0.8010291", "0.80054194", "0.8004048", "0.8001312", "0.8001151", "0.7997104", "0.7995859", "0.7991336", "0.79828554", "0.7978751", "0.7972753", "0.79721093", "0.7970094", "0.7964339", "0.79621214", "0.7960281", "0.7959837", "0.7953707", "0.7950333", "0.7944334", "0.7943871", "0.79435563", "0.79399276", "0.7938308", "0.79320633", "0.79183036", "0.7916569", "0.79052776", "0.78962445", "0.78936666", "0.7890861", "0.78853476", "0.78818023", "0.7881618", "0.78795385", "0.786269", "0.7859457", "0.78466815", "0.7845112", "0.78443927", "0.78426445", "0.78381014", "0.78372383", "0.78353155", "0.7832036" ]
0.0
-1
/ check user is a admin or not
public function moderatorCheck($userName) { $userName = mysqli_real_escape_string($GLOBALS['db'], $userName); $userCheck = "SELECT * FROM moderator WHERE userName='$userName' LIMIT 1"; $result = mysqli_query($GLOBALS['db'], $userCheck); return mysqli_num_rows($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isAdminUser() {}", "function is_user_admin()\n {\n }", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "private function isAdmin() {\n\t\tif (Auth::user()->user == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function isAdmin();", "function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function isUserAdmin() {\r\n $user = $_SESSION['user'];\r\n return checkAdminStatus($user);\r\n }", "public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }", "public function isAdmin() {}", "public function isAdmin()\n {\n return ($this->username === \"admin\");\n }", "public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}", "public function checkIsAdmin()\n {\n return $this->user_admin;\n }", "public function checkAdmin();", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin() {\n return ($this->userType == 'admin');\n }", "protected function userIsAdmin ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n\n if($datosUsers->nombre==\"admin\")\n {\n return true;\n }\n else\n {\n return false;\n } \n }", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "public function isAdmin(){\n if($this->role==\"admin\"){\n return true;\n }\n return false;\n }", "function isAdmin(){\n\t\treturn ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME);\n\t}", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function isAdmin() {\n return $this->admin; // cerca la colonna admin nella tabella users\n }", "public function adminUserConditionMatchesAdminUser() {}", "public function getIsAdmin();", "public function getIsAdmin();", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "function isAdmin() {\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "public function isAdmin()\n {\n }", "function isAdmin() {\n\tif (isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'admin' ) {\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function isAdmin(){\n return $this->role=='admin';\n }", "function _isUserAdmin(){\n\n $output = 0;\n $userId = $this->session->userdata('userId');\n $user = $this->User_model->getUserByUserId($userId);\n $userRoleId = $user->user_roles_id;\n $userRole = $this->Roles_model->getUserRoleById($userRoleId);\n if($userRole->role === 'admin'){\n $output = 1;\n }\n return $output;\n }", "function is_admin()\n\t{\n\t\treturn strtolower($this->ci->session->userdata('DX_role_name')) == 'admin';\n\t}", "public function checkAdmin()\n {\n // there ..... need\n // END Check\n $auth = false;\n if($auth) {\n return true;\n }\n else{\n return false;\n }\n }", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "function is_admin(){\r\n if (isset($_SESSION['admin']) && $_SESSION['admin']){\r\n return true;\r\n }\r\n return false;\r\n }", "public function is_admin()\n\t{\n\t\t$user = $this->get_current_user();\n\t\tif($user !== NULL)\n\t\t{\n\t\t\tif($user['auth'] == 255)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function checkAdminLogin() \n{\n\tif(checkNotLogin())\n\t{\n\t\treturn false;\n\t}\n\t\n\t$user = $_SESSION['current_user'];\n\t\n\tif($user->isAdmin())\n\t{\n\t\treturn true;\n\t}\n\telse \n\t{\n\t\treturn false;\n\t}\n}", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "function isAdmin()\n\t{\n\t\treturn $this->role == 3;\n\t}", "static function getIsAdmin() {\n\t\t$user = ctrl_users::GetUserDetail();\n\t\tif($user['usergroupid'] == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function IsAdmin ();", "public function isAdmin()\n {\n return ($this->type === User::ADMIN_USER);\n }", "public function isAdmin()\n {\n return $this->role == 1;\n }", "public function isAdmin()\n {\n return $this->hasCredential('admin');\n }", "function checkAdmin()\n\t {\n\t \tif(!$this->checkLogin())\n\t \t{\n\t \t\treturn FALSE;\n\t \t}\n\t \treturn TRUE;\n\t }", "protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}", "public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }", "public static function isAdmin()\n {\n if (Yii::$app->user->isGuest) {\n return false;\n }\n $model = User::findOne(['username' => Yii::$app->user->identity->username]);\n if ($model == null) {\n return false;\n } elseif ($model->id_user_role == 1) {\n return true;\n }\n return false;\n }", "public function is_user_admin($user) {\n return $user['user_admin'] == 1;\n }", "public function isAdmin(){\n if($this->role->name = 'Administrator'){\n return true;\n }\n return false;\n }", "public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }", "private function isAdmin() : bool\n {\n return $this->role('admin');\n }", "public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }", "function IsAdmin()\n{\n\treturn false;\n}", "public function isAdmin()\n {\n return ((string) strtoupper($this->data->user_role) === \"ADMIN\") ? true : false;\n }", "private function isAdmin() : bool\n {\n return $this->user->hasRole('admin');\n }", "function is_admin() {\n\tif(\n\t\tisset($_SESSION['admin']->iduser) \n\t\t&& !empty($_SESSION['admin']->iduser) \n\t\t&& $_SESSION['admin']->type = 'admin'\n\t\t&& $_SESSION['active']->type = 1\n\t\t&& $_SESSION['confirmed']->type = 1\n\t) return TRUE;\n\t\t\t\n\treturn FALSE;\n}", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "function isAdmin() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 1) {\n return true;\n } else {\n return false;\n }\n }", "function iAmAdmin(){\n $adminIDs = Array( 1, 2 );\n \n return in_array( $_SESSION['userid'], $adminIDs );\n }", "function is_admin()\n{\n global $app;\n if (is_authenticated()) {\n $user = $app->auth->getUserData();\n return ($user['role'] === '1');\n } else {\n return false;\n }\n}", "public function isAdmin(): bool\n {\n return $this->is_admin === true;\n }", "public function isAdmin()\n {\n return $this->isSuperUser() || $this->isMemberOf('admin');\n }", "public function isAdmin(){\n $role = $this->role->type;\n\n return $role === 'admin';\n }", "public static function isAdmin(): bool {\n if ($user = self::user() && self::user()->isAdmin) {\n return true;\n }\n return false;\n }", "public static function isAdmin()\n\t{\n\t\treturn in_array( Auth::user()->username, Config::get( 'admin.usernames' ) );\n\t}", "function getIsAdmin(){\n\t\treturn ( $this->user && $this->user->access_level >= User::LEVEL_ADMIN );\n\t}", "public function getIsAdministrator() {}", "public function isAdmin()\n {\n return (\\Auth::user()->role == 'admin');\n }", "function user_is_admin() {\n\tif(user_is_connect() && $_SESSION['membre']['statut'] == 2) {\n\t\t// si l'utilisateur est connecté et que son statut est égal à 2 alors il est admin\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }", "public function isAdmin()\n {\n return ($this->role == 1) ? true : false;\n }", "function _lean_is_admin() {\n global $user;\n if (in_array('administrator', array_values($user->roles))) {\n return true;\n } else {\n return false;\n }\n}", "public static function isAdmin(){\n if(self::exists('auth_type')&& self::get('auth_type')=='admin'){\n return true;\n }else\n return false;\n\n }", "public function isAdmin()\n {\n return $this->role == 'admin';\n }", "function user_AuthIsAdmin() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['admin']) && ($AUTH['admin'] === 1);\n}", "public function isAdmin() {\n return $this->hasPermission('is_admin');\n }", "private function check_if_user_is_admin()\n {\n $user = wp_get_current_user();\n $tasks_performer = new TasksPerformer;\n if (!$tasks_performer->is_mtii_admin()) {\n exit(\"Woof Woof Woof\");\n }\n }", "function isAdminUser($userstatus) {\n\t\tif ($userstatus == 'Y') {\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "static public function isAdmin(){\n if ( isset($_SESSION['admin']) && ($_SESSION['admin'] == 1)){\n return true;\n } else {\n return false;\n }\n }", "function is_admin()\r\n{\r\n if(is_auth() && $_SESSION['user']['statut'] == 1)\r\n {\r\n return true;\r\n }\r\n return false;\r\n}", "public function isAdmin()\n {\n return $this->getAttribute('type') === User::ADMIN_TYPE;\n }", "function checkUserIsAdmin()\n {\n $user_db = new SafeMySQL();\n\n $user_id = htmlentities($_SESSION[SES_NAME]['user_id'], ENT_QUOTES, 'UTF-8');\n\n if($user_db->getRow(\"SELECT user_id FROM app_users WHERE user_status = 'Active' AND user_id = ?s\",$user_id)){\n return true;\n } else {\n return false;\n }\n\n }", "public function isAdmin() {\n return ($this->userlevel == ADMIN_LEVEL ||\n $this->username == ADMIN_NAME);\n }", "public function _isAdmin() {\n\t\t$user_id = $this->Auth->user('id');\n\t\t$aro = array('model' => 'User', 'foreign_key' => $user_id); \n\t\t$aco = 'role/super/admin';\n\t\treturn $this->Acl->check($aro, $aco);\n\t}", "public function isAdmin()\n {\n return $this->user_role === User::ROLE_ADMIN;\n }", "public static function isAdmin()\n {\n \t$user = Session::get('loginuser');\n \tif ($user == env('ADMINEMAIL')) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public function memberIsAdmin()\n {\n return $_SESSION['__COMMENTIA__']['member_role'] === 'admin';\n }", "protected static function isAdminUser() {\r\n throw new \\Excpetion('yet to implement');\r\n }", "public function isAdmin()\n {\n return $this->role == 'Administrator' ? true : false;\n }", "public static function requireAdmin() {\n\t$status = (Yii::$app->user->identity->roles == 'admin') ? true : false;\n return $status\n }", "public static function isAdmin()\n {\n return auth()->check() && auth()->user()->panichd_admin;\n }", "private function checkAdmin()\n {\n $admin = false;\n if (isset($_SESSION['admin'])) {\n F::set('admin', 1);\n $admin = true;\n }\n F::view()->assign(array('admin' => $admin));\n }", "function is_admin() {\n\tglobal $connection;\n\n\tif(isLoggedIn()) {\n\t\t$query = \"SELECT user_role FROM users WHERE user_id =\" . $_SESSION['user_id']. \"\";\n\t\t$result = mysqli_query($connection, $query);\n\t\tconfirm($result);\n\n\t\t$row = mysqli_fetch_array($result);\n\n\t\treturn $row['user_role'] === 'admin' ? true : false;\n\t}\n}", "private function checkIfUserIsAdmin($user)\n {\n return true;\n }", "private function isAdmin() {\n\t\t$user = $this->userSession->getUser();\n\t\tif ($user !== null) {\n\t\t\treturn $this->groupManager->isAdmin($user->getUID());\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.9059217", "0.8803054", "0.8685618", "0.8625834", "0.8623593", "0.8517481", "0.8450326", "0.8432522", "0.8422506", "0.84020555", "0.8390204", "0.83601296", "0.8356367", "0.83554244", "0.83417857", "0.83309317", "0.83309317", "0.8330796", "0.82925355", "0.82635057", "0.8256107", "0.82298195", "0.8225028", "0.8199165", "0.81935453", "0.8161219", "0.81494135", "0.8141513", "0.8141513", "0.8140831", "0.8123578", "0.8116989", "0.8116398", "0.8114953", "0.80952626", "0.8090086", "0.8083193", "0.8077437", "0.80763936", "0.8073842", "0.8071295", "0.8063725", "0.80580264", "0.8057222", "0.8050245", "0.80425924", "0.8039723", "0.803762", "0.8031548", "0.80312526", "0.8030558", "0.80269325", "0.8024912", "0.80225265", "0.80160683", "0.8012075", "0.8010291", "0.80054194", "0.8004048", "0.8001312", "0.8001151", "0.7997104", "0.7995859", "0.7991336", "0.79828554", "0.7978751", "0.7972753", "0.79721093", "0.7970094", "0.7964339", "0.79621214", "0.7960281", "0.7959837", "0.7953707", "0.7950333", "0.7944334", "0.7943871", "0.79435563", "0.79399276", "0.7938308", "0.79320633", "0.79183036", "0.7916569", "0.79052776", "0.78962445", "0.78936666", "0.7890861", "0.78853476", "0.78818023", "0.7881618", "0.78795385", "0.786269", "0.7859457", "0.78466815", "0.7845112", "0.78443927", "0.78426445", "0.78381014", "0.78372383", "0.78353155", "0.7832036" ]
0.0
-1
get the revenue data to generate the revenue plot
public function retrieveRevenueData() { //setting header to json header('Content-Type: application/json'); //query to get the revenue data $query = sprintf("SELECT CONCAT(YEAR(date), '/', WEEK(date)) AS theWeek, SUM(exlAmount) AS revenue FROM payment GROUP BY theWeek ORDER BY YEAR(DATE) ASC, WEEK(date) ASC;"); //execute query $result = $GLOBALS['db']->query($query); //loop through the returned data $data = array(); foreach ($result as $row) { $data[] = $row; } //free memory associated with result $result->close(); //return the data return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_revenue() {\n return response()->json(Revenue::active()->get()->toArray(), 200);\n }", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "static function get_plan_revenue()\n {\n $cond_str = RestaurantTotalReportDB::get_month_year_string($_REQUEST['from_date'],$_REQUEST['to_date']);\n $sql = 'select\n (bar.name || \\'_\\' || pim.bar_index) as id,\n sum(pim.value) as value,\n pim.portal_id,\n pim.bar_index\n from\n plan_in_month pim\n inner join bar on bar.id = pim.bar\n where\n (pim.month || pim.year) in ('.$cond_str.')\n and pim.bar is not null\n and pim.bar_index is not null\n group by \n bar.name,\n pim.portal_id,\n pim.bar_index\n ';\n $items = DB::fetch_all($sql);\n return $items;\n }", "public function getCurrentMonthTotalRevenue() : float;", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function display_site_revenue() {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n\t\t\t$company_id=$this->data['company_id'];\n $billingsList = $this->revenue_model->get_all_details(TRANSACTION, array(), array('bill_generated' => 'DESC'));\n\n $req = (empty($_GET['range'])) ? '' : $_GET['range'];\n $this->data['range'] = $range = (empty($_GET['range'])) ? '' : base64_decode(rawUrlDecode($_GET['range']));\n\t\t\t\n\t\t\t$dateFrom = $this->input->get('from'); \n\t\t\t$dateTo = $this->input->get('to');\n\t\t\tif($range == '' && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t$range = $dateFrom.' - '.$dateTo; \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$locationId = $this->input->get('location_id');\n\t\t\t$driverCond = array();\n\t\t\t$driverCond = array('company_id'=>$company_id);\n\t\t\tif($locationId != '' && $locationId != 'all'){\n\t\t\t\t$driverCond = array('driver_location' => $locationId,'company_id'=>$company_id);\n\t\t\t}\n\t\t\t\n $selectFields = array('email', 'image', 'driver_name', 'vehicle_number', 'vehicle_model', 'no_of_rides', 'cancelled_rides', 'mobile_number', 'dail_code');\n $driversCount = $this->revenue_model->get_all_counts(DRIVERS,$driverCond);\n if ($driversCount > 500) {\n $limitPerPage = 100;\n $offsetVal = 0;\n if (isset($_GET['per_page'])) {\n $offsetVal = $this->input->get('per_page');\n }\n\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields, array(), $limitPerPage, $offsetVal);\n\n if(!isset($_GET['range']) && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t\t$manRange = 'from='.urlencode($dateFrom).'&to='.urlencode($dateTo);\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?' . $manRange;\n\t\t\t\t} else {\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?range=' . $req;\n\t\t\t\t}\n\t\t\t\t\n $config['num_links'] = 3;\n $config['display_pages'] = TRUE;\n $config['page_query_string'] = TRUE;\n $config['base_url'] = $searchbaseUrl;\n $config['total_rows'] = $driversCount;\n $config[\"per_page\"] = $limitPerPage;\n $config[\"uri_segment\"] = 4;\n $config['first_link'] = '';\n $config['last_link'] = '';\n $config['full_tag_open'] = '<ul class=\"tsc_pagination tsc_paginationA tsc_paginationA01\">';\n $config['full_tag_close'] = '</ul>';\n if ($this->lang->line('pagination_prev_lbl') != '') $config['prev_link'] =stripslashes($this->lang->line('pagination_prev_lbl')); else $config['prev_link'] ='Prev';\n $config['prev_tag_open'] = '<li>';\n $config['prev_tag_close'] = '</li>';\n if ($this->lang->line('pagination_next_lbl') != '') $config['next_link'] =stripslashes($this->lang->line('pagination_next_lbl')); else $config['next_link'] ='Next';\n $config['next_tag_open'] = '<li>';\n $config['next_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"current\"><a href=\"javascript:void(0);\" style=\"cursor:default;\">';\n $config['cur_tag_close'] = '</a></li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['first_tag_open'] = '<li>';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_tag_close'] = '</li>';\n if ($this->lang->line('pagination_first_lbl') != '') $config['first_link'] =stripslashes($this->lang->line('pagination_first_lbl')); else $config['first_link'] ='First';\n if ($this->lang->line('pagination_last_lbl') != '') $config['last_link'] = stripslashes($this->lang->line('pagination_last_lbl')); else $config['last_link'] ='Last';\n $this->pagination->initialize($config);\n $paginationLink = $this->pagination->create_links();\n $this->data['paginationLink'] = $paginationLink;\n } else {\n $this->data['paginationLink'] = '';\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields);\n }\n \n $dates = @explode('-', $range);\n $mfrom = '';\n $mto = '';\n\n if (count($dates) == 2) {\n $mfrom = trim($dates[0]);\n $mto = trim($dates[1]);\n } else {\n $mto = get_time_to_string(\"m/d/Y\");\n if ($billingsList->num_rows() == 0) {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n }\n\n if ($billingsList->num_rows() == 0) {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n\n $filter = '';\n $fromdate = '';\n $todate = '';\n $fdate = '';\n $tdate = '';\n if ($mfrom != \"\" && $mto != \"\") {\n $filter = 'dummy';\n $fromdate = strtotime($mfrom . ' 00:00:00');\n $todate = strtotime($mto . ' 23:59:59');\n }\n $this->data['filter'] = $filter;\n $this->data['last_bill'] = $last_bill;\n\n $cB = get_time_to_string(\"m/d/Y\", $fromdate) . ' - ' . get_time_to_string(\"m/d/Y\", $todate);\n $this->data['cB'] = $cB;\n\n if ($fromdate != '' && $todate != '') {\n $fdate = $fromdate;\n $tdate = $todate;\n }\n\n $totalRides = 0;\n $totalRevenue = 0;\n $siteRevenue = 0;\n $driverRevenue = 0;\n if ($driverDetails->num_rows() > 0) {\n foreach ($driverDetails->result() as $driver) {\n $total_rides = 0;\n $cancelled_rides = 0;\n $successfull_rides = 0;\n $total_revenue = 0;\n $in_site = 0;\n $couponAmount = 0;\n $in_driver = 0;\n $total_due = 0;\n $site_earnings = 0;\n $driver_earnings = 0;\n $tips_amount = 0;\n $tips_in_site = 0;\n $tips_in_driver = 0;\n\n $driver_id = (string) $driver->_id;\n $driver_name = (string) $driver->driver_name;\n $driver_email = (string) $driver->email;\n $driver_phone = (string) $driver->dail_code . $driver->mobile_number;\n $driver_image = USER_PROFILE_IMAGE_DEFAULT;\n if (isset($driver->image)) {\n if ($driver->image != '') {\n $driver_image = USER_PROFILE_IMAGE . $driver->image;\n }\n }\n $rideDetails = $this->revenue_model->get_ride_details_company($driver_id, $fdate, $tdate,$company_id);\n\n if (!empty($rideDetails['result'])) {\n $total_rides = $rideDetails['result'][0]['totalTrips'];\n $total_revenue = $rideDetails['result'][0]['totalAmount'];\n #$in_site = $rideDetails['result'][0]['by_wallet'];\n $couponAmount = $rideDetails['result'][0]['couponAmount'];\n $site_earnings = $rideDetails['result'][0]['site_earnings'];\n $driver_earnings = $rideDetails['result'][0]['driver_earnings'];\n\t\t\t\t\t\t\n if (isset($rideDetails['result'][0]['tipsAmount'])) {\n $tips_amount = $rideDetails['result'][0]['tipsAmount'];\n }\n if (isset($rideDetails['result'][0]['amount_in_site'])) {\n $in_site = $rideDetails['result'][0]['amount_in_site'];\n }\n if (isset($rideDetails['result'][0]['amount_in_driver'])) {\n $in_driver = $rideDetails['result'][0]['amount_in_driver'];\n }\n }\n\n $driver_earnings = $driver_earnings + $tips_amount;\n\n $this->data['driversList'][$driver_id]['id'] = $driver_id;\n $this->data['driversList'][$driver_id]['driver_name'] = $driver_name;\n $this->data['driversList'][$driver_id]['driver_email'] = $driver_email;\n $this->data['driversList'][$driver_id]['driver_image'] = base_url() . $driver_image;\n $this->data['driversList'][$driver_id]['driver_phone'] = $driver_phone;\n\t\t\t\t\t\n\t\t\t\t\t$this->data['driversList'][$driver_id]['total_rides'] = $total_rides;\n $this->data['driversList'][$driver_id]['total_revenue'] = $total_revenue;\n $this->data['driversList'][$driver_id]['in_site'] = $in_site;\n $this->data['driversList'][$driver_id]['couponAmount'] = $couponAmount;\n $this->data['driversList'][$driver_id]['in_driver'] = $in_driver;\n $this->data['driversList'][$driver_id]['total_due'] = $total_due;\n\n $this->data['driversList'][$driver_id]['site_earnings'] = $site_earnings;\n $this->data['driversList'][$driver_id]['driver_earnings'] = $driver_earnings;\n $this->data['driversList'][$driver_id]['driver_tips'] = $tips_amount;\n\t\n }\n } \n $rideSummary = $this->revenue_model->get_ride_summary_company($fdate, $tdate,$company_id,$locationId);\n \n if (!empty($rideSummary['result'])) {\n $totalRides = $rideSummary['result'][0]['totalTrips'];\n $siteRevenue = $rideSummary['result'][0]['site_earnings'];\n $driverRevenue = $rideSummary['result'][0]['driver_earnings'];\n $totalRevenue = $siteRevenue + $driverRevenue;\n }\n\n $this->data['totalRides'] = $totalRides;\n $this->data['totalRevenue'] = $totalRevenue;\n $this->data['siteRevenue'] = $siteRevenue;\n $this->data['driverRevenue'] = $driverRevenue;\n\n $this->data['fromdate'] = $mfrom;\n $this->data['todate'] = $mto;\n\n\n $this->data['billingsList'] = $billingsList;\n\t\t\t\n\t\t\t $this->data['locationList'] = $this->revenue_model->get_all_details(LOCATIONS, array('status' => 'Active'), array('city' => 'ASC'));\n\n if ($this->lang->line('admin_site_earnings_total_revenue_list') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_site_earnings_total_revenue_list')); \n\t\t else $this->data['heading'] = 'Total Revenue List';\n $this->load->view(COMPANY_NAME.'/revenue/display_site_revenue', $this->data);\n }\n }", "public function retrieveRevenueAverage()\n {\n $query = \"SELECT AVG(revenue) AS avgRevenue FROM (SELECT CONCAT(YEAR(date), '/', MONTH(date)) AS theMonth, SUM(exlAmount) AS revenue FROM payment GROUP BY theMonth ORDER BY YEAR(DATE) ASC, MONTH(date) ASC) AS T1;\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "function getRevenuesData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='daily' || $varAction=='yesterday'){\n if($varAction=='daily'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n $sum=0;\n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,TIME(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded < '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$i]['time']=$arrData;\n $arrRes['data'][$i]['count']=$currSum;\n }\n $arrRes['total']=$sum;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='weekly'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n //\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count;\n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='monthly'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $currMonth.'=='.$currMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n \n \n //$arrClms = array('DATE(ItemDateAdded) as date');\n //$argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n //$argWhere .= 'AND Status <> \"Canceled\"';\n //\n //$arrData = $this->select($varTable, $arrClms, $argWhere);\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count; \n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function get_revenue_history( $args = array() ) {\n $default_args = array(\n 'group_by' => 'currency_id',\n 'order' => 'ASC',\n 'fields' => array(\n 'currency_id',\n 'SUM(price) AS amount',\n 'COUNT(*) AS quantity',\n 'DATE(date) AS date',\n 'DAY(date) AS day',\n 'MONTH(date) AS month',\n 'HOUR(date) AS hour',\n ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_results( $args );\n }", "public function revenues()\n {\n return $this->hasMany('App\\revenue','store_id');\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function show(Revenue $revenue)\n {\n return $this->response->item($revenue, new Transformer());\n }", "public function rankAffiliatesByRevenue()\n {\n $this->affiliates = DB::select(\"SELECT SUM(sale_amount) AS 'revenue', affiliate_id FROM \" . $this->source_table . \" GROUP BY (affiliate_id) ORDER BY sale_amount DESC LIMIT 1000;\");\n }", "public function retrieveRevenueThisMonth()\n {\n $query = \"SELECT SUM(exlAmount) as thisMonthTotal FROM payment WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "public function actionPending_revenue() {\n\n /* redirect a user if not super admin */\n if (!Yii::$app->CustomComponents->check_permission('pending_revenue')) {\n return $this->redirect(['site/index']);\n }\n\n $dataService = $this->quickbook_instance();\n $courses_from_qb = $dataService->Query(\"SELECT * FROM Item\");\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $user = Yii::$app->user->identity;\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n $data = Yii::$app->request->post();\n\n $filter_data = array();\n $by_team_arr = array();\n $month_year_arr = array();\n $all_invoice_of_customer = array();\n $allInvoices = array();\n $allPayments = array();\n\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n\n if ($data) {\n\n if ($user_role == 33) {\n $this->pending_revenue_manager_filter();\n } else {\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $user_id = $data['sales_user_id'];\n } else {\n $user_id = $user->id;\n }\n\n if ($user_role == 7) {\n $filters = [];\n } else if ($user_role == 6) {\n $filters = ['sales_user_id' => $data['sales_user_id']];\n } else if ($user_role == 1) {\n $filters = [];\n } else {\n $filters = ['sales_user_id' => $user_id];\n }\n\n $team_ids = array();\n if (isset($data['email']) && $data['email'] != '') {\n $filter_data['email'] = $data['email'];\n }\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n\n $new_date = explode('_', $data['bymonth']);\n $fyear = $new_date['1'];\n $fmonth = $new_date['0'];\n\n if ($fmonth <= 9 && strlen($fmonth) == 1) {\n $fmonth = \"0\" . $fmonth;\n }\n $first_date_of_current_month = date(\"$fyear-$fmonth-01\");\n $last_date_of_current_month = $lastday = date('Y-m-t', strtotime($first_date_of_current_month));\n } else if ($data['by_date_month'] == 'd') {\n $first_date_of_current_month = date(\"Y-m-d\", strtotime($data['sdate']));\n $last_date_of_current_month = date(\"Y-m-d\", strtotime($data['edate']));\n }\n\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $allInvoices = array();\n $qb_cust_id_arr = array();\n\n if ($user_role == 7) {\n \n } else if ($user_role == 6) {\n \n } else if ($user_role != 1) {\n $filter_data['sales_user_id'] = $user->id;\n }\n if (isset($data['by_date_month'])) {\n\n if ($user_role == 7) { /* If current user is not super admin */\n\n if (isset($data['byTeam']) && !empty($data['byTeam'])) {\n $by_team_arr['byTeam'] = $data['byTeam'];\n $byteam = $data['byTeam'];\n if (isset($data['sales_user_id']) && !empty($data['sales_user_id'])) {\n if (count($data['sales_user_id']) == 1 && empty($data['sales_user_id'][0])) {\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = $byteam \")->queryAll();\n $sales_head_str = \"\";\n if (!empty($team_model_val)) {\n foreach ($team_model_val as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str .= $byteam;\n $sales_head_str = rtrim($sales_head_str, \",\");\n\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n $sales_user_id_arr = $data['sales_user_id'];\n if (empty($data['sales_user_id'][0])) {\n $sales_user_id_arr[] = $data['byTeam'];\n }\n\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['in', 'sales_user_id', $sales_user_id_arr])->all();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n if (!empty($data['byTeam'])) {\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id = $team\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n }\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else if ($user_role == 6) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $data['sales_user_id']])->all();\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else if ($user_role != 1) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else { /* If current user is super admin */\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n } else {\n if ($user_role == 7) { /* If current user is not super admin */\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n }\n\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n if ($data['sdate'] != \"\" && $data['by_date_month'] == 'd') {\n $query = DvRegistration::find()\n ->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } elseif ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['assist_participant.id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n\n $query->andWhere(['>', 'qb_customer_id', 0]);\n $query->groupBy(['email']);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 20]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $filter_data['bymonth'] = $data['bymonth'];\n }\n if ($data['by_date_month'] != '') {\n $filter_data['by_date_month'] = $data['by_date_month'];\n }\n\n if ($data['sdate'] != '' && $data['by_date_month'] == 'd') {\n $filter_data['sdate'] = $data['sdate'];\n $filter_data['edate'] = $data['edate'];\n }\n\n if ($data['email'] != \"\") {\n $filter_data['email'] = $data['email'];\n }\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $filter_data['sales_user_id'] = $data['sales_user_id'];\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n\n $invoice_number = \"\";\n $total_of_all_currencys = array();\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n /* echo \"<pre>\";\n print_r($models);\n die; */\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'pagination' => $pagination,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'count' => $offset,\n 'total_count' => $count,\n 'filter_data' => $filter_data,\n 'by_team_arr' => $by_team_arr,\n 'allInvoices' => $allInvoices,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month,\n 'courses_from_qb' => $courses_from_qb\n ]);\n }\n } else {\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n if ($user_role == 1) {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n $query = DvRegistration::find()->where(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 6) {\n $sales_heads = Yii::$app->db->createCommand(\"SELECT assist_users.id FROM assist_users INNER JOIN assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.status = 1 AND assist_users.department = 1 AND assist_user_meta.meta_key = 'team' AND assist_user_meta.meta_value=$user->id\")->queryAll();\n $sales_heads_str = \"\";\n if (!empty($sales_heads)) {\n foreach ($sales_heads as $m_sales_head) {\n $sales_heads_str .= $m_sales_head['id'] . \",\";\n }\n }\n $sales_heads_str .= $user->id;\n $sales_heads_str = rtrim($sales_heads_str, \",\");\n\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_heads_str )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 7) {\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' \")->queryAll();\n\n $executive_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) \")->queryAll();\n $team_model_val[]['uid'] = $user->id;\n $combined_sales_head_arr = array_merge($team_model_val, $executive_model_val);\n\n $sales_head_str = \"\";\n if (!empty($combined_sales_head_arr)) {\n foreach ($combined_sales_head_arr as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str = rtrim($sales_head_str, \",\");\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n /* echo \"<pre>\";\n print_r($all_invoice_of_customer);\n die; */\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['sales_user_id' => $user->id])->andWhere(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n $query->groupBy(['email']);\n $query->orderBy(['id' => SORT_DESC]);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 10]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n // echo \"in\"; die;\n // Start Get Total of different currency \n $invoice_number = \"\";\n $total_of_all_currencys = array();\n\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'pagination' => $pagination,\n 'count' => $offset,\n 'total_count' => $count,\n 'allInvoices' => $allInvoices,\n 'courses_from_qb' => $courses_from_qb,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month\n ]);\n }\n }", "public function index()\n {\n return Revenue::latest()->paginate(10);\n }", "public function sumRevenueAnalytics(Request $request, $period)\n {\n $orders = Order::LatestOrder('ASC')->withScopes($this->scopes())->get()->groupBy($period);\n\n if ($orders->isEmpty()) {\n return new RevenueAnalyticsResource([]);\n }\n\n $numbers = $orders->mapToGroups(function ($items, $key) {\n return [\n 'revenue' => $items->sum(function($item){\n return $item->revenue();\n })\n ];\n });\n\n return new RevenueAnalyticsResource($numbers->merge(['status' => $orders->keys()]));\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "public function reports_revenue(Request $request){\n // $reports_salary = DB::table('reservation_details')->orderBy('id','desc')->paginate();\n return view('admin.reports.reports_revenue');\n }", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public function index()\n {\n\n $data = Purchase::select(DB::raw('month(purchases.created_at) as month'), DB::raw('SUM(purchases.payment) as aggregates'))->groupBy(DB::raw('month(purchases.created_at)'))->get();\n \n $purchases = Charts::create('line', 'highcharts')\n ->title('Purchase Statistics')\n ->elementLabel('Purchase Statistics')\n ->dimensions(550, 400)\n ->responsive(false)\n ->labels($data->pluck('month'))\n ->values($data->pluck('aggregates'));\n\n $data = Expense::select(DB::raw('month(expenses.created_at) as month'), DB::raw('SUM(expenses.ex_amount) as aggregates'))->groupBy(DB::raw('month(expenses.created_at)'))->get();\n\n $data = Sale::select(DB::raw('date(sales.created_at) as date'), DB::raw('SUM(sales.spayment) as aggregates'))->groupBy(DB::raw('date(sales.created_at)'))->get();\n \n $sales = Charts::create('bar', 'highcharts')\n ->title('Sale Statistics')\n ->elementLabel('Sale Statistics')\n ->dimensions(1140, 400)\n ->responsive(false)\n ->labels($data->pluck('date'))\n ->values($data->pluck('aggregates'));\n\n $data = Expense::select(DB::raw('date(expenses.created_at) as date'), DB::raw('SUM(expenses.ex_amount) as amount'))->groupBy(DB::raw('date(expenses.created_at)'))->get();\n //dd($data);\n $expense = Charts::create('line', 'highcharts')\n ->title('Expense Statistics')\n ->elementLabel('Expense Statistics')\n ->dimensions(550, 400)\n ->responsive(false)\n ->labels($data->pluck('date'))\n ->values($data->pluck('amount'));\n\n $shop = DB::table('settings')->pluck('shop_name');\n $logo = DB::table('settings')->pluck('logo');\n $copy = DB::table('settings')->pluck('copy');\n\n return view('dashboard')->withPurchases($purchases)->withSales($sales)->withExpense($expense)->withShop($shop)->withLogo($logo)->withCopy($copy);\n }", "function total_video_revenue() {\n return PayPerView::sum('amount');\n}", "public function index()\n {\n return \\response()->json(collect(Revenue::latest()->paginate(15)));\n }", "public function response_rom()\n {\n $roms = $this->roms;\n $data=[];\n $village_rom=new SampleChart;\n /*\n $villages = DB::table('households')\n ->join('villages','households.village_id','=','villages.id')\n ->join('stats','households.id','=','stats.household_id')\n ->select(DB::raw('sum(stats.household_count) as sum, villages.village_name'))\n ->whereIn('households.nationality',$roms)\n ->groupBy('villages.village_name')\n ->get();\n */\n $villages = DB::table('village_stats')\n ->select('village_stats.*')\n ->orderBy('village_stats.village_name')\n ->get();\n\n\n foreach ($villages as $village) {\n //$name[]=$village->village_name;\n $sum[]=$village->roms_count;\n\n }\n\n\n //$village_rom->dataset('Households(total)', 'bar', $households)->color('#00ff00');\n $village_rom->dataset('Roms per village', 'bar', $sum)->color('#00ff00');\n //$village_rom->dataset('Roms total', 'bar', $rom_total)->color('#ff0000');\n return $village_rom->api();\n\n }", "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "public function ppv_revenue(Request $request) {\n\n $currency = Setting::get('currency');\n\n $take = $request->take ? $request->take : Setting::get('admin_take_count');\n\n $model = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->orderBy('vod_videos.user_amount', 'desc')->skip($request->skip)\n ->take($take)->get();\n\n $data = [];\n\n $user_commission = VodVideo::where('vod_videos.user_id', $request->id)->sum('user_amount');\n\n foreach ($model as $key => $value) {\n \n $data[] = [\n 'vod_id'=>$value->vod_id,\n 'title'=>$value->title,\n 'user_id'=>$value->user_id,\n 'description'=>$value->description,\n 'image'=>$value->image,\n 'amount'=>$value->amount,\n 'admin_amount'=>$value->admin_amount,\n 'user_amount'=>$value->user_amount,\n 'created_at'=>$value->created_at->diffForhumans(),\n 'currency'=>$value->currency,\n 'unique_id'=>$value->unique_id\n ];\n\n }\n\n $paid_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->where('vod_videos.user_amount', '>', 0)->count();\n\n $total_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)->count();\n\n $response_array = ['success'=>true, 'data'=>$data, \n 'total_amount'=>$user_commission, \n 'currency'=>$currency, \n 'total_paid_videos'=>$paid_videos ? $paid_videos : 0,\n 'total_videos'=>$total_videos ? $total_videos : 0];\n\n return response()->json($response_array);\n }", "public function get_main_chart() {\n\t\tglobal $wp_locale;\n\n\t\t// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date\n\t\t$orders = $this->get_order_report_data( array(\n\t\t\t'data' => array(\n\t\t\t\t'ID' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => 'COUNT',\n\t\t\t\t\t'name' => 'total_orders',\n\t\t\t\t\t'distinct' => true,\n\t\t\t\t),\n\t\t\t\t'post_date' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'name' => 'post_date'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'group_by' => $this->group_by_query,\n\t\t\t'order_by' => 'post_date ASC',\n\t\t\t'query_type' => 'get_results',\n\t\t\t'filter_range' => true\n\t\t) );\n\n\t\t// Get Abadoned Carts in range 1 years\n\t\t$abandoned_carts_items = CartModel::get_carts_one_year();\n\t\t$ee_abandoned_posts = array();\n\n\t\tif ( $abandoned_carts_items ) {\n\n\t\t\tforeach ( $abandoned_carts_items as $order_item ) {\n\t\t\t\t$date = date( 'Y-m-d h:i:s', $order_item->post_date );\n\n\t\t\t\t$obj = new stdClass();\n\t\t\t\t$obj->post_date = $date;\n\t\t\t\t$obj->abandoned_cart_itms = 1;\n\n\t\t\t\t$ee_abandoned_posts[] = $obj;\n\t\t\t}\n\t\t}\t\n\n\t\t// Prepare data for report\n\t\t$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$abandoned_carts_encoded = $this->prepare_chart_data( $ee_abandoned_posts, 'post_date', 'abandoned_cart_itms', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t\n\t\t// Encode in json format\n\t\t$chart_data = json_encode( array(\n\t\t\t'order_counts' => array_values( $order_counts ),\n\t\t\t'abandoned_cart_itms' => array_values( $abandoned_carts_encoded )\n\t\t) );\n\t\t?>\n\n\t\t<?php //echo $chart_data; ?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo $chart_data; ?>' );\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Number of conversions', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.order_counts,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['order_counts']; ?>',\n\t\t\t\t\t\t\tbars: { fillColor: '<?php echo $this->chart_colours['order_counts']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Abandoned Carts', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.abandoned_cart_itms,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['abandoned_carts']; ?>',\n\t\t\t\t\t\t\tpoints: { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines: { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars )\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery('.chart-placeholder.main'),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t grid: {\n\t\t\t\t\t\t color: '#aaa',\n\t\t\t\t\t\t borderColor: 'transparent',\n\t\t\t\t\t\t borderWidth: 0,\n\t\t\t\t\t\t hoverable: true\n\t\t\t\t\t\t },\n\t\t\t\t\t\t xaxes: [ {\n\t\t\t\t\t\t \tcolor: '#aaa',\n\t\t\t\t\t\t \tposition: \"bottom\",\n\t\t\t\t\t\t \ttickColor: 'transparent',\n\t\t\t\t\t\t\t\tmode: \"time\",\n\t\t\t\t\t\t\t\ttimeformat: \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength: 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo $this->chart_groupby; ?>\"],\n\t\t\t\t\t\t\t\tfont: {\n\t\t\t\t\t\t \t\tcolor: \"#aaa\"\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t yaxes: [\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\tminTickSize: 1,\n\t\t\t\t\t\t \t\ttickDecimals: 0,\n\t\t\t\t\t\t \t\tcolor: '#d4d9dc',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t},\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tposition: \"right\",\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\ttickDecimals: 2,\n\t\t\t\t\t\t \t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t \t\tcolor: 'transparent',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t ],\n\t\t\t\t \t\t}\n\t\t\t\t \t);\n\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery(this).data('series') );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function index()\n {\n $revenues = Revenue::with(['account', 'customer', 'category'])->collect();\n\n return $this->response->paginator($revenues, new Transformer());\n }", "public function show($id)\n {\n return response()->json(Revenue::findOrFail($id));\n }", "public function purchaseSalesInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$invoiceArray=array();\r\n\t\t$invoiceData=array();\r\n\t\t\r\n\t\t$saleInvoice='SELECT count(reference_number) as sales_invoice \r\n\t\tFROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$purchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"0\"';\r\n\r\n\t\t$totalSalesInvoice = $this->get_row($saleInvoice,false);\r\n\t\t$totalPurchaseInvoice = $this->get_row($purchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalSalesInvoice)) {\r\n\t\t\t$invoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['sales'] = $totalSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$invoiceData['purchase'] = $totalPurchaseInvoice[0];\r\n\t\t\t$invoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($invoiceArray, $invoiceData);\r\n\t\treturn $invoiceArray;\r\n\t}", "public function get_main_chart() {\n\n\t\tif ( empty( $this->product_ids ) ) {\n\t\t\t?>\n\t\t\t<div class=\"chart-container\">\n\t\t\t\t<p class=\"chart-prompt\"><?php _e( '&larr; Choose a product to view stats', 'woocommerce-cost-of-goods' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\treturn;\n\t\t}\n\n\t\t$data = $this->get_report_data();\n\n\t\t// prep data for charting\n\t\t$sales = $this->prepare_chart_data( $data->sales, 'post_date', 'order_item_amount', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$cogs = $this->prepare_chart_data( $data->cogs, 'post_date', 'order_item_total_cost', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$profits = $this->prepare_chart_data( $data->profits, 'post_date', 'order_item_profit', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$item_counts = $this->prepare_chart_data( $data->item_counts, 'post_date', 'order_item_count', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\n\t\t$chart_data = array(\n\t\t\t'sales' => array_values( $sales ),\n\t\t\t'cogs' => array_values( $cogs ),\n\t\t\t'profits' => array_values( $profits ),\n\t\t\t'item_counts' => array_values( $item_counts ),\n\t\t);\n\n\t\t?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo json_encode( $chart_data ); ?>' );\n\n\t\t\t\tvar drawGraph = function( highlight ) {\n\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Number of items sold', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.item_counts,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_items']; ?>',\n\t\t\t\t\t\t\tbars : { fillColor: '<?php echo $this->chart_colors['total_items']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable : false\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Sales amount', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.sales,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_sales']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Cost of Goods Sold', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.cogs,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_cogs']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Profit amount', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.profits,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_profit']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars ) {\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery( '.chart-placeholder.main' ),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgrid: {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tborderColor: 'transparent',\n\t\t\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\t\t\thoverable : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\txaxes: [ {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tposition : 'bottom',\n\t\t\t\t\t\t\t\ttickColor : 'transparent',\n\t\t\t\t\t\t\t\tmode : 'time',\n\t\t\t\t\t\t\t\ttimeformat : \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames : <?php echo json_encode( array_values( $GLOBALS['wp_locale']->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength : 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tcolor: '#aaa'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t\tyaxes: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\tminTickSize : 1,\n\t\t\t\t\t\t\t\t\ttickDecimals: 0,\n\t\t\t\t\t\t\t\t\tcolor : '#ecf0f1',\n\t\t\t\t\t\t\t\t\tfont : { color: '#aaa' }\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tposition : 'right',\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\ttickDecimals : 2,\n\t\t\t\t\t\t\t\t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t\t\t\tcolor : 'transparent',\n\t\t\t\t\t\t\t\t\tfont : { color: '#aaa' }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tjQuery( '.chart-placeholder' ).resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery( '.highlight_series' ).hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery( this ).data( 'series' ) );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function model(){\n\t\treturn CategoryRevenue::class;\n\t}", "public function chart($start, $end) {\n // The result array\n $result = array();\n\n // Gets all the universities\n $universities = $this->University->find('all');\n\n // Gets the values involved with the chart\n $d62_d65 = array();\n for ($i = 62; $i <= 65; $i++) {\n array_push($d62_d65, $this->Data->findByNombre('D' . $i));\n }\n\n // Does the year by year calcuation\n for ($year = $start; $year <= $end; $year++) {\n // The grades list\n $grades = array();\n for ($i = 62; $i <= 65; $i++) {\n array_push($grades, 0);\n }\n\n // Does the calculation for each university in the current year\n foreach ($universities as $university) {\n $uy_d62_d65 = array();\n\n // Get the data involved\n foreach ($d62_d65 as $data_d_) {\n $uy_d_ = $this->UniversityYearData->findByDato_iddatoAndUniversidad_iduniversidadAndAnho($data_d_['Data']['iddato'], $university['University']['iduniversidad'], $year);\n\n // Check the obtained data and saves it\n if (!empty($uy_d_)) {\n array_push($uy_d62_d65, $uy_d_['UniversityYearData']['valor']);\n } else {\n array_push($uy_d62_d65, 0);\n }\n }\n\n // Checks all the data and does the calculation\n if (!empty($uy_d62_d65)) {\n foreach ($grades as $index => $grade) {\n $grades[$index] = $grade + $uy_d62_d65[$index];\n }\n }\n }\n\n // Saves the current year calculation\n $prc001_16 = array();\n $prc001_16['year'] = $year;\n $prc001_16['value'] = $grades;\n array_push($result, $prc001_16);\n }\n\n // Gets the series and ticks\n $series = array();\n $ticks = array();\n foreach ($result as $year_result) {\n array_push($ticks, $year_result['year']);\n array_push($series, $year_result['value']);\n }\n\n // Gets the grades\n $grades = array();\n foreach ($d62_d65 as $data_d_) {\n array_push($grades, $data_d_['Data']['descripcion']);\n }\n\n // Saves the final result\n $result = array();\n $result['ticks'] = $ticks;\n $result['series'] = $series;\n $result['grades'] = $grades;\n $result['view'] = 'prc001_16';\n FirePHP::getInstance(true)->log($result);\n\n // Returns\n return $result;\n }", "public function getBlock()\n\t{\n\t\t$chart = new \\IPS\\Helpers\\Chart;\n\t\t\n\t\t$chart->addHeader( \"Day\", 'date' );\n\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t{\n\t\t\t$chart->addHeader( $currency, 'number' );\n\t\t}\n\t\t\n\t\t$thirtyDaysAgo = \\IPS\\DateTime::create()->sub( new \\DateInterval('P30D') );\n\t\t\t\t\n\t\t$results = array();\n\t\tforeach( \\IPS\\Db::i()->select( \"t_currency, DATE_FORMAT( FROM_UNIXTIME( t_date ), '%e %c %Y' ) AS date, SUM(t_amount)-SUM(t_partial_refund) AS amount\", 'nexus_transactions', array( 't_date>? AND (t_status=? OR t_status=?)', $thirtyDaysAgo->getTimestamp(), \\IPS\\nexus\\Transaction::STATUS_PAID, \\IPS\\nexus\\Transaction::STATUS_PART_REFUNDED ), NULL, NULL, array( 't_currency', 'date' ) ) as $result )\n\t\t{\n\t\t\t$results[ $result['date'] ][ $result['t_currency'] ] = $result['amount'];\n\t\t}\n\t\t\t\t\n\t\t$monthAndYear = date( 'n' ) . ' ' . date( 'Y' );\n\t\tforeach ( range( 30, 0 ) as $daysAgo )\n\t\t{\n\t\t\t$datetime = new \\IPS\\DateTime;\n\t\t\t$datetime->setTime( 0, 0, 0 );\n\t\t\t$datetime->sub( new \\DateInterval( 'P' . $daysAgo . 'D' ) );\n\t\t\t$resultString = $datetime->format('j n Y');\n\t\t\t\n\t\t\tif ( isset( $results[ $resultString ] ) )\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\t\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\tif ( !isset( $results[ $resultString ][ $currency ] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$row[] = $results[ $resultString ][ $currency ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row = array( $datetime );\n\t\t\t\tforeach ( \\IPS\\nexus\\Money::currencies() as $currency )\n\t\t\t\t{\n\t\t\t\t\t$row[] = 0;\n\t\t\t\t}\n\t\t\t\t$chart->addRow( $row );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $chart->render( 'LineChart' );\n\t}", "public function EvolutionDataChartGet(Request $request)\n {\n if ($request->isMethod('get')) {\n /* $date1 = strtotime(\"2020/07/01\"); \n $fecha1 = date(\"Y/m/d\", strtotime(\"2020/07/01\"));\n $date2 = strtotime('+30 day', strtotime($fecha1));\n $fecha2 = date(\"Y/m/d\", $date2); */\n $fecha2=date(\"Y-m-d\");\n $fecha1= date(\"Y-m-d\",strtotime($fecha2.\"- 1 month\"));\n\n // $fecha1= \"2018/03/01\";\n // $fecha2 =\"2018/03/30\";\n $celda1=901;\n $celda2= 1090;\n \n\n $voltaje = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(voltaje), 4), \",\",\"\") as voltaje'))\n ->get();\n\n $banda1Voltaje = 4.55;\n $banda2Voltaje = 4.65;\n $minVoltaje = 4.4;\n $maxVoltaje = 5.1;\n\n $corriente = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(corrienteL), 4), \",\",\"\") as corriente'))\n ->get();\n\n $banda1Corriente = 219;\n $banda2Corriente = null;\n $minCorriente = 180;\n $maxCorriente = 240;\n\n $efCorriente = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(eficc_rcol), 4), \",\",\"\") as efCorriente'))\n ->get();\n\n $banda1EfCorriente = 90;\n $banda2EfCorriente = 94;\n $minEfCorriente = 50;\n $maxEfCorriente = 110;\n\n $desvResistencia = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(dsr), 4), \",\",\"\") as desvResistencia'))\n ->get();\n\n $banda1DesvResistencia = 0.06;\n $banda2DesvResistencia = null;\n $minDesvResistencia = -0.2;\n $maxDesvResistencia = 0.2;\n\n $frecuenciaEA = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM(numeroEA)/count(*), 4), \",\",\"\") as frecuenciaEA'))\n ->get();\n\n $banda1FrecuenciaEA = 0.15;\n $banda2FrecuenciaEA = null;\n $minFrecuenciaEA = 0;\n $maxFrecuenciaEA = 1.2;\n\n $potencia = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(potencia), 4), \",\", \"\") as potencia'))\n ->get();\n\n $banda1Potencia = 980;\n $banda2Potencia = 1000;\n $minPotencia = 920;\n $maxPotencia = 1120;\n\n $nivelDeMetal = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(nivelDeMetal), 4), \",\",\"\") as nivelDeMetal'))\n ->get();\n\n $banda1NivelDeMetal = 20;\n $banda2NivelDeMetal = 22;\n $minNivelDeMetal = 18;\n $maxNivelDeMetal = 27;\n\n $nivelDeBanio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(nivelDeBanio), 4), \",\",\"\") as nivelDeBanio'))\n ->get();\n\n $banda1NivelDeBano = 20;\n $banda2NivelDeBano = 23;\n $minNivelDeBano = 15;\n $maxNivelDeBano = 27;\n\n $frecuenciaTK = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM(numeroTK)/count(*), 4), \",\",\"\") as frecuenciaTK'))\n ->get();\n\n $banda1FrecuenciaTK = 0.15;\n $banda2FrecuenciaTK = null;\n $minFrecuenciaTK = 0;\n $maxFrecuenciaTK = 2.5;\n\n $duracionTK = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(duracionTk), 4), \",\",\"\") as duracionTk'))\n ->get();\n\n $banda1DuracionTK = 0.7;\n $banda2DuracionTK = 0.8;\n $minDuracionTK = 0.5;\n $maxDuracionTK = 1.9;\n\n $golpesAlumina = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(golpesAlumina), 4), \",\",\"\") as golpesAlumina'))\n ->get();\n\n $banda1GolpesAlumina = 2.4;\n $banda2GolpesAlumina = null;\n $minGolpesAlumina = 1.7;\n $maxGolpesAlumina = 3.2;\n \n $alimentacionAlumina = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(golpesAlumina), 4), \",\",\"\") as alimentacionAlumina'))\n ->get();\n \n $banda1AlimentacionAlumina = 1200;\n $banda2AlimentacionAlumina = 1300;\n $minAlimentacionAlumina = 800;\n $maxAlimentacionAlumina = 1350;\n\n $temperatura = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(temperatura), 4), \",\",\"\") as temperatura'))\n ->get();\n\n $banda1Temperatura = 960;\n $banda2Temperatura = 965;\n $minTemperatura = 950;\n $maxTemperatura = 990;\n\n $acidez = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(acidez), 4), \",\",\"\") as acidez'))\n ->get();\n\n $banda1Acidez = 10.5;\n $banda2Acidez = 11;\n $minAcidez = 8;\n $maxAcidez = 13.5;\n\n $desvTemperatura = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV(temperatura), 4), \",\",\"\") as desvTemperatura'))\n ->get();\n \n $banda1DesvTemperatura = 10;\n $banda2DesvTemperatura = null;\n $minDesvTemperatura = 0;\n $maxDesvTemperatura = 25;\n\n $desvAcidez = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV(acidez), 4), \",\",\"\") as desvAcidez'))\n ->get();\n\n $banda1DesvAcidez = 1.0;\n $banda2DesvAcidez = null;\n $minDesvAcidez = 0;\n $maxDesvAcidez = 4;\n\n $consumoFl = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(temperatura), 4), \",\",\"\") as consumoFl'))\n ->get();\n\n $banda1ConsumoFl = 50;\n $banda2ConsumoFl = 70;\n $minConsumoFl = 0;\n $maxConsumoFl = 170;\n\n\n $porcHierro = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(fe), 4), \",\",\"\") as porcHierro'))\n ->get();\n\n $banda1PorcHierro = 0.2;\n $banda2PorcHierro = null;\n $minPorcHierro = 0;\n $maxPorcHierro = 1.1;\n\n $purezaSilicio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(si), 4), \",\",\"\") as purezaSilicio'))\n ->get();\n\n $banda1PurezaSilicio = 1;\n $banda2PurezaSilicio = 1;\n $minPurezaSilicio = 0;\n $maxPurezaSilicio = 0.45;\n\n $porcSilicio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(si), 4), \",\",\"\") as porcSilicio'))\n ->get();\n\n $banda1PorcSilicio = 0.08;\n $banda2PorcSilicio = null;\n $minPorcSilicio = 0;\n $maxPorcSilicio = 0.45;\n\n return response()->json(\n [ 'fecha1' => $fecha1,\n 'fecha2' => $fecha2,\n\n 'datosVoltaje' => $voltaje,\n 'banda1Voltaje' => $banda1Voltaje,\n 'banda2Voltaje' => $banda2Voltaje,\n 'minVoltaje' => $minVoltaje,\n 'maxVoltaje' => $maxVoltaje,\n\n 'datosCorriente' => $corriente,\n 'banda1Corriente' => $banda1Corriente,\n 'banda2Corriente' => $banda2Corriente,\n 'minCorriente' => $minCorriente,\n 'maxCorriente' => $maxCorriente,\n\n 'datosEfCorriente' => $efCorriente,\n 'banda1EfCorriente' => $banda1EfCorriente,\n 'banda2EfCorriente' => $banda2EfCorriente,\n 'minEfCorriente' => $minEfCorriente,\n 'maxEfCorriente' => $maxEfCorriente,\n\n 'datosDesvResistencia' => $desvResistencia,\n 'banda1DesvResistencia' => $banda1DesvResistencia ,\n 'banda2DesvResistencia' => $banda2DesvResistencia,\n 'minDesvResistencia' => $minDesvResistencia,\n 'maxDesvResistencia' => $maxDesvResistencia,\n \n 'datosFrecuenciaEA' => $frecuenciaEA,\n 'banda1FrecuenciaEA' => $banda1FrecuenciaEA ,\n 'banda2FrecuenciaEA' => $banda2FrecuenciaEA,\n 'minFrecuenciaEA' => $minFrecuenciaEA,\n 'maxFrecuenciaEA' => $maxFrecuenciaEA,\n \n 'datosPotencia' => $potencia,\n 'banda1Potencia' => $banda1Potencia,\n 'banda2Potencia' => $banda2Potencia , \n 'minPotencia' => $minPotencia,\n 'maxPotencia' => $maxPotencia,\n \n 'datosNivelDeMetal' => $nivelDeMetal,\n 'banda1NivelDeMetal' => $banda1NivelDeMetal, \n 'banda2NivelDeMetal' => $banda2NivelDeMetal,\n 'minNivelDeMetal' => $minNivelDeMetal,\n 'maxNivelDeMetal' => $maxNivelDeMetal,\n \n 'datosNivelDeBanio' => $nivelDeBanio,\n 'banda1NivelDeBano' => $banda1NivelDeBano,\n 'banda2NivelDeBano' => $banda2NivelDeBano,\n 'minNivelDeBano' => $minNivelDeBano,\n 'maxNivelDeBano' => $maxNivelDeBano,\n \n 'datosFrecuenciaTK' => $frecuenciaTK,\n 'banda1FrecuenciaTK' => $banda1FrecuenciaTK,\n 'banda2FrecuenciaTK' => $banda2FrecuenciaTK,\n 'minFrecuenciaTK' => $minFrecuenciaTK,\n 'maxFrecuenciaTK' => $maxFrecuenciaTK,\n \n 'datosDuracionTK' => $duracionTK,\n 'banda1DuracionTK' => $banda1DuracionTK,\n 'banda2DuracionTK' => $banda2DuracionTK, \n 'minDuracionTK' => $minDuracionTK,\n 'maxDuracionTK' => $maxDuracionTK,\n \n 'datosGolpesAlumina' => $golpesAlumina,\n 'banda1GolpesAlumina' => $banda1GolpesAlumina,\n 'banda2GolpesAlumina' => $banda2GolpesAlumina,\n 'minGolpesAlumina' => $minGolpesAlumina,\n 'maxGolpesAlumina' => $maxGolpesAlumina,\n \n 'datosAlimentacionAlumina' => $alimentacionAlumina,\n 'banda1AlimentacionAlumina' => $banda1AlimentacionAlumina,\n 'banda2AlimentacionAlumina' => $banda2AlimentacionAlumina,\n 'minAlimentacionAlumina' => $minAlimentacionAlumina,\n 'maxAlimentacionAlumina' => $maxAlimentacionAlumina,\n\n 'datosTemperatura' => $temperatura,\n 'banda1Temperatura' => $banda1Temperatura,\n 'banda2Temperatura' => $banda2Temperatura,\n 'minTemperatura' => $minTemperatura,\n 'maxTemperatura' => $maxTemperatura,\n \n 'datosAcidez' => $acidez,\n 'banda1Acidez' => $banda1Acidez,\n 'banda2Acidez' => $banda2Acidez,\n 'minAcidez' => $minAcidez,\n 'maxAcidez' => $maxAcidez,\n \n 'datosDesvTemperatura' => $desvTemperatura,\n 'banda1DesvTemperatura' => $banda1DesvTemperatura,\n 'banda2DesvTemperatura' => $banda2DesvTemperatura,\n 'minDesvTemperatura' => $minDesvTemperatura,\n 'maxDesvTemperatura' => $maxDesvTemperatura,\n \n 'datosDesvAcidez' => $desvAcidez,\n 'banda1DesvAcidez' => $banda1DesvAcidez,\n 'banda2DesvAcidez' => $banda2DesvAcidez,\n 'minDesvAcidez' => $minDesvAcidez,\n 'maxDesvAcidez' => $maxDesvAcidez,\n \n 'datosConsumoFl' => $consumoFl,\n 'banda1ConsumoFl' => $banda1ConsumoFl,\n 'banda2ConsumoFl' => $banda2ConsumoFl,\n 'minConsumoFl' => $minConsumoFl,\n 'maxConsumoFl' => $maxConsumoFl,\n \n 'datosPorcHierro' => $porcHierro,\n 'banda1PorcHierro' => $banda1PorcHierro,\n 'banda2PorcHierro' => $banda2PorcHierro, \n 'minPorcHierro' => $minPorcHierro,\n 'maxPorcHierro' => $maxPorcHierro,\n \n 'datosPurezaSilicio' => $purezaSilicio,\n 'banda1PurezaSilicio' => $banda1PurezaSilicio,\n 'banda2PurezaSilicio' => $banda2PurezaSilicio,\n 'minPurezaSilicio' => $minPurezaSilicio,\n 'maxPurezaSilicio' => $maxPurezaSilicio,\n \n 'datosPorcSilicio' => $porcSilicio,\n 'banda1PorcSilicio' => $banda1PorcSilicio,\n 'banda2PorcSilicio' => $banda2PorcSilicio,\n 'minPorcSilicio' => $minPorcSilicio,\n 'maxPorcSilicio' => $maxPorcSilicio,\n \n ]);\n\n }\n \n }", "public static function getPrevalenceRatesChart($testTypeID = 0){\n\t\t$from = Input::get('start');\n\t\t$to = Input::get('end');\n\t\t$months = json_decode(self::getMonths($from, $to));\n\t\t$testTypes = new Illuminate\\Database\\Eloquent\\Collection();\n\n\t\tif($testTypeID == 0){\n\t\t\t\n\t\t\t$testTypes = TestType::supportPrevalenceCounts();\n\t\t}else{\n\t\t\t$testTypes->add(TestType::find($testTypeID));\n\t\t}\n\n\t\t$options = '{\n\t\t \"chart\": {\n\t\t \"type\": \"spline\"\n\t\t },\n\t\t \"title\": {\n\t\t \"text\":\"'.trans('messages.prevalence-rates').'\"\n\t\t },\n\t\t \"subtitle\": {\n\t\t \"text\":'; \n\t\t if($from==$to)\n\t\t \t$options.='\"'.trans('messages.for-the-year').' '.date('Y').'\"';\n\t\t else\n\t\t \t$options.='\"'.trans('messages.from').' '.$from.' '.trans('messages.to').' '.$to.'\"';\n\t\t $options.='},\n\t\t \"credits\": {\n\t\t \"enabled\": false\n\t\t },\n\t\t \"navigation\": {\n\t\t \"buttonOptions\": {\n\t\t \"align\": \"right\"\n\t\t }\n\t\t },\n\t\t \"series\": [';\n\t\t \t$counts = count($testTypes);\n\n\t\t\t \tforeach ($testTypes as $testType) {\n\t\t \t\t$options.= '{\n\t\t \t\t\t\"name\": \"'.$testType->name.'\",\"data\": [';\n\t\t \t\t\t\t$counter = count($months);\n\t\t \t\t\tforeach ($months as $month) {\n\t\t \t\t\t$data = $testType->getPrevalenceCount($month->annum, $month->months);\n\t\t \t\t\t\tif($data->isEmpty()){\n\t\t \t\t\t\t\t$options.= '0.00';\n\t\t \t\t\t\t\tif($counter==1)\n\t\t\t \t\t\t\t\t$options.='';\n\t\t\t \t\t\t\telse\n\t\t\t \t\t\t\t\t$options.=',';\n\t\t \t\t\t\t}\n\t\t \t\t\t\telse{\n\t\t \t\t\t\t\tforeach ($data as $datum) {\n\t\t\t\t \t\t\t\t$options.= $datum->rate;\n\n\t\t\t\t \t\t\t\tif($counter==1)\n\t\t\t\t \t\t\t\t\t$options.='';\n\t\t\t\t \t\t\t\telse\n\t\t\t\t \t\t\t\t\t$options.=',';\n\t\t\t\t\t \t\t}\n\t\t \t\t\t\t}\n\t\t \t\t\t$counter--;\n\t\t\t\t \t\t}\n\t\t\t\t \t\t$options.=']';\n\t\t\t\t \tif($counts==1)\n\t\t\t\t\t\t\t$options.='}';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$options.='},';\n\t\t\t\t\t\t$counts--;\n\t\t\t\t\t}\n\t\t\t$options.='],\n\t\t \"xAxis\": {\n\t\t \"categories\": [';\n\t\t $count = count($months);\n\t \tforeach ($months as $month) {\n\t \t\t\t\t$options.= '\"'.$month->label.\" \".$month->annum;\n\t \t\t\t\tif($count==1)\n\t \t\t\t\t\t$options.='\" ';\n\t \t\t\t\telse\n\t \t\t\t\t\t$options.='\" ,';\n\t \t\t\t\t$count--;\n\t \t\t\t}\n\t $options.=']\n\t\t },\n\t\t \"yAxis\": {\n\t\t \"title\": {\n\t\t \"text\": \"'.trans('messages.prevalence-rates-label').'\"\n\t\t },\n\t \"min\": \"0\",\n\t \"max\": \"100\"\n\t\t }\n\t\t}';\n\treturn $options;\n\t}", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "function getDashboardData() {\n $arrRes=array();\n \n //For Calculating orders count\n $arrClms = 'pkOrderItemID';\n $varTable = TABLE_ORDER_ITEMS;\n $argWhere = 'AND Status <> \"Canceled\"';\n $arrNum = $this->getNumRows($varTable, $arrClms, $argWhere);\n $arrRes['ordersCount']=$arrNum;\n \n //For Calculating Unique visitors count\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR;\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['visitorsCount']=$arrData;\n \n \n //For Calculating Total Revenue(from orders) sum\n $varQuery = \"SELECT pkOrderItemID,ItemType,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled'\";\n $arrData = $this->getArrayResult($varQuery);\n $sum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n }\n //echo $sum;\n \n //pre($arrData);\n $arrRes['revenueSum']=$sum;\n \n //pre($arrRes);\n return $arrRes;\n }", "private function rateOfSaleTrackerGrid() {\n\t\t$arr = array();\t\t\n /*[PART 1] GETTING THE STORE COUNT DATA*/\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n $this->measureFields[] = $this->accountID;\n $this->measureFields[] = $this->storeCount;\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\t\t$getStoreData = $this->storeCountData($this->accountID,$this->storeCount);\n\n\t\t/*[PART 2] GETTING THE GRID DATA*/\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n \t$measureSelectRes = $this->prepareMeasureSelectPart();\n\t\t$this->measureFields = $measureSelectRes['measureFields'];\n\n\t\t$measureSelectionArr = $measureSelectRes['measureSelectionArr'];\n\t\t$havingTYValue \t\t = $measureSelectRes['havingTYValue'];\n\t\t$havingLYValue \t\t = $measureSelectRes['havingLYValue'];\n\n $this->measureFields[] = $this->accountID;\n $this->measureFields[] = $this->accountName;\n\t\t\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\n /*$options = array();\n if (!empty($this->ytdTyWeekRange))\n $options['tyLyRange']['SALES'] = $this->ytdTyWeekRange;\n\n if (!empty($this->ytdLyWeekRange))\n $options['tyLyRange']['LYSALES'] = $this->ytdLyWeekRange;\n\n $measureSelect = config\\MeasureConfigure::prepareSelect($this->settingVars, $this->queryVars, array('M'.$_REQUEST['ValueVolume']), $options);\n $measureSelect = implode(\", \", $measureSelect);*/\n\n\t\t$measureSelect = implode(\", \", $measureSelectionArr);\n $query = \"SELECT \".$this->accountID.\" as SKUID\" .\n\t\t\t\t\",\".$this->accountName.\" as SKU\".\n\t\t\t\t\",\".$measureSelect.\" \".\n \",SUM((CASE WHEN \" . $this->ytdTyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectVolume.\") as QTY \".\n \",SUM((CASE WHEN \" . $this->ytdLyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectVolume.\") as QTY_LY \".\n \",SUM((CASE WHEN \" . $this->ytdTyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectValue.\") as VAL_TY \".\n\t\t\t\t\",SUM((CASE WHEN \" . $this->ytdLyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectValue.\") as VAL_LY \".\n \"FROM \" . $this->settingVars->tablename.\" \".$this->queryPart.\n\t\t\t\t\" AND (\" . $this->ytdTyWeekRange . \" OR \" . $this->ytdLyWeekRange . \") \".\n\t\t\t\t\"GROUP BY SKUID, SKU \";\n\t\t\n\t\t//HAVING (SALES > 0 AND QTY > 0) ORDER BY SALES DESC\n\t\t$redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\n if ($redisOutput === false) {\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n $this->redisCache->setDataForHash($result);\n } else {\n $result = $redisOutput;\n }\n\n\n\t\t$requiredGridFields = ['SKUID','SKU','QTY','QTY_LY','VAL_TY','VAL_LY',$havingTYValue, $havingLYValue];\n\t\t$result = $this->redisCache->getRequiredData($result, $requiredGridFields, $havingTYValue, $havingTYValue);\n\t\t\n\t\tif (is_array($result) && !empty($result)) {\n\n\t\t\t$result = \\utils\\SortUtility::sort2DArray($result, $havingTYValue, \\utils\\SortTypes::$SORT_DESCENDING);\t\n\t\t\t//$total = array_sum(array_column($result,'SALES'));\n //$totalSALESLY = array_sum(array_column($result,'LYSALES'));\n\t\t\t\n // $total = array_sum(array_column($result,$havingTYValue));\n // $totalSALESLY = array_sum(array_column($result,$havingLYValue));\n \n $total = $totalSALESLY = 0;\n $resultFn = [];\n foreach($result as $data){\n if(round($data[$havingTYValue]) > 0 && $data['QTY'] > 0){\n $total += $data[$havingTYValue];\n $totalSALESLY += $data[$havingLYValue];\n $resultFn[] = $data;\n }\n }\n\n\t\t\tforeach($resultFn as $data){\n\t\t\t\tif(round($data[$havingTYValue]) > 0 && $data['QTY'] > 0){\n $data[$havingTYValue] = round($data[$havingTYValue]);\n $data[$havingLYValue] = round($data[$havingLYValue]);\n \n\t\t\t\t\t$var = $data[$havingLYValue] != 0 ? ((($data[$havingTYValue] - $data[$havingLYValue]) / $data[$havingLYValue]) * 100) : 0;\n\t $share = $total != 0 ? (($data[$havingTYValue] / $total) * 100) : 0;\n\t $shareLY = $totalSALESLY != 0 ? (($data[$havingLYValue] / $totalSALESLY) * 100) : 0;\n\n\t\t\t\t\t$temp = array();\n\t\t\t\t\t$temp['SKUID'] \t\t= $data['SKUID'];\n\t\t\t\t\t$temp['SKU'] \t\t= $data['SKU'];\n\t\t\t\t\t$temp['SALES'] \t\t= $data[$havingTYValue];\n\t\t\t\t\t$temp['LYSALES'] \t= $data[$havingLYValue];\n\t\t\t\t\t$temp['VAR'] \t\t= $var;\n\t\t\t\t\t$temp['SHARE'] \t\t= $share;\n\t\t\t\t\t$temp['SHARELY'] \t= $shareLY;\n\t\t\t\t\t$temp['QTY'] \t\t= $data['QTY'];\n $temp['QTY_LY'] = $data['QTY_LY'];\n $temp['QTY_VAR'] = ($data['QTY_LY'] > 0) ? number_format( (($data['QTY'] - $data['QTY_LY']) / $data['QTY_LY']) * 100, 1, '.', '') : 0;\n\t\t\t\t\t$temp['CASH_ROS'] \t= ($getStoreData[$data['SKUID']]['ID_TY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VALUE_TY']/$getStoreData[$data['SKUID']]['ID_TY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['QTY_ROS'] \t= ($getStoreData[$data['SKUID']]['ID_TY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VOLUME_TY']/$getStoreData[$data['SKUID']]['ID_TY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['CROS_LY'] \t= ($getStoreData[$data['SKUID']]['ID_LY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VALUE_LY']/$getStoreData[$data['SKUID']]['ID_LY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['QROS_LY'] \t= ($getStoreData[$data['SKUID']]['ID_LY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VOLUME_LY']/$getStoreData[$data['SKUID']]['ID_LY'], 2, '.', '') : 0;\n\t $temp['AVE_STORE_TY'] = number_format($getStoreData[$data['SKUID']]['AVE_STORE_TY'], 2, '.', '');\n\t $temp['AVE_STORE_LY'] = number_format($getStoreData[$data['SKUID']]['AVE_STORE_LY'], 2, '.', '');\n \n $temp['AVE_PRICE_TY'] = ($data['QTY'] > 0) ? number_format($data['VAL_TY'] / $data['QTY'], 2, '.', '') : 0;\n $temp['AVE_PRICE_LY'] = ($data['QTY_LY'] > 0) ? number_format($data['VAL_LY'] / $data['QTY_LY'], 2, '.', '') : 0;\n\n\t\t\t\t\t$arr[]\t\t\t\t= $temp;\n\t\t\t\t}\n\t\t\t}\n\t\t} // end if\n $this->jsonOutput['rateOfSaleTrackerGrid'] = $arr;\n }", "public function get_total_revenue_items( $args = array() ) {\n $default_args = array(\n 'fields' => array( 'SUM(price) AS amount', ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_row( $args );\n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "public function getRevenue()\n {\n $order = $this->checkoutSession->getLastRealOrder();\n\n return $order->getData('total_due');\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "function calculate_data() {\n $this->data = array();\n $this->data['series'] = array();\n\n $series_size = 0;\n\n $series_list = $this->calculate_series_list();\n foreach($series_list as $key => $value) {\n $this->data['series'][$value] = $this->calculate_series($key);\n\n if($series_size < count($this->data['series'][$value])) {\n $series_size = count($this->data['series'][$value]);\n }\n }\n\n $this->data['labels'] = $this->calculate_labels($series_size);\n }", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "function get_risk_trend($project) {\n\t$chart = new Highchart ();\n\t$chart->includeExtraScripts ();\n\t\n\t$chart->chart->type = \"arearange\";\n\t$chart->chart->zoomType = \"x\";\n\t$chart->title->text = \"Risks Opened and Closed Over Time\";\n\t$chart->xAxis->type = \"datetime\";\n\t$chart->yAxis->title->text = null;\n\t$chart->yAxis->min = 0;\n\t$chart->tooltip = array (\n\t\t\t'crosshairs' => true,\n\t\t\t'shared' => true,\n\t\t\t'valueSuffix' => ' risk(s)' \n\t);\n\t$chart->legend->enabled = false;\n\t$chart->chart->renderTo = \"risk_trend_chart\";\n\t$chart->credits->enabled = false;\n\t$chart->plotOptions->series->marker->enabled = false;\n\t$chart->plotOptions->series->marker->lineWidth = \"2\";\n\t// These set the marker symbol when selected\n\t$chart->plotOptions->series->marker->symbol = \"circle\";\n\t$chart->plotOptions->series->marker->states->hover->enabled = true;\n\t$chart->plotOptions->series->marker->states->hover->fillColor = \"white\";\n\t$chart->plotOptions->series->marker->states->hover->lineColor = \"black\";\n\t$chart->plotOptions->series->marker->states->hover->lineWidth = \"2\";\n\t\n\t// Open the database connection\n\t$db = db_open ();\n\t\n\t// Query the database\n\t$stmt = $db->prepare ( \"SELECT DATE(submission_date) date, COUNT(DISTINCT id) count FROM `risks` WHERE project_version_id = $project GROUP BY DATE(submission_date) ORDER BY DATE(submission_date)\" );\n\t$stmt->execute ();\n\t\n\t// Store the list in the array\n\t$opened_risks = $stmt->fetchAll ();\n\t\n\t// Query the database\n\t$stmt = $db->prepare ( \"SELECT DATE(a.closure_date) date, COUNT(DISTINCT b.id) count FROM `closures` a JOIN `risks` b ON a.risk_id = b.id WHERE b.status = \\\"Closed\\\" AND b.project_version_id = $project GROUP BY DATE(a.closure_date)\" );\n\t$stmt->execute ();\n\t\n\t// Store the list in the array\n\t$closed_risks = $stmt->fetchAll ();\n\t\n\t// Close the database connection\n\tdb_close ( $db );\n\t\n\t// If the opened risks array is empty\n\tif (empty ( $opened_risks )) {\n\t\t$opened_risk_data [] = array (\n\t\t\t\t\"No Data Available\",\n\t\t\t\t0 \n\t\t);\n\t} \t// Otherwise\n\telse {\n\t\t// Set the sum to 0\n\t\t$opened_sum = 0;\n\t\t$closed_sum = 0;\n\t\t\n\t\t// Set the start date\n\t\t$date = $opened_risks [0] ['date'];\n\t\t\n\t\t// For each date from the start date until today\n\t\twhile ( strtotime ( $date ) <= time () ) {\n\t\t\t// If the PHP version is >= 5.5.0\n\t\t\t// array_column is new as of PHP 5.5\n\t\t\tif (strnatcmp ( phpversion (), '5.5.0' ) >= 0) {\n\t\t\t\t// Search the opened array for the value\n\t\t\t\t$opened_search = array_search ( $date, array_column ( $opened_risks, 'date' ) );\n\t\t\t} else\n\t\t\t\t$opened_search = false;\n\t\t\t\t\n\t\t\t\t// If the current date is in the opened array\n\t\t\tif ($opened_search !== false) {\n\t\t\t\t$count = $opened_risks [$opened_search] ['count'];\n\t\t\t\t$opened_sum += $count;\n\t\t\t}\n\t\t\t\n\t\t\t// If the PHP version is >= 5.5.0\n\t\t\t// array_column is new as of PHP 5.5\n\t\t\tif (strnatcmp ( phpversion (), '5.5.0' ) >= 0) {\n\t\t\t\t// Search the closed array for the value\n\t\t\t\t$closed_search = array_search ( $date, array_column ( $closed_risks, 'date' ) );\n\t\t\t} else\n\t\t\t\t$closed_search = false;\n\t\t\t\t\n\t\t\t\t// If the current date is in the closed array\n\t\t\tif ($closed_search !== false) {\n\t\t\t\t$count = $closed_risks [$closed_search] ['count'];\n\t\t\t\t$closed_sum += $count;\n\t\t\t}\n\t\t\t\n\t\t\t// Create the data arrays\n\t\t\t$opened_risk_data [] = array (\n\t\t\t\t\t(strtotime ( $date ) + 2 * 86400) * 1000,\n\t\t\t\t\t$opened_sum \n\t\t\t);\n\t\t\t$closed_risk_data [] = array (\n\t\t\t\t\t(strtotime ( $date ) + 2 * 86400) * 1000,\n\t\t\t\t\t$closed_sum \n\t\t\t);\n\t\t\t$trend_data [] = array (\n\t\t\t\t\t(strtotime ( $date ) + 2 * 86400) * 1000,\n\t\t\t\t\t$opened_sum - $closed_sum \n\t\t\t);\n\t\t\t\n\t\t\t// Increment the date one day\n\t\t\t$date = date ( \"Y-m-d\", strtotime ( \"+1 day\", strtotime ( $date ) ) );\n\t\t}\n\t\t\n\t\t// Draw the open risks line\n\t\t$chart->series [] = array (\n\t\t\t\t'type' => \"line\",\n\t\t\t\t'name' => \"Opened Risks\",\n\t\t\t\t'color' => \"red\",\n\t\t\t\t'lineWidth' => \"2\",\n\t\t\t\t'data' => $opened_risk_data \n\t\t);\n\t\t\n\t\t// Draw the closed risks line\n\t\t$chart->series [] = array (\n\t\t\t\t'type' => \"line\",\n\t\t\t\t'name' => \"Closed Risks\",\n\t\t\t\t'color' => \"blue\",\n\t\t\t\t'lineWidth' => \"2\",\n\t\t\t\t'data' => $closed_risk_data \n\t\t);\n\t\t\n\t\t// Draw the trend line\n\t\t$chart->series [] = array (\n\t\t\t\t'type' => \"line\",\n\t\t\t\t'name' => \"Trend\",\n\t\t\t\t'color' => \"#000000\",\n\t\t\t\t'lineWidth' => \"2\",\n\t\t\t\t'data' => $trend_data \n\t\t);\n\t}\n\t$htmloutput = '';\n\t\n\t$htmloutput.= $chart->printScripts2 ();\n\t$htmloutput.= \"<div id=\\\"risk_trend_chart\\\"></div>\\n\";\n\t$htmloutput.= \"<script type=\\\"text/javascript\\\">\";\n\t$htmloutput.= $chart->render ( \"risk_trend_chart\" );\n\t$htmloutput.= \"</script>\\n\";\n\treturn $htmloutput; \n}", "public function getTotalRevenue()\n {\n if(!$this->totalRevenue) $this->totalRevenue = new Money(0);\n\n return $this->totalRevenue;\n }", "function list_revenue_type() \n\t\t{\n\t\t\t\n\t\t\t$this->db->order_by('revenue_type_value','ASC');\n\t\t\t\n\t\t\t$query\t\t\t\t\t=\t\t$this->db->get($this->table_name);\n\t\t\t\n\t\t\treturn $query->result();\n\t\t\t\n\t\t}", "public function stats()\n {\n $villages=Village::all();\n foreach ($villages as $village)\n {\n $village_stat_data=$this->village_stat->find($village->id);\n $village_stat_data->village_name=$village->village_name;\n $village_stat_data->households_count=$village->households;\n $village_stat_data->save();\n }\n\n $roms = $this->roms;\n $count_households=new SampleChart;\n $api=url('/stats_data');\n $villages = Village::all()->sortBy(\"village_name\");\n $data['villages']=Villagestat::all()->sortBy(\"village_name\");\n foreach ($villages as $village) {\n $label[]=$village->village_name;\n }\n $count_households->labels($label)->load($api);\n//MaxMin\n$data['maxs'] = DB::table('village_stats')->orderBy('rom_households_count','desc')->first();\n$data['min'] = DB::table('village_stats')->orderBy('rom_households_count','asc')->first();\n//\n //General data\n $data['household_records']=Household::count();\n $data['roms']=DB::table('households')\n ->whereIn('households.nationality',$roms)\n ->count();\n //$data['romstotal']=DB::table('village_stats')->sum('village_stats.roms_count');\n $data['romstotal']=DB::table('nations')->sum('total');\n $data['village_records']=Village::count();\n //\n return view('charts/villages',['count_households'=>$count_households], $data);\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "private function _getTicketsReferentSales()\n {\n $this->loadModel('Users');\n $users = $this->Users->find('all')->toArray();\n $data = [];\n\n foreach ($users as $user) {\n $count = $this->Tickets->find('all')->where(['paid' => 1, 'user_code' => $user->code])->count();\n\n if($count > 0) {\n $data[] = [\n 'label' => $user->firstname . ' ' . $user->lastname,\n 'value' => $this->Tickets->find('all')->where(['paid' => 1, 'user_code' => $user->code])->count()\n ];\n }\n }\n\n return $data;\n }", "public function index()\n {\n $user = Auth::user();\n $user->authorizeRoles(['College Admin', 'College Super Admin']);\n $institution = $user->institution();\n $collegeName = $user->collegeName;\n\n $revenues = array();\n /** @var College $college */\n foreach ($institution->colleges as $college)\n if ($college->collegeName->id == $collegeName->id)\n foreach ($college->internalRevenues as $internalRevenue)\n $revenues[] = $internalRevenue;\n\n $data = array(\n 'internal_revenues' => $revenues,\n 'page_name' => 'budgets.internal-revenue.index'\n );\n return view('budgets.internal_revenue.index')->with($data);\n }", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "public function getGraphView()\n\t{\n\t\t$chart = new ComboChart();\t\t\n\n\t\t// switch selon le type d'analyse\n\t\tswitch ($this->time) {\n\t\t\t// cas analyse jour\n\t\t\tcase 'day':\t\t\t\t\n\t\t\t $sql = 'SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by date(date_time)';\n\t\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'month':\n\t\t\t// cas analyse mois\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),7) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),7)';\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t// cas analyse année\n\t\t\t\t$sql = 'SELECT \n\t\t\t\t\t\t\tleft(date(date_time),4) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\tgroup by left(date(date_time),4)';\n\t\t\t\tbreak;\n\t\t\tcase 'week':\n\t\t\t// cas analyse 7 derniers jours\n\t\t\t\t$date = new dateTime();\n\t\t\t\t$startDate = $date->format('Y-m-d');\n\t \t\t \t$endDate = $date->modify('-1 week');\n\t \t\t \t$endDate = $endDate->format('Y-m-d');\n\n\t\t\t\t$sql = \"SELECT \n\t\t\t\t\t\t\tdate(date_time) as date, \n\t\t\t\t\t\t\tcount(*) as nb\n\t\t\t\t\t\tfrom `view` \n\t\t\t\t\t\twhere date_time BETWEEN '\" . $endDate . \"' and '\" . $startDate . \"'\n\t\t\t\t\t\tgroup by date(date_time)\";\n\t\t\t\tbreak;\n\t\t}\n\n\n\t $stmt = $this->em->query($sql);\n\t $views = $stmt->fetchAll();\n\n\t\t// entete du googleGraph\n\t\t$arrayToDataTable[] = ['', 'Montant', ['role' => 'tooltip'], 'Evolution', ['role' => 'tooltip']]; \n\n\t\t//data du googleGraph\n\t\tforeach ($views as $view){\n\t\t\t$arrayToDataTable[] = [$view['date'], intval($view['nb']), intval($view['nb']) .\" vues\", 0, \"evolution\"];\n\t\t}\n\n\t\t$chart->getData()->setArrayToDataTable($arrayToDataTable);\n\t\t$vAxisAmount = new VAxis();\n\t\t$vAxisAmount->setTitle('Nombre de vues');\n\t\t$chart->getOptions()->setVAxes([$vAxisAmount]);\n\n\t\t$seriesAmount = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesAmount->setType('bars');\n\t\t$seriesAmount->setTargetAxisIndex(0);\n\t\t$seriesEvol = new \\CMEN\\GoogleChartsBundle\\GoogleCharts\\Options\\ComboChart\\Series();\n\t\t$seriesEvol->setType('line');\n\t\t$seriesEvol->setTargetAxisIndex(1);\n\t\t$chart->getOptions()->setSeries([$seriesAmount, $seriesEvol]);\n\t\t$chart->getOptions()->setColors(['black', 'red']);\t\n\n\t\treturn $chart;\t\t\n\t}", "public function get_total_platform_revenue(): void\n {\n $trackingService = new TrackingService();\n create(Customer::class);\n create(Conversion::class, ['platform' => 'trivago', 'revenue' => 10]);\n create(Conversion::class, ['platform' => 'trivago', 'revenue' => 25]);\n $result = $trackingService->getPlatformRevenue('trivago');\n $this->assertEquals($result, 35);\n }", "public function EvolutionDataChart(Request $request)\n { //get no se utiliza\n if ($request->isMethod('get')) {\n $fecha1='2018-03-01';\n $fecha2='2018-03-30';\n $celda1=901;\n $celda2= 1090;\n \n\n $voltaje = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(voltaje), 4), \",\",\"\") as voltaje'))\n ->get();\n\n $banda1Voltaje = 4.55;\n $banda2Voltaje = 4.65;\n\n $corriente = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(corrienteL), 4), \",\",\"\") as corriente'))\n ->get();\n\n $banda1Corriente = 219;\n $banda2Corriente = null;\n\n $efCorriente = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(corrienteL), 4), \",\",\"\") as efCorriente'))\n ->get();\n\n $banda1EfCorriente = 90;\n $banda2EfCorriente = 94;\n\n $desvResistencia = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(dsr), 4), \",\",\"\") as desvResistencia'))\n ->get();\n\n $banda1DesvResistencia = 0.06;\n $banda2DesvResistencia = null;\n\n $frecuenciaEA = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM(numeroEA)/count(*), 4), \",\",\"\") as frecuenciaEA'))\n ->get();\n\n $banda1FrecuenciaEA = 0.15;\n $banda2FrecuenciaEA = null;\n\n $potencia = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(potencia), 4), \",\",\"\") as potencia'))\n ->get();\n\n $banda1Potencia = 980;\n $banda2Potencia = 1000;\n\n $nivelDeMetal = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(nivelDeMetal), 4), \",\",\"\") as nivelDeMetal'))\n ->get();\n\n $banda1NivelDeMetal = 20;\n $banda2NivelDeMetal = 22;\n\n $nivelDeBanio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(nivelDeBanio), 4), \",\",\"\") as nivelDeBanio'))\n ->get();\n\n $banda1NivelDeBano = 20;\n $banda2NivelDeBano = 23;\n\n $frecuenciaTK = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM(numeroTK)/count(*)), 4), \",\",\"\") as frecuenciaTK'))\n ->get();\n\n $banda1FrecuenciaTK = 0.15;\n $banda2FrecuenciaTK = null;\n\n $duracionTK = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(duracionTk), 4), \",\",\"\") as duracionTk'))\n ->get();\n\n $banda1DuracionTK = 0.7;\n $banda2DuracionTK = 0.8;\n\n $golpesAlumina = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(golpesAlumina), 4), \",\",\"\") as golpesAlumina'))\n ->get();\n\n $banda1GolpesAlumina = 2.4;\n $banda2GolpesAlumina = null;\n \n $alimentacionAlumina = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(golpesAlumina), 4), \",\",\"\") as alimentacionAlumina'))\n ->get();\n \n $banda1AlimentacionAlumina = 1200;\n $banda2AlimentacionAlumina = 1300;\n\n $temperatura = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(temperatura), 4), \",\",\"\") as temperatura'))\n ->get();\n\n $banda1Temperatura = 960;\n $banda2Temperatura = 965;\n\n $acidez = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(acidez), 4), \",\",\"\") as acidez'))\n ->get();\n\n $banda1Acidez = 10.5;\n $banda2Acidez = 11;\n\n $desvTemperatura = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV(temperatura), 4), \",\",\"\") as desvTemperatura'))\n ->get();\n \n $banda1DesvTemperatura = 10;\n $banda2DesvTemperatura = null;\n\n $desvAcidez = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV(acidez), 4), \",\",\"\") as desvAcidez'))\n ->get();\n\n $banda1DesvAcidez = 1.0;\n $banda2DesvAcidez = null;\n\n $consumoFl = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(temperatura), 4), \",\",\"\") as consumoFl'))\n ->get();\n\n $banda1ConsumoFl = 50;\n $banda2ConsumoFl = 70;\n\n\n $porcHierro = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(fe), 4), \",\",\"\") as porcHierro'))\n ->get();\n\n $banda1PorcHierro = 0.2;\n $banda2PorcHierro = null;\n\n $purezaSilicio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(si), 4), \",\",\"\") as purezaSilicio'))\n ->get();\n\n $banda1PurezaSilicio = 1;\n $banda2PurezaSilicio = 1;\n\n $porcSilicio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(si), 4), \",\",\"\") as porcSilicio'))\n ->get();\n\n $banda1PorcSilicio = 0.08;\n $banda2PorcSilicio = null;\n\n return response()->json(\n [ 'datosVoltaje' => $voltaje,\n 'banda1Voltaje' => $banda1Voltaje,\n 'banda2Voltaje' => $banda2Voltaje,\n\n 'datosCorriente' => $corriente,\n 'banda1Corriente' => $banda1Corriente,\n 'banda2Corriente' => $banda2Corriente,\n\n 'datosEfCorriente' => $efCorriente,\n 'banda1EfCorriente' => $banda1EfCorriente,\n 'banda2EfCorriente' => $banda2EfCorriente,\n\n 'datosDesvResistencia' => $desvResistencia,\n 'banda1DesvResistencia' => $banda1DesvResistencia ,\n 'banda2DesvResistencia' => $banda2DesvResistencia,\n \n 'datosFrecuenciaEA' => $frecuenciaEA,\n 'banda1FrecuenciaEA' => $banda1FrecuenciaEA ,\n 'banda2FrecuenciaEA' => $banda2FrecuenciaEA,\n \n 'datosPotencia' => $potencia,\n 'banda1Potencia' => $banda1Potencia,\n 'banda2Potencia' => $banda2Potencia , \n \n 'datosNivelDeMetal' => $nivelDeMetal,\n 'banda1NivelDeMetal' => $banda1NivelDeMetal, \n 'banda2NivelDeMetal' => $banda2NivelDeMetal,\n \n 'datosNivelDeBanio' => $nivelDeBanio,\n 'banda1NivelDeBano' => $banda1NivelDeBano,\n 'banda2NivelDeBano' => $banda2NivelDeBano,\n \n 'datosFrecuenciaTK' => $frecuenciaTK,\n 'banda1FrecuenciaTK' => $banda1FrecuenciaTK,\n 'banda2FrecuenciaTK' => $banda2FrecuenciaTK,\n \n 'datosDuracionTK' => $duracionTK,\n 'banda1DuracionTK' => $banda1DuracionTK,\n 'banda2DuracionTK' => $banda2DuracionTK, \n \n 'datosGolpesAlumina' => $golpesAlumina,\n 'banda1GolpesAlumina' => $banda1GolpesAlumina,\n 'banda2GolpesAlumina' => $banda2GolpesAlumina,\n \n 'datosAlimentacionAlumina' => $alimentacionAlumina,\n 'banda1AlimentacionAlumina' => $banda1AlimentacionAlumina,\n 'banda2AlimentacionAlumina' => $banda2AlimentacionAlumina,\n \n 'datosTemperatura' => $temperatura,\n 'banda1Temperatura' => $banda1Temperatura,\n 'banda2Temperatura' => $banda2Temperatura,\n \n 'datosAcidez' => $acidez,\n 'banda1Acidez' => $banda1Acidez,\n 'banda2Acidez' => $banda2Acidez,\n \n 'datosDesvTemperatura' => $desvTemperatura,\n 'banda1DesvTemperatura' => $banda1DesvTemperatura,\n 'banda2DesvTemperatura' => $banda2DesvTemperatura,\n \n 'datosDesvAcidez' => $desvAcidez,\n 'banda1DesvAcidez' => $banda1DesvAcidez,\n 'banda2DesvAcidez' => $banda2DesvAcidez,\n \n 'datosConsumoFl' => $consumoFl,\n 'banda1ConsumoFl' => $banda1ConsumoFl,\n 'banda2ConsumoFl' => $banda2ConsumoFl,\n \n 'datosPorcHierro' => $porcHierro,\n 'banda1PorcHierro' => $banda1PorcHierro,\n 'banda2PorcHierro' => $banda2PorcHierro, \n \n 'datosPurezaSilicio' => $purezaSilicio,\n 'banda1PurezaSilicio' => $banda1PurezaSilicio,\n 'banda2PurezaSilicio' => $banda2PurezaSilicio,\n \n 'datosPorcSilicio' => $porcSilicio,\n 'banda1PorcSilicio' => $banda1PorcSilicio,\n 'banda2PorcSilicio' => $banda2PorcSilicio,\n \n ]);\n\n }\n else{\n\n list( $fecha1, $fecha2) = explode(' - ', $request->input('rangoFecha'));\n $celda1 = $request->input('celda1');\n $celda2 = $request->input('celda2');\n $calculo = $request->input('calculo');\n $variable = $request->input('variable');\n $variableDB = $request->input('variable');\n $operador1 = $request->input('operador1');\n\n $varFiltro = $request->input('varFiltro') ; \n $rangoVF1 = $request->input('rangoVF1'); \n $rangoVF2 = $request->input('rangoVF2') ; \n $operadorVF = $request->input('operadorVF');\n\n $operador2 = $request->input('var2Operador');\n switch ($operador1) {\n case 'mayor':\n $operador1 = '>';\n break;\n case 'menor':\n $operador1 = '<';\n break;\n case 'mayorigual':\n $operador1 = '>=';\n break;\n case 'menorigual':\n $operador1 = '<=';\n break;\n \n \n }\n\n\n $rangoOp1 = $request->input('rango1');\n $rangoOp2 = $request->input('rango2');\n \n\n $min = floatval($request->input('EscalaMin'));\n $max = floatval($request->input('EscalaMax'));\n $banda1= $request->input('banda1');\n $banda2= $request->input('banda2');\n if($varFiltro != \"\" ){\n switch($varFiltro){\n case \"Voltaje\":\n $varFiltro = 'voltaje';\n break;\n \n case \"Efectos anodicos\":\n $varFiltro = 'numeroEA';\n \n break;// frecuencia de efectos anodicos falta encontrar en bd, segun maita\n \n case \"Desviación de Resistencia\":\n $varFiltro = 'resistencia';\n \n break;\n \n case \"Alimentacion de alumina\":\n $varFiltro = 'golpesAlumina';\n \n break;\n \n case \"Temperatura de baño\":\n $varFiltro = 'temperatura';\n \n break;\n \n case \"Duracion de Tracking\":\n $varFiltro = 'duracionTk';\n \n break;\n \n case \"Acidez de Baño\":\n $varFiltro = 'acidez';\n \n break;\n \n case \"Dump Size Alumina\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Consumo AlF3\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Track CD\":\n $varFiltro = 'numeroTk';\n \n break; //segun maita\n \n case \"Consumo AlF3 Manual\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"VMAX del Efecto Anodico\":\n $varFiltro = 'vMaxEA';\n break;\n \n case \"Eficiencia de Trasegado (Eficiencia de corriente)\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Duracion de Efecto anódico\":\n $varFiltro = 'duracionEA';\n break;\n \n case \"Nivel de Metal\":\n $varFiltro = 'nivelDeMetal';\n \n break;\n \n case \"Corriente de Linea \":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Potencia nominal\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"(BO+RAJ+BIM+Tetas)\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Potencia Neta\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Anodos B/O cambio Normal\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Nivel de Baño\":\n $varFiltro = 'nivelDeBanio';\n \n break;\n \n case \"Anodos Bimetalicos\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Criolita Neta \":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Criolita de Arranque\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Anodos B/A\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Baño Fase Densa\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Desviacion de Temperatura\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Hierro Metal de Celdas \":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Desviacion Acidez\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Silicio Metal Celdas\":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"Desviacion Nm\":\n $varFiltro = 'voltaje'; //falta ubicarlo en BD\n break;\n \n case \"Frecuencia Desnatado\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Desviacion Nb\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Celdas Conectadas\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Frecuencia Efectos Anodicos \":\n $varFiltro = 'voltaje';\n \n break;\n \n case \"% CaF2 en el baño electrolitico\":\n $varFiltro = 'voltaje';//falta ubicarlo en BD\n break;\n\n case \"Edad\":\n $varFiltro = 'edad';//falta ubicarlo en BD\n break;\n \n \n }\n switch ($operadorVF) {\n case 'mayor':\n $operadorVF = '>';\n break;\n case 'menor':\n $operadorVF = '<';\n break;\n case 'mayorigual':\n $operadorVF = '>=';\n break;\n case 'menorigual':\n $operadorVF = '<=';\n break; \n }\n } \n \n\n switch($variableDB){\n case \"Voltaje\":\n $variableDB = 'voltaje';\n $ylabel = 'V (voltios)'; \n $xlabel = 'fecha';\n\n if($banda1 == ''){\n $banda1 = 4.55 ;\n } \n if($banda2 == ''){\n $banda2 = 4.65;\n } \n\n if($min == ''){\n $min = 4.4;\n } \n if($max == ''){\n $max = 5.1;\n } \n \n\n break;\n \n case \"Efectos anodicos\":\n $variableDB = 'numeroEA';\n $ylabel = 'EA'; \n $xlabel = 'fecha';\n $banda1= 0.4;\n $banda2= null;\n if($min == ''){\n $min = 0;\n } \n if($max == ''){\n $max = 4;\n } \n break;// frecuencia de efectos anodicos falta encontrar en bd, segun maita\n \n case \"Desviación de Resistencia\":\n $variableDB = 'resistencia';\n $ylabel = 'Microhomnio'; \n $xlabel = 'fecha';\n $banda1= 0.06; ;\n $banda2= null;\n if($min == ''){\n $min = 0;\n } \n if($max == ''){\n $max = 1;\n } \n break;\n \n case \"Alimentacion de alumina\":\n $variableDB = 'golpesAlumina';\n $ylabel = 'numero'; \n $xlabel = 'fecha';\n $banda1= 1200; ;\n $banda2= 1300; // segun maita\n if($min == ''){\n $min =800;\n } \n if($max == ''){\n $max = 1350;\n } //falta ubicarlo en BD\n break;\n \n case \"Temperatura de baño\":\n $variableDB = 'temperatura';\n $ylabel = '°C'; \n $xlabel = 'fecha';\n $banda1= 960; ;\n $banda2= 965;// segun maita\n if($min == ''){\n $min =950;\n } \n if($max == ''){\n $max = 990;\n } \n break;\n \n case \"Duracion de Tracking\":\n $variableDB = 'duracionTk';\n $ylabel = 'h'; \n $xlabel = 'fecha';\n $banda1= 0.7; ;\n $banda2= 0.8; //segun maita\n if($min == ''){\n $min =0.5;\n } \n if($max == ''){\n $max = 1.9;\n } \n break;\n \n case \"Acidez de Bano\":\n $variableDB = 'acidez';\n // segun maita\n $ylabel = '%AlF3'; \n $xlabel = 'fecha';\n $banda1= 10.5; ;\n $banda2= 11;\n if($min == ''){\n $min =8;\n } \n if($max == ''){\n $max = 13.5;\n } //segun maita\n break;\n \n case \"Dump Size Alumina\":\n $variableDB = 'voltaje';\n $ylabel = 'KG/golpe'; \n $xlabel = 'fecha';\n $banda1= null; ;\n $banda2= 2.4;\n if($min == ''){\n $min =1.7;\n } \n if($max == ''){\n $max = 3.2;\n } //falta ubicarlo en BD\n break;\n \n case \"Consumo AlF3\":\n $variableDB = 'voltaje';\n $ylabel = 'KG/CD'; \n $xlabel = 'fecha';\n $banda1= 50; ;\n $banda2= 70;\n if($min == ''){\n $min =0;\n } \n if($max == ''){\n $max = 170;\n } //falta ubicarlo en BD segun maita\n break;\n \n case \"Track CD\":\n $variableDB = 'numeroTk';\n $ylabel = 'KG/CD'; \n $xlabel = 'fecha';\n $banda1= 1; ;\n $banda2= 1.3;\n if($min == ''){\n $min =0;\n } \n if($max == ''){\n $max = 2.5;\n }\n break; //segun maita\n \n case \"Consumo AlF3 Manual\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"VMAX del Efecto Anodico\":\n $variableDB = 'vMaxEA';\n break;\n \n case \"Eficiencia de Trasegado (Eficiencia de corriente)\":\n $variableDB = 'voltaje';\n $ylabel = '%'; \n $xlabel = 'fecha';\n $banda1= 90; ;\n $banda2= 94;\n if($min == ''){\n $min =50;\n } \n if($max == ''){\n $max = 110;\n }//falta ubicarlo en BD segun maita\n break;\n \n case \"Duracion de Efecto anódico\":\n $variableDB = 'duracionEA';\n break;\n \n case \"Nivel de Metal\":\n $variableDB = 'nivelDeMetal';\n $ylabel = 'cm'; \n $xlabel = 'fecha';\n $banda1= 20; ;\n $banda2= 22;\n if($min == ''){\n $min =18;\n } \n if($max == ''){\n $max = 27;\n }\n break;\n \n case \"Corriente de Linea \":\n $variableDB = 'voltaje';\n $ylabel = 'kA'; \n $xlabel = 'fecha';\n $banda1= null; ;\n $banda2= 219; //segun maita\n if($min == ''){\n $min =180;\n } \n if($max == ''){\n $max = 240;\n }//falta ubicarlo en BD\n break;\n \n case \"Potencia nominal\":\n $variableDB = 'voltaje';\n $ylabel = 'KG/CD'; \n $xlabel = 'fecha';\n $banda1= 980; ;\n $banda2= 1000;\n if($min == ''){\n $min =920;\n } \n if($max == ''){\n $max = 1120;\n }//falta ubicarlo en BD\n break;\n \n case \"(BO+RAJ+BIM+Tetas)\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Potencia Neta\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Anodos B/O cambio Normal\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Nivel de Baño\":\n $variableDB = 'nivelDeBanio';\n $ylabel = 'cm'; \n $xlabel = 'fecha';\n $banda1= 20; ;\n $banda2= 23;\n if($min == ''){\n $min =15;\n } \n if($max == ''){\n $max = 27;\n }\n break;\n \n case \"Anodos Bimetalicos\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Criolita Neta \":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Criolita de Arranque\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Anodos B/A\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Baño Fase Densa\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Desviacion de Temperatura\":\n $variableDB = 'voltaje';\n $ylabel = '°C'; \n $xlabel = 'fecha';\n $banda1= null; ;\n $banda2= 10;\n if($min == ''){\n $min =0;\n } \n if($max == ''){\n $max = 25;\n }//falta ubicarlo en BD\n break;\n \n case \"Hierro Metal de Celdas \":\n $variableDB = 'voltaje';\n $ylabel = '%'; \n $xlabel = 'fecha';\n $banda1= null; ;\n $banda2= 0.2;\n if($min == ''){\n $min =0;\n } \n if($max == ''){\n $max = 1.1;\n }//falta ubicarlo en BD, segun maita\n break;\n \n case \"Desviacion Acidez\":\n $variableDB = 'voltaje';\n $ylabel = '%'; \n $xlabel = 'fecha';\n $banda1= null; ;\n $banda2= 1;\n if($min == ''){\n $min =0;\n } \n if($max == ''){\n $max = 4;\n }//falta ubicarlo en BD\n break;\n \n case \"Silicio Metal Celdas\":\n $variableDB = 'voltaje';\n $ylabel = '%'; \n $xlabel = 'fecha';\n $banda1= 0.05; ;\n $banda2= 0.08;\n if($min == ''){\n $min =0;\n } \n if($max == ''){\n $max = 0.45;\n }//falta ubicarlo en BD\n break;\n \n case \"Desviacion Nm\":\n $variableDB = 'voltaje'; //falta ubicarlo en BD\n break;\n \n case \"Frecuencia Desnatado\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Desviacion Nb\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Celdas Conectadas\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Frecuencia Efectos Anodicos \":\n $variableDB = 'voltaje';\n $ylabel = 'EA/CD'; \n $xlabel = 'fecha';\n $banda1= null; ;\n $banda2= 0.15; //segun maita\n if($min == ''){\n $min =1;\n } \n if($max == ''){\n $max = 1.2;\n } //falta ubicarlo en BD\n break;\n \n case \"% CaF2 en el baño electrolitico\":\n $variableDB = 'voltaje';//falta ubicarlo en BD\n break;\n\n }\n \n $variable2 = $request->input('variable2');\n $variableDB2 = $request->input('variable2');\n $rangoOp1Var2 = $request->input('var2Rango1');\n $rangoOp2Var2 = $request->input('var2Rango2');\n\n $banda1Var2 = $request->input('banda1Var2');\n $banda2Var2 = $request->input('banda2Var2');\n $minVar2 = null;\n $maxVar2 = null;\n $ylabelVar2 = null;\n $xlabelVar2 = null;\n $result = null;\n $result2 = null;\n $datatableVar2 = null;\n \n if($variable2 != \"\" ){\n switch($variableDB2){\n case \"Voltaje\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = 'V (voltios)'; \n $xlabelVar2 = 'fecha';\n\n if($banda1Var2 == ''){\n $banda1Var2 = 4.55 ;\n } \n if($banda2Var2 == ''){\n $banda2Var2 = 4.65;\n } \n\n if($minVar2 == ''){\n $minVar2 = 4.4;\n } \n if($maxVar2 == ''){\n $maxVar2 = 5.1;\n } \n \n\n break;\n \n case \"Efectos anodicos\":\n $variableDB2 = 'numeroEA';\n $ylabelVar2 = 'EA'; \n $xlabelVar2 = 'fecha';\n \n $banda2Var2= null;\n if($banda1Var2 == ''){\n $banda1Var2 = 0.4;\n } \n if($minVar2 == ''){\n $minVar2 = 0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 4;\n } \n break;// frecuencia de efectos anodicos falta encontrar en bd, segun maita\n \n case \"Desviación de Resistencia\":\n $variableDB2 = 'resistencia';\n $ylabelVar2 = 'Microhomnio'; \n $xlabelVar2 = 'fecha';\n ;\n $banda2Var2= null;\n if($banda1Var2 == ''){\n $banda1Var2 = 0.06; \n } \n \n if($minVar2 == ''){\n $minVar2 = 0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 1;\n } \n break;\n \n case \"Alimentacion de alumina\":\n $variableDB2 = 'golpesAlumina';\n $ylabelVar2 = 'numero'; \n $xlabelVar2 = 'fecha';\n ;\n \n if($banda1Var2 == ''){\n $banda1Var2 = 1200; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 1300; // segun maita\n } \n if($minVar2 == ''){\n $minVar2 =800;\n } \n if($maxVar2 == ''){\n $maxVar2 = 1350;\n } //falta ubicarlo en BD\n break;\n \n case \"Temperatura de baño\":\n $variableDB2 = 'temperatura';\n $ylabelVar2 = '°C'; \n $xlabelVar2 = 'fecha';\n ;\n \n if($banda1Var2 == ''){\n $banda1Var2 = 960; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 965;// segun maita\n } \n if($minVar2 == ''){\n $minVar2 =950;\n } \n if($maxVar2 == ''){\n $maxVar2 = 990;\n } \n break;\n \n case \"Duracion de Tracking\":\n $variableDB2 = 'duracionTk';\n $ylabelVar2 = 'h'; \n $xlabelVar2 = 'fecha';\n \n if($banda1Var2 == ''){\n $banda1Var2 = 0.7; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 0.8; //segun maita\n } \n if($minVar2 == ''){\n $minVar2 =0.5;\n } \n if($maxVar2 == ''){\n $maxVar2 = 1.9;\n } \n break;\n \n case \"Acidez de Baño\":\n $variableDB2 = 'acidez';\n // segun maita\n $ylabelVar2 = '%AlF3'; \n $xlabelVar2 = 'fecha';\n \n \n if($banda1Var2 == ''){\n $banda1Var2 = 10.5; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 11;\n } \n if($minVar2 == ''){\n $minVar2 =8;\n } \n if($maxVar2 == ''){\n $maxVar2 = 13.5;\n } //segun maita\n break;\n \n case \"Dump Size Alumina\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = 'KG/golpe'; \n $xlabelVar2 = 'fecha';\n $banda1Var2 = null; ;\n \n if($banda2Var2 == ''){\n $banda2Var2= 2.4;\n } \n if($minVar2 == ''){\n $minVar2 =1.7;\n } \n if($maxVar2 == ''){\n $maxVar2 = 3.2;\n } //falta ubicarlo en BD\n break;\n \n case \"Consumo AlF3\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = 'KG/CD'; \n $xlabelVar2 = 'fecha';\n \n if($banda1Var2 == ''){\n $banda1Var2 = 50; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 70;\n } \n if($minVar2 == ''){\n $minVar2 =0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 170;\n } //falta ubicarlo en BD segun maita\n break;\n \n case \"Track CD\":\n $variableDB2 = 'numeroTk';\n $ylabelVar2 = 'KG/CD'; \n $xlabelVar2 = 'fecha';\n \n \n if($banda1Var2 == ''){\n $banda1Var2 = 1; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 1.3;\n } \n if($minVar2 == ''){\n $minVar2 =0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 2.5;\n }\n break; //segun maita\n \n case \"Consumo AlF3 Manual\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"VMAX del Efecto Anodico\":\n $variableDB2 = 'vMaxEA';\n break;\n \n case \"Eficiencia de Trasegado (Eficiencia de corriente)\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = '%'; \n $xlabelVar2 = 'fecha';\n \n \n if($banda1Var2 == ''){\n $banda1Var2 = 90; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 94;\n } \n if($minVar2 == ''){\n $minVar2 =50;\n } \n if($maxVar2 == ''){\n $maxVar2 = 110;\n }//falta ubicarlo en BD segun maita\n break;\n \n case \"Duracion de Efecto anódico\":\n $variableDB2 = 'duracionEA';\n break;\n \n case \"Nivel de Metal\":\n $variableDB2 = 'nivelDeMetal';\n $ylabelVar2 = 'cm'; \n $xlabelVar2 = 'fecha';\n\n if($banda1Var2 == ''){\n $banda1Var2 = 20; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 22;\n } \n if($minVar2 == ''){\n $minVar2 =18;\n } \n if($maxVar2 == ''){\n $maxVar2 = 27;\n }\n break;\n \n case \"Corriente de Linea \":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = 'kA'; \n $xlabelVar2 = 'fecha';\n \n if($banda2Var2 == ''){\n $banda2Var2= 219; //segun maita\n } \n if($minVar2 == ''){\n $minVar2 =180;\n } \n if($maxVar2 == ''){\n $maxVar2 = 240;\n }//falta ubicarlo en BD\n break;\n \n case \"Potencia nominal\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = 'KG/CD'; \n $xlabelVar2 = 'fecha';\n \n if($banda1Var2 == ''){\n $banda1Var2 = 980; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 1000;\n } \n if($minVar2 == ''){\n $minVar2 =920;\n } \n if($maxVar2 == ''){\n $maxVar2 = 1120;\n }//falta ubicarlo en BD\n break;\n \n case \"(BO+RAJ+BIM+Tetas)\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Potencia Neta\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Anodos B/O cambio Normal\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Nivel de Baño\":\n $variableDB2 = 'nivelDeBanio';\n $ylabelVar2 = 'cm'; \n $xlabelVar2 = 'fecha';\n \n if($banda1Var2 == ''){\n $banda1Var2 = 20; \n } \n if($banda2Var2 == ''){\n $banda2Var2= 23;\n } \n if($minVar2 == ''){\n $minVar2 =15;\n } \n if($maxVar2 == ''){\n $maxVar2 = 27;\n }\n break;\n \n case \"Anodos Bimetalicos\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Criolita Neta \":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Criolita de Arranque\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Anodos B/A\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Baño Fase Densa\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Desviacion de Temperatura\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = '°C'; \n $xlabelVar2 = 'fecha';\n $banda1Var2 = null; \n \n if($banda2Var2 == ''){\n $banda2Var2= 10;\n } \n if($minVar2 == ''){\n $minVar2 =0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 25;\n }//falta ubicarlo en BD\n break;\n \n case \"Hierro Metal de Celdas \":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = '%'; \n $xlabelVar2 = 'fecha';\n $banda1Var2 = null; \n \n if($banda2Var2 == ''){\n $banda2Var2= 0.2; \n } \n if($minVar2 == ''){\n $minVar2 =0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 1.1;\n }//falta ubicarlo en BD, segun maita\n break;\n \n case \"Desviacion Acidez\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = '%'; \n $xlabelVar2 = 'fecha';\n $banda1Var2 = null; \n \n if($banda2Var2 == ''){\n $banda2Var2= 1;\n \n } \n if($minVar2 == ''){\n $minVar2 =0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 4;\n }//falta ubicarlo en BD\n break;\n \n case \"Silicio Metal Celdas\":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = '%'; \n $xlabelVar2 = 'fecha';\n \n \n if($banda1Var2 == ''){\n $banda1Var2 = 0.05;\n } \n if($banda2Var2 == ''){\n $banda2Var2= 0.08;\n } \n if($minVar2 == ''){\n $minVar2 =0;\n } \n if($maxVar2 == ''){\n $maxVar2 = 0.45;\n }//falta ubicarlo en BD\n break;\n \n case \"Desviacion Nm\":\n $variableDB2 = 'voltaje'; //falta ubicarlo en BD\n break;\n \n case \"Frecuencia Desnatado\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Desviacion Nb\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Celdas Conectadas\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n \n case \"Frecuencia Efectos Anodicos \":\n $variableDB2 = 'voltaje';\n $ylabelVar2 = 'EA/CD'; \n $xlabelVar2 = 'fecha';\n $banda1Var2 = null; \n \n \n if($banda2Var2 == ''){\n $banda2Var2= 0.15; //segun maita \n } \n if($minVar2 == ''){\n $minVar2 =1;\n } \n if($maxVar2 == ''){\n $maxVar2 = 1.2;\n } //falta ubicarlo en BD\n break;\n \n case \"% CaF2 en el baño electrolitico\":\n $variableDB2 = 'voltaje';//falta ubicarlo en BD\n break;\n\n\n }\n switch ($operador2) {\n case 'mayor':\n $operador2 = '>';\n break;\n case 'menor':\n $operador2 = '<';\n break;\n case 'mayorigual':\n $operador2 = '>=';\n break;\n case 'menorigual':\n $operador2 = '<=';\n break; \n }\n } \n if($celda1 != $celda2){\n if( $calculo == 'Promedio'){\n \n if ($rangoOp1 != '' AND $rangoOp2 != '' AND $operador1 == '' ) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2 ,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2 ,\n \n 'calculo' => $calculo]);\n }\n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2 ,\n \n 'calculo' => $calculo]);\n }\n \n }elseif ($rangoOp1 != '' AND $rangoOp2 == '' AND $operador1 != '' ){\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n } \n \n }elseif (($rangoOp1 == '' AND $rangoOp2 == '' AND $operador1 == '' )) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') { \n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) { \n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]); $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n } \n }\n }\n\n elseif ($calculo == 'Desviacion estandar') {\n \n if ($rangoOp1 != '' AND $rangoOp2 != '' AND $operador1 == '' ) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo ]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo ]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo ]);\n }\n \n }elseif ($rangoOp1 != '' AND $rangoOp2 == '' AND $operador1 != '' ){\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') { \n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }elseif (($rangoOp1 == '' AND $rangoOp2 == '' AND $operador1 == '' )) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') { \n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n }\n } \n\n elseif ($calculo == 'Total') {\n \n if ($rangoOp1 != '' AND $rangoOp2 != '' AND $operador1 == '' ) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo ]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo ]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n \n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo ]);\n }\n \n }elseif ($rangoOp1 != '' AND $rangoOp2 == '' AND $operador1 != '' ){\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }elseif (($rangoOp1 == '' AND $rangoOp2 == '' AND $operador1 == '' )) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 )\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB.'),4), \",\",\"\") as '.$variableDB))\n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n \n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM('.$variableDB2.'),4), \",\",\"\") as '.$variableDB2))\n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }\n }\n \n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => $calculo]);\n \n }\n \n }\n } \n \n\n }else{\n if ($rangoOp1 != '' AND $rangoOp2 != '' AND $operador1 == '' ) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '' ]);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ) {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '' ]);\n }\n \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB, [$rangoOp1,$rangoOp2]) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '' ]);\n }\n }elseif ($rangoOp1 != '' AND $rangoOp2 == '' AND $operador1 != '' ){\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '']);\n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ){\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '']);\n }\n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB, $operador1 , $rangoOp1 ) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n //segunda variable\n if($variable2 != ''){\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '']);\n }\n \n }elseif (($rangoOp1 == '' AND $rangoOp2 == '' AND $operador1 == '' )) {\n if ($varFiltro !='' ) {\n if ($rangoVF1 != '' AND $rangoVF2 != '' AND $operadorVF == '') {\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($varFiltro, [$rangoVF1,$rangoVF2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '']); \n }elseif ($rangoVF1 != '' AND $rangoVF2 == '' AND $operadorVF != '' ){\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($varFiltro, $operadorVF , $rangoVF1 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '']); \n } \n }else{\n $result = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->select('celda','dia',$variableDB) \n ->get();\n $datatable = Datatables::of($result)->make();\n if($variable2 != ''){\n //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n }\n }\n\n return response()->json(['datos' => $result,\n 'variable'=> $variable,\n 'varKey'=> $variableDB,\n 'banda1' => $banda1,\n 'banda2' => $banda2,\n 'miny' => $min, \n 'maxy' => $max,\n 'ylabel'=> $ylabel,\n 'xlabel'=> $xlabel,\n 'datatable' => $datatable,\n 'celda1' =>$celda1,\n 'celda2' =>$celda2,\n \n 'datosVar2' => $result2,\n 'variableVar2'=> $variable2,\n 'varKeyVar2'=> $variableDB2,\n 'banda1Var2' => $banda1Var2,\n 'banda2Var2' => $banda2Var2,\n 'minyVar2' => $minVar2, \n 'maxyVar2' => $maxVar2,\n 'ylabelVar2'=> $ylabelVar2,\n 'xlabelVar2'=> $xlabelVar2,\n 'datatableVar2' => $datatableVar2,\n \n 'calculo' => '']);\n }\n \n }\n }\n \n /* //segunda variable\n if ($rangoOp1Var2 != '' AND $rangoOp2Var2 != '' AND $operador2 == '' ) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->whereBetween($variableDB2, [$rangoOp1Var2,$rangoOp2Var2]) \n ->select('celda','dia',$variableDB2) \n ->get();\n\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif ($rangoOp1Var2 != '' AND $rangoOp2Var2 == '' AND $operador2 != '' ){\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->where($variableDB2, $operador2 , $rangoOp1Var2 ) \n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n \n }elseif (($rangoOp1Var2 == '' AND $rangoOp2Var2 == '' AND $operador2 == '' )) {\n $result2 = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->select('celda','dia',$variableDB2) \n ->get();\n $datatableVar2 = Datatables::of($result2)->make();\n\n } \n */\n }\n }", "public function getRevenueEnabled()\n {\n return $this->helper->trackRevenue();\n }", "function yearly_chart() {\n $this->load->view(\"expenses/yearly_chart\");\n }", "public function getRecords($range,$data)\n {\n if(($range%6)!=0){\n if($range==1)\n $sales = ToiletUsageInfo::where('status','1')->where('owner_id',Auth::user()->id)->get();\n else\n $sales = ToiletUsageInfo::where('status','1')->where('owner_id',Auth::user()->id)->where('created_at','>=',Carbon::now()->subdays($range))->get();\n }\n else{\n $sales = ToiletUsageInfo::where('status','1')->where('owner_id',Auth::user()->id)->where(\"created_at\",\">=\", Carbon::now()->subMonths($range))->get();\n }\n $total=0;\n foreach($sales as $sale) {\n $total+=$sale->toilet['price'];\n }\n \n $data.='\n <thead>\n <tr class=\"thead-light\">\n <th>Transact Id</th>\n <th>Toilet name</th>\n <th>User email</th>\n <th title=\"Total revenue is KD'.$total.'\" width=10%>\n Paid | <b style=\"color:#28a745;\">KD'.$total.'</b>\n </th>\n <th>Used on</th>\n </tr>\n </thead>\n <tbody>';\n if( count($sales) == 0 )\n $data.='<tr><td colspan=\"5\"><center><h2>No Reports found</h2></center></td></tr>';\n else{\n foreach($sales as $sale) {\n if($sale->toilet['price']==0)\n $sale->toilet['price']='<b style=\"color:#28a745;\">Free</b>';\n else $sale->toilet['price']='KD'.$sale->toilet['price'];\n $data.='<tr>\n <td>'.$sale->transaction_id.'</td>\n <td title=\"id='.$sale->toilet_id.'\">\n '.$sale->toilet['toilet_name'].'\n </td>\n <td title=\"id-'.$sale->user['id'].'\">\n '.$sale->user['email'].'\n </td>\n <td><b>'.$sale->toilet['price'].'</b></td>\n <td>'.$sale->created_at->format('d/m/Y').' at '.$sale->created_at->format('g:i A').'</td>\n </tr>';\n }\n }\n $data.='</tbody>\n </table>';\n\n return $data;\n }", "public function incomeGraphData()\n {\n $incomes = Income::all();\n $channelingIncomes = $incomes->where('incomeable_type', Incomes::CHANNELING_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $pharmacyIncomes = $incomes->where('incomeable_type', Incomes::PHARMACY_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Income Graph Data', [\n 'channelingIncomeGraphData' => $channelingIncomes,\n 'pharmacyIncomeGraphData' => $pharmacyIncomes,\n ]);\n }", "public function getEstimateSpreadPerMonth() {\n\n // Do the columns\n $googleVis = new Googlevis();\n $columns = $googleVis->createColumns(\n array(\n 'Month' => 'string', \n 'Size: 1' => 'number', \n 'Size: 2' => 'number', \n 'Size: 3' => 'number', \n 'Size: 5' => 'number', \n 'Size: 8' => 'number', \n 'Size: 13' => 'number', \n 'Size: 20' => 'number'\n )\n );\n \n $estimate_data = $this->getEstimateDataByMonth(\n $this->easybacklogClient->getStoriesFromTheme()\n );\n\n\n $rows = array();\n foreach($estimate_data AS $year => $month) {\n foreach($month AS $month_no => $estimates) {\n foreach (array(1, 2, 3, 5, 8, 13, 20) AS $est) {\n $row_data[] = (isset($estimates[$est]) ? $estimates[$est] : 0);\n }\n\n $rows[] = $googleVis->createDataRow(\n $year .\"/\". $month_no,\n $row_data\n );\n $row = $row_label = $row_data = array();\n }\n \n }\n\n return array('cols' => $columns, 'rows' => $rows);\n }", "public function calculate(NovaRequest $request)\n {\n /**\n * Get max report_date available\n * Then select the twelve previous months\n */\n $last_report_date = StoreRevenue::max('report_date');\n\n $store_revenues = StoreRevenue::where('store_id', $request->resourceId)\n ->where('report_date', '>', Carbon::createFromFormat('Y-m-d', $last_report_date)->subMonths(12)->endOfMonth()->toDateString())\n ->pluck('amount','report_date')\n ->toArray();\n\n return (new TrendResult)->trend($store_revenues)\n ->showLatestValue()\n ->prefix('€');\n }", "public function get_sales_data(Request $request){\n\n $sales_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->sum('grand_total'));\n });\n $orders_graph=$this->all_orders->groupBy(function($item){\n return ($item->created_at->format('Y:m'));\n })->map(function($item,$key){\n return ($item->count());\n });\n \n $sales_str=\"[\";\n foreach($sales_graph as $key=>$value){\n\n if($sales_graph->last()==$value)\n $sales_str.='{\"Month\" : \"' . $key . '\", \"Sales\":\"'.$value .'\"}';\n else\n $sales_str.='{\"Month\": \"' . $key . '\", \"Sales\":\"'.$value .'\"},';\n }\n $sales_str.=\"]\";\n \n $orders_str=\"[\";\n \n foreach($orders_graph as $key=>$value){\n\n if($orders_graph->last()==$value)\n $orders_str.='{\"Month\" : \"' . $key . '\", \"Orders\":\"'.$value .'\"}';\n else\n $orders_str.='{\"Month\": \"' . $key . '\", \"Orders\":\"'.$value .'\"},';\n }\n $orders_str.=\"]\";\n\n\n echo json_encode([$sales_str,$orders_str]);\n }", "public function get_main_chart() {\n\n\t\tif ( empty( $this->category_ids ) ) {\n\t\t\t?>\n\t\t\t<div class=\"chart-container\">\n\t\t\t\t<p class=\"chart-prompt\"><?php _e( '&larr; Choose a category to view stats', 'woocommerce-cost-of-goods' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t$chart_data = array();\n\t\t$index = 0;\n\n\t\tforeach ( $this->category_ids as $category_id ) {\n\n\t\t\t$category = get_term( $category_id, 'product_cat' );\n\t\t\t$data = $this->get_report_data( $category->term_id );\n\n\t\t\t$chart_data[ $category->term_id ]['category'] = $category->name;\n\t\t\t$chart_data[ $category->term_id ]['data'] = array_values( $this->prepare_chart_data( $data->profits, 'post_date', 'order_item_profit', $this->chart_interval, $this->start_date, $this->chart_groupby ) );\n\n\t\t\t$index ++;\n\t\t}\n\n\t\t?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$index = 0;\n\t\t\t\t\t\t\tforeach ( $chart_data as $data ) {\n\t\t\t\t\t\t\t\t$color = isset( $this->chart_colors[ $index ] ) ? $this->chart_colors[ $index ] : $this->chart_colors[0];\n\t\t\t\t\t\t\t\t$width = $this->barwidth / sizeof( $chart_data );\n\t\t\t\t\t\t\t\t$offset = ( $width * $index );\n\t\t\t\t\t\t\t\t$series = $data['data'];\n\t\t\t\t\t\t\t\tforeach ( $series as $key => $series_data )\n\t\t\t\t\t\t\t\t\t$series[ $key ][0] = $series_data[0] + $offset;\n\t\t\t\t\t\t\t\techo '{\n\t\t\t\t\t\t\t\t\tlabel: \"' . esc_js( $data['category'] ) . '\",\n\t\t\t\t\t\t\t\t\tdata : jQuery.parseJSON( \"' . json_encode( $series ) . '\" ),\n\t\t\t\t\t\t\t\t\tcolor: \"' . $color . '\",\n\t\t\t\t\t\t\t\t\tbars : {\n\t\t\t\t\t\t\t\t\t\tfillColor: \"' . $color . '\",\n\t\t\t\t\t\t\t\t\t\tfill : true,\n\t\t\t\t\t\t\t\t\t\tshow : true,\n\t\t\t\t\t\t\t\t\t\tlineWidth: 1,\n\t\t\t\t\t\t\t\t\t\talign : \"center\",\n\t\t\t\t\t\t\t\t\t\tbarWidth : ' . $width * 0.75 . ',\n\t\t\t\t\t\t\t\t\t\tstack : false\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t' . $this->get_currency_tooltip() . ',\n\t\t\t\t\t\t\t\t\tenable_tooltip: true,\n\t\t\t\t\t\t\t\t\tprepend_label : true\n\t\t\t\t\t\t\t\t},';\n\t\t\t\t\t\t\t\t$index++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars ) {\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery( '.chart-placeholder.main' ),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgrid: {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tborderColor: 'transparent',\n\t\t\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\t\t\thoverable : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\txaxes: [ {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\treserveSpace: true,\n\t\t\t\t\t\t\t\tposition : 'bottom',\n\t\t\t\t\t\t\t\ttickColor : 'transparent',\n\t\t\t\t\t\t\t\tmode : 'time',\n\t\t\t\t\t\t\t\ttimeformat : \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames : <?php echo json_encode( array_values( $GLOBALS['wp_locale']->month_abbrev ) ); ?>,\n\t\t\t\t\t\t\t\ttickLength : 1,\n\t\t\t\t\t\t\t\tminTickSize : [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\ttickSize : [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tcolor: '#aaa'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t\tyaxes: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\ttickDecimals: 2,\n\t\t\t\t\t\t\t\t\tcolor : 'transparent',\n\t\t\t\t\t\t\t\t\tfont : { color: \"#aaa\" }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\n\t\t\t\t};\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery( this ).data( 'series' ) );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}", "public function prevalenceRates()\n\t{\n\t\t$from = Input::get('start');\n\t\t$to = Input::get('end');\n\t\t$today = date('Y-m-d');\n\t\t$year = date('Y');\n\t\t$testTypeID = Input::get('test_type');\n\n\t\t//\tApply filters if any\n\t\tif(Input::has('filter')){\n\n\t\t\tif(!$to) $to=$today;\n\n\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($today)||strtotime($to)>strtotime($today)){\n\t\t\t\tSession::flash('message', trans('messages.check-date-range'));\n\t\t\t}\n\n\t\t\t$months = json_decode(self::getMonths($from, $to));\n\t\t\t$data = TestType::getPrevalenceCounts($from, $to, $testTypeID);\n\t\t\t$chart = self::getPrevalenceRatesChart($testTypeID);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get all tests for the current year\n\t\t\t$test = Test::where('time_created', 'LIKE', date('Y').'%');\n\t\t\t$periodStart = $test->min('time_created'); //Get the minimum date\n\t\t\t$periodEnd = $test->max('time_created'); //Get the maximum date\n\t\t\t$data = TestType::getPrevalenceCounts($periodStart, $periodEnd);\n\t\t\t$chart = self::getPrevalenceRatesChart();\n\t\t}\n\n\t\treturn View::make('reports.prevalence.index')\n\t\t\t\t\t\t->with('data', $data)\n\t\t\t\t\t\t->with('chart', $chart)\n\t\t\t\t\t\t->withInput(Input::all());\n\t}", "public function index()\n\t{\n\t\t\n\t$today_users = Trains_reservation::whereDate('created_at', today())->count()+Planes_reservation::whereDate('created_at', today())->count();\n\t$yesterday_users = Trains_reservation::whereDate('created_at', today()->subDays(1))->count()+Planes_reservation::whereDate('created_at', today()->subDays(1))->count();\n\t$users_2_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(2))->count()+Planes_reservation::whereDate('created_at', today()->subDays(2))->count();\n\t$users_3_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(3))->count()+Planes_reservation::whereDate('created_at', today()->subDays(3))->count();\n\t$users_4_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(4))->count()+Planes_reservation::whereDate('created_at', today()->subDays(4))->count();\n\t$users_5_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(5))->count()+Planes_reservation::whereDate('created_at', today()->subDays(5))->count();\n\t$users_6_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(6))->count()+Planes_reservation::whereDate('created_at', today()->subDays(6))->count();\n\t$users_7_days_ago = Trains_reservation::whereDate('created_at', today()->subDays(7))->count()+Planes_reservation::whereDate('created_at', today()->subDays(7))->count();\n\t$chart = new SampleChart;\n\t$chart->labels(['Tujuh hari lalu','Enam hari lalu','Lima hari lalu','Empat hari lalu','Tiga hari lalu','Dua hari lalu', 'Kemarin', 'Hari Ini']);\n\t$chart->dataset('Laporan Transaksi', 'line', [$users_7_days_ago,$users_6_days_ago,$users_5_days_ago,$users_4_days_ago,$users_3_days_ago,$users_2_days_ago, $yesterday_users, $today_users]);\n\t\treturn view('laporan.hari',compact('chart'));\n\t}", "public function doctorIncomeGraphData()\n {\n $schedules = Auth::user()->doctor->schedules;\n $channelingIncomeGraphData = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum(function ($appointment) {\n return $appointment->schedule->doctor_fee;\n })\n ];\n })->values()->all();\n $receivedPaymentsGraphData = Expense::whereIn('expensable_id', $schedules->pluck('id'))\n ->get()\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'channelingIncomeGraphData' => $channelingIncomeGraphData,\n 'receivedPaymentsGraphData' => $receivedPaymentsGraphData,\n ]);\n }", "public function response()\n {\n $count_households=new SampleChart;\n //Load village data\n $villages = Village::all()->sortBy(\"village_name\");\n $village_stats=Villagestat::all();\n foreach ($villages as $village) {\n $households[]=$village->households;\n $land[]=$village->land;\n foreach($village_stats as $vstat){\n if($village->id==$vstat->id){\n $rom_households[]=$vstat->rom_households_count;\n }\n }\n }\n $count_households->dataset('Households(total)', 'bar', $households)->color('#00ff00');\n $count_households->dataset('Romani households', 'bar', $rom_households)->color('#ff0000');\n return $count_households->api();\n\n }", "public function EvolutionDataChartPost(Request $request)\n {\n if ($request->isMethod('post')) {\n list( $fecha1, $fecha2) = explode(' - ', $request->input('rangoFechaPredet'));\n\n // $fecha1= \"2018/03/01\";\n // $fecha2 =\"2018/03/30\";\n $celda1=901;\n $celda2= 1090;\n \n\n $voltaje = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(voltaje),4), \",\",\"\") as voltaje'))\n ->get();\n\n $banda1Voltaje = 4.55;\n $banda2Voltaje = 4.65;\n $minVoltaje = 4.4;\n $maxVoltaje = 5.1;\n\n $corriente = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(corrienteL),4), \",\",\"\") as corriente'))\n ->get();\n\n $banda1Corriente = 219;\n $banda2Corriente = null;\n $minCorriente = 180;\n $maxCorriente = 240;\n\n $efCorriente = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(corrienteL),4), \",\",\"\") as efCorriente'))\n ->get();\n\n $banda1EfCorriente = 90;\n $banda2EfCorriente = 94;\n $minEfCorriente = 50;\n $maxEfCorriente = 110;\n\n $desvResistencia = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(dsr),4), \",\",\"\") as desvResistencia'))\n ->get();\n\n $banda1DesvResistencia = 0.06;\n $banda2DesvResistencia = null;\n $minDesvResistencia = -0.2;\n $maxDesvResistencia = 0.2;\n\n $frecuenciaEA = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM(numeroEA)/count(*),4), \",\",\"\") as frecuenciaEA'))\n ->get();\n\n $banda1FrecuenciaEA = 0.15;\n $banda2FrecuenciaEA = null;\n $minFrecuenciaEA = 0;\n $maxFrecuenciaEA = 1.2;\n\n $potencia = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(potencia),4), \",\",\"\") as potencia'))\n ->get();\n\n $banda1Potencia = 980;\n $banda2Potencia = 1000;\n $minPotencia = 920;\n $maxPotencia = 1120;\n\n $nivelDeMetal = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(nivelDeMetal),4), \",\",\"\") as nivelDeMetal'))\n ->get();\n\n $banda1NivelDeMetal = 20;\n $banda2NivelDeMetal = 22;\n $minNivelDeMetal = 18;\n $maxNivelDeMetal = 27;\n\n $nivelDeBanio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(nivelDeBanio),4), \",\",\"\") as nivelDeBanio'))\n ->get();\n\n $banda1NivelDeBano = 20;\n $banda2NivelDeBano = 23;\n $minNivelDeBano = 15;\n $maxNivelDeBano = 27;\n\n $frecuenciaTK = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(SUM(numeroTK)/count(*),4), \",\",\"\") as frecuenciaTK'))\n ->get();\n\n $banda1FrecuenciaTK = 0.15;\n $banda2FrecuenciaTK = null;\n $minFrecuenciaTK = 0;\n $maxFrecuenciaTK = 2.5;\n\n $duracionTK = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(duracionTk),4), \",\",\"\") as duracionTk'))\n ->get();\n\n $banda1DuracionTK = 0.7;\n $banda2DuracionTK = 0.8;\n $minDuracionTK = 0.5;\n $maxDuracionTK = 1.9;\n\n $golpesAlumina = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(golpesAlumina),4), \",\",\"\") as golpesAlumina'))\n ->get();\n\n $banda1GolpesAlumina = 2.4;\n $banda2GolpesAlumina = null;\n $minGolpesAlumina = 1.7;\n $maxGolpesAlumina = 3.2;\n \n $alimentacionAlumina = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(golpesAlumina),4), \",\",\"\") as alimentacionAlumina'))\n ->get();\n \n $banda1AlimentacionAlumina = 1200;\n $banda2AlimentacionAlumina = 1300;\n $minAlimentacionAlumina = 800;\n $maxAlimentacionAlumina = 1350;\n\n $temperatura = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(temperatura),4), \",\",\"\") as temperatura'))\n ->get();\n\n $banda1Temperatura = 960;\n $banda2Temperatura = 965;\n $minTemperatura = 950;\n $maxTemperatura = 990;\n\n $acidez = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(acidez),4), \",\",\"\") as acidez'))\n ->get();\n\n $banda1Acidez = 10.5;\n $banda2Acidez = 11;\n $minAcidez = 8;\n $maxAcidez = 13.5;\n\n $desvTemperatura = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV(temperatura),4), \",\",\"\") as desvTemperatura'))\n ->get();\n \n $banda1DesvTemperatura = 10;\n $banda2DesvTemperatura = null;\n $minDesvTemperatura = 0;\n $maxDesvTemperatura = 25;\n\n $desvAcidez = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(STDDEV(acidez),4), \",\",\"\") as desvAcidez'))\n ->get();\n\n $banda1DesvAcidez = 1.0;\n $banda2DesvAcidez = null;\n $minDesvAcidez = 0;\n $maxDesvAcidez = 4;\n\n $consumoFl = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(temperatura),4), \",\",\"\") as consumoFl'))\n ->get();\n\n $banda1ConsumoFl = 50;\n $banda2ConsumoFl = 70;\n $minConsumoFl = 0;\n $maxConsumoFl = 170;\n\n\n $porcHierro = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(fe),4), \",\",\"\") as porcHierro'))\n ->get();\n\n $banda1PorcHierro = 0.2;\n $banda2PorcHierro = null;\n $minPorcHierro = 0;\n $maxPorcHierro = 1.1;\n\n $purezaSilicio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(si),4), \",\",\"\") as purezaSilicio'))\n ->get();\n\n $banda1PurezaSilicio = 1;\n $banda2PurezaSilicio = 1;\n $minPurezaSilicio = 0;\n $maxPurezaSilicio = 0.45;\n\n $porcSilicio = DB::connection('reduccionl5')->table('diariocelda')\n ->whereBetween('celda', [$celda1,$celda2])\n ->whereBetween('dia', [$fecha1,$fecha2])\n ->groupBy('dia')\n ->having('dia', '>=', $fecha1)\n ->select('dia', DB::raw('REPLACE(FORMAT(AVG(si),4), \",\",\"\") as porcSilicio'))\n ->get();\n\n $banda1PorcSilicio = 0.08;\n $banda2PorcSilicio = null;\n $minPorcSilicio = 0;\n $maxPorcSilicio = 0.45;\n\n return response()->json(\n [ 'fecha1' => $fecha1,\n 'fecha2' => $fecha2,\n\n 'datosVoltaje' => $voltaje,\n 'banda1Voltaje' => $banda1Voltaje,\n 'banda2Voltaje' => $banda2Voltaje,\n 'minVoltaje' => $minVoltaje,\n 'maxVoltaje' => $maxVoltaje,\n\n 'datosCorriente' => $corriente,\n 'banda1Corriente' => $banda1Corriente,\n 'banda2Corriente' => $banda2Corriente,\n 'minCorriente' => $minCorriente,\n 'maxCorriente' => $maxCorriente,\n\n 'datosEfCorriente' => $efCorriente,\n 'banda1EfCorriente' => $banda1EfCorriente,\n 'banda2EfCorriente' => $banda2EfCorriente,\n 'minEfCorriente' => $minEfCorriente,\n 'maxEfCorriente' => $maxEfCorriente,\n\n 'datosDesvResistencia' => $desvResistencia,\n 'banda1DesvResistencia' => $banda1DesvResistencia ,\n 'banda2DesvResistencia' => $banda2DesvResistencia,\n 'minDesvResistencia' => $minDesvResistencia,\n 'maxDesvResistencia' => $maxDesvResistencia,\n \n 'datosFrecuenciaEA' => $frecuenciaEA,\n 'banda1FrecuenciaEA' => $banda1FrecuenciaEA ,\n 'banda2FrecuenciaEA' => $banda2FrecuenciaEA,\n 'minFrecuenciaEA' => $minFrecuenciaEA,\n 'maxFrecuenciaEA' => $maxFrecuenciaEA,\n \n 'datosPotencia' => $potencia,\n 'banda1Potencia' => $banda1Potencia,\n 'banda2Potencia' => $banda2Potencia , \n 'minPotencia' => $minPotencia,\n 'maxPotencia' => $maxPotencia,\n \n 'datosNivelDeMetal' => $nivelDeMetal,\n 'banda1NivelDeMetal' => $banda1NivelDeMetal, \n 'banda2NivelDeMetal' => $banda2NivelDeMetal,\n 'minNivelDeMetal' => $minNivelDeMetal,\n 'maxNivelDeMetal' => $maxNivelDeMetal,\n \n 'datosNivelDeBanio' => $nivelDeBanio,\n 'banda1NivelDeBano' => $banda1NivelDeBano,\n 'banda2NivelDeBano' => $banda2NivelDeBano,\n 'minNivelDeBano' => $minNivelDeBano,\n 'maxNivelDeBano' => $maxNivelDeBano,\n \n 'datosFrecuenciaTK' => $frecuenciaTK,\n 'banda1FrecuenciaTK' => $banda1FrecuenciaTK,\n 'banda2FrecuenciaTK' => $banda2FrecuenciaTK,\n 'minFrecuenciaTK' => $minFrecuenciaTK,\n 'maxFrecuenciaTK' => $maxFrecuenciaTK,\n \n 'datosDuracionTK' => $duracionTK,\n 'banda1DuracionTK' => $banda1DuracionTK,\n 'banda2DuracionTK' => $banda2DuracionTK, \n 'minDuracionTK' => $minDuracionTK,\n 'maxDuracionTK' => $maxDuracionTK,\n \n 'datosGolpesAlumina' => $golpesAlumina,\n 'banda1GolpesAlumina' => $banda1GolpesAlumina,\n 'banda2GolpesAlumina' => $banda2GolpesAlumina,\n 'minGolpesAlumina' => $minGolpesAlumina,\n 'maxGolpesAlumina' => $maxGolpesAlumina,\n \n 'datosAlimentacionAlumina' => $alimentacionAlumina,\n 'banda1AlimentacionAlumina' => $banda1AlimentacionAlumina,\n 'banda2AlimentacionAlumina' => $banda2AlimentacionAlumina,\n 'minAlimentacionAlumina' => $minAlimentacionAlumina,\n 'maxAlimentacionAlumina' => $maxAlimentacionAlumina,\n\n 'datosTemperatura' => $temperatura,\n 'banda1Temperatura' => $banda1Temperatura,\n 'banda2Temperatura' => $banda2Temperatura,\n 'minTemperatura' => $minTemperatura,\n 'maxTemperatura' => $maxTemperatura,\n \n 'datosAcidez' => $acidez,\n 'banda1Acidez' => $banda1Acidez,\n 'banda2Acidez' => $banda2Acidez,\n 'minAcidez' => $minAcidez,\n 'maxAcidez' => $maxAcidez,\n \n 'datosDesvTemperatura' => $desvTemperatura,\n 'banda1DesvTemperatura' => $banda1DesvTemperatura,\n 'banda2DesvTemperatura' => $banda2DesvTemperatura,\n 'minDesvTemperatura' => $minDesvTemperatura,\n 'maxDesvTemperatura' => $maxDesvTemperatura,\n \n 'datosDesvAcidez' => $desvAcidez,\n 'banda1DesvAcidez' => $banda1DesvAcidez,\n 'banda2DesvAcidez' => $banda2DesvAcidez,\n 'minDesvAcidez' => $minDesvAcidez,\n 'maxDesvAcidez' => $maxDesvAcidez,\n \n 'datosConsumoFl' => $consumoFl,\n 'banda1ConsumoFl' => $banda1ConsumoFl,\n 'banda2ConsumoFl' => $banda2ConsumoFl,\n 'minConsumoFl' => $minConsumoFl,\n 'maxConsumoFl' => $maxConsumoFl,\n \n 'datosPorcHierro' => $porcHierro,\n 'banda1PorcHierro' => $banda1PorcHierro,\n 'banda2PorcHierro' => $banda2PorcHierro, \n 'minPorcHierro' => $minPorcHierro,\n 'maxPorcHierro' => $maxPorcHierro,\n \n 'datosPurezaSilicio' => $purezaSilicio,\n 'banda1PurezaSilicio' => $banda1PurezaSilicio,\n 'banda2PurezaSilicio' => $banda2PurezaSilicio,\n 'minPurezaSilicio' => $minPurezaSilicio,\n 'maxPurezaSilicio' => $maxPurezaSilicio,\n \n 'datosPorcSilicio' => $porcSilicio,\n 'banda1PorcSilicio' => $banda1PorcSilicio,\n 'banda2PorcSilicio' => $banda2PorcSilicio,\n 'minPorcSilicio' => $minPorcSilicio,\n 'maxPorcSilicio' => $maxPorcSilicio,\n \n ]);\n\n }\n \n }", "public function stats_rom()\n {\n\n //$roms=array('Țigan','Țigan Ungurean', 'Căldărar','Ciurar','Fierar','Inar','Lăieș/Lăieț','Netot','Rudar','Ursar','Vătraş','Zavragiu','Zlătar');\n $roms = $this->roms;\n $data=[];\n //Update stats\n $villages = DB::table('households')\n ->join('villages','households.village_id','=','villages.id')\n ->join('stats','households.id','=','stats.household_id')\n ->select(DB::raw('sum(stats.household_count) as sum, villages.id'))\n ->whereIn('households.nationality',$roms)\n ->groupBy('villages.id')\n ->get();\n\n $village_rom=new SampleChart;\n $api=url('/stats_data_rom');\n //$villages = Village::all()->sortBy(\"village_name\");\n $villages = DB::table('households')\n ->join('villages','households.village_id','=','villages.id')\n ->join('stats','households.id','=','stats.household_id')\n ->select(DB::raw('sum(stats.household_count) as sum, villages.village_name'))\n ->whereIn('households.nationality',$roms)\n ->groupBy('villages.village_name')\n ->get();\n\n //return $villages;\n foreach ($villages as $village) {\n $label[]=$village->village_name;\n }\n $village_rom->labels($label)->load($api);\n\n //General data\n $data['household_records']=Household::count();\n $data['roms']=DB::table('households')\n ->whereIn('households.nationality',$roms)\n ->count();\n //$data['romstotal']=DB::table('village_stats')->sum('village_stats.roms_count');\n $data['romstotal']=DB::table('nations')->sum('total');\n $data['village_records']=Village::count();\n //\n return view('charts/third_open',['village_rom'=>$village_rom], $data);\n\n }", "public function index(Request $request)\n {\n $last_year_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(365))->get();\n $last_month_invoices = Invoice::whereDate('created_at', '>', Carbon::now()->subDays(30))->get();\n $last_month_paid = 0;\n $last_month_unpaid = 0;\n $last_month_total = 0;\n $recurring_invoice = 0;\n $last_year_total = 0;\n $paid_invoice_per_day= []; // for graph\n\n foreach ($last_month_invoices as $last_month_invoice) {\n if ($last_month_invoice->is_paid == 1) {\n\n $last_month_paid = $last_month_paid + $last_month_invoice->total_amount;\n\n // paid invoice graph\n if (array_key_exists($last_month_invoice->created_at->format('M d'), $paid_invoice_per_day)) {\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] + $last_month_invoice->total_amount;\n }else{\n $paid_invoice_per_day[$last_month_invoice->created_at->format('M d')] = $last_month_invoice->total_amount;\n }\n\n }else{\n $last_month_unpaid = $last_month_unpaid + $last_month_invoice->total_amount;\n }\n\n // recurring total\n if ($last_month_invoice->is_autometic == 1) {\n $recurring_invoice = $recurring_invoice + $last_month_invoice->total_amount;\n }\n\n }\n $last_month_total = $last_month_paid + $last_month_unpaid;\n\n\n\n foreach ($last_year_invoices as $last_year_invoice) {\n $last_year_total = $last_year_total + $last_year_invoice->total_amount; \n }\n\n // customer list\n $keyword = $request->get('search');\n $perPage = 25;\n if (!empty($keyword)) {\n $customers = Customer::where('name', 'LIKE', \"%$keyword%\")\n ->orWhere('email', 'LIKE', \"%$keyword%\")\n ->orWhere('business_name', 'LIKE', \"%$keyword%\")\n ->orWhere('address', 'LIKE', \"%$keyword%\")\n ->orWhere('city', 'LIKE', \"%$keyword%\")\n ->orWhere('state', 'LIKE', \"%$keyword%\")\n ->orWhere('zip', 'LIKE', \"%$keyword%\")\n ->latest()->paginate($perPage);\n } else {\n $customers = Customer::latest()->paginate($perPage);\n }\n return view('home', compact('last_month_paid','last_month_unpaid','last_month_total','last_year_total', 'customers', 'paid_invoice_per_day', 'recurring_invoice'));\n }", "public function monthly_sales_report()\n\t{\n\t\t$query1 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tdate,\n\t\t\t\tEXTRACT(MONTH FROM date) as month, \n\t\t\t\tCOUNT(invoice_id) as total\n\t\t\tFROM \n\t\t\t\tinvoice\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\t$query2 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tpurchase_date,\n\t\t\t\tEXTRACT(MONTH FROM purchase_date) as month, \n\t\t\t\tCOUNT(purchase_id) as total_month\n\t\t\tFROM \n\t\t\t\tproduct_purchase\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM purchase_date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM purchase_date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\treturn [$query1,$query2];\n\t}", "public function get_most_revenue_generating_posts( $args = array(), $start_timestamp = null, $interval = 'week' ) {\n $default_args = array(\n 'group_by' => 'post_id',\n 'order_by' => 'amount',\n 'order' => 'DESC',\n 'fields' => array(\n 'post_id',\n 'post_title',\n 'SUM(price) AS amount',\n ),\n 'limit' => 10,\n 'join' => $this->post_join,\n );\n\n $args = wp_parse_args( $args, $default_args );\n\n $results = $this->get_results( $args );\n\n if ( $start_timestamp === null ) {\n return $results;\n }\n\n foreach ( $results as $key => $data ) {\n // the sparkline for the last x days\n $sparkline = $this->get_sparkline( $data->post_id, $start_timestamp, $interval );\n $data->sparkline = implode( ',', $sparkline );\n $data->amount = round( $data->amount, 2 );\n $results[ $key ] = $data;\n }\n\n return $results;\n }", "private function grab_data(){\n\t\t$y=0;\n\t\tfor($i=$this->startingmonth;$i>=0;$i--){\n\t\t\t$this->searchmonth = date(\"n\")-$i;\n\t\t\t$this->searchyear = date(\"Y\");\n\t\t\tif(0 >= $this->searchmonth){\n\t\t\t\twhile(0 >= $this->searchmonth){\n\t\t\t\t\t$this->searchmonth += 12;\n\t\t\t\t\t$this->searchyear--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->count_chrono_records();\n\t\t\t$this->monthlyrecordvolume[$i] = intval($this->volume_of_records_in_timerange);\n\t\t\tif(0==$this->max_month_value or $this->monthlyrecordvolume[$i] > $this->max_month_value){\n\t\t\t\t$this->max_month_value = $this->monthlyrecordvolume[$i];\n\t\t\t}\n\t\t\t$this->monthaggregator += $this->monthlyrecordvolume[$i];\n\t\t\t\n\t\t\t$this->count_months_recorded_this_year++;\n\t\t\tif(12 == $this->searchmonth or 0 == $i ){\n\t\t\t\t$this->ave_this_year[$y]['volume'] = intval($this->monthaggregator / $this->count_months_recorded_this_year);\n\t\t\t\t$this->ave_this_year[$y]['month'] = $i;\n\t\t\t\t$this->ave_this_year[$y]['year'] = $this->searchyear;\n\t\t\t\t$this->monthaggregator = 0;\n\t\t\t\t$this->count_months_recorded_this_year = 0;\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function index()\n {\n return view('reports.revenue.date_wise_denomination.index');\n }", "function jr_dashboard_charts() {\n\tglobal $wpdb;\n\n\t$sql = \"SELECT COUNT(post_title) as total, post_date \n\t\t\tFROM $wpdb->posts\n\t\t\tWHERE post_type = '%s' AND post_date > '%s' \n\t\t\tGROUP BY DATE(post_date) \n\t\t\tDESC\";\n\t$results = $wpdb->get_results( $wpdb->prepare( $sql, APP_POST_TYPE, date( 'Y-m-d', strtotime('-30 days') ) ) );\n\n\t$listings = array();\n\n\t// put the days and total posts into an array\n\tforeach ( $results as $result ) {\n\t\t$the_day = date('Y-m-d', strtotime($result->post_date));\n\t\t$listings[$the_day] = $result->total;\n\t}\n\n\t// setup the last 30 days\n\tfor( $i = 0; $i < 30; $i++ ) {\n\t\t$each_day = date('Y-m-d', strtotime('-'. $i .' days'));\n\n\t\t// if there's no day with posts, insert a goose egg\n\t\tif ( !in_array($each_day, array_keys($listings)) ) $listings[$each_day] = 0;\n\t}\n\n\t// sort the values by date\n\tksort($listings);\n\n\t$args = array(\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => '_valid_resume_subscription_start',\n\t\t\t\t'value' => date( 'Y-m-d', strtotime('-30 days') ),\n\t\t\t\t'compare' => '>'\n\t\t\t),\n\t\t),\n\t);\n\t$subscribers = new WP_User_Query( $args );\n\n\t$sql = \"SELECT COUNT(user_id) as total, meta_value as subscr_date \n\t\t\tFROM $wpdb->usermeta \n\t\t\tWHERE meta_key = '_valid_resume_subscription_start' AND meta_value > %d\n\t\t\tGROUP BY DATE(subscr_date) \n\t\t\tDESC\";\n\t$results = $wpdb->get_results( $wpdb->prepare( $sql, strtotime('-30 days') ) );\n\n\t$subscriptions = array();\n\n\t// put the days and total posts into an array\n\tforeach ( $results as $result ) {\n\t\t$the_day = date( 'Y-m-d', $result->subscr_date );\n\t\t$subscriptions[$the_day] = $result->total;\n\t}\n\n\t// setup the last 30 days\n\tfor( $i = 0; $i < 30; $i++ ) {\n\t\t$each_day = date('Y-m-d', strtotime('-'. $i .' days'));\n\n\t\t// if there's no day with posts, insert a goose egg\n\t\tif ( !in_array($each_day, array_keys($subscriptions)) ) $subscriptions[$each_day] = 0;\n\t}\n\n\t// sort the values by date\n\tksort($subscriptions);\n\n\t// Get sales - completed orders with a cost\n\t$sales = array();\n\n\t$sales = jr_daily_orders_sales( array( 'jr_sales_time_span' => date('Y-m-d', strtotime('-30 days')) ) );\n\n\t// legacy order table sales\n\n\tif ( $wpdb->get_results(\"SHOW TABLES LIKE '$wpdb->jr_orders' \") ) {\n\t\t$sql = \"SELECT SUM(cost) as total, order_date \n\t\t\t\tFROM $wpdb->jr_orders WHERE status = 'completed' AND order_date > '%s' \n\t\t\t\tGROUP BY DATE(order_date) \n\t\t\t\tDESC\";\n\t\t$results = $wpdb->get_results( $wpdb->prepare( $sql, date( 'Y-m-d', strtotime('-30 days') ) ) );\n\n\t\t// put the days and total posts into an array\n\t\tforeach ($results as $result) {\n\t\t\t$the_day = date( 'Y-m-d', strtotime($result->order_date) );\n\t\t\tif ( empty($sales[$the_day]) ) $sales[$the_day] = 0;\n\t\t\t$sales[$the_day] += $result->total;\n\t\t}\n\t}\n\n\t// setup the last 30 days\n\tfor( $i = 0; $i < 30; $i++ ) {\n\t\t$each_day = date( 'Y-m-d', strtotime('-'. $i .' days') );\n\n\t\t// if there's no day with posts, insert a goose egg\n\t\tif ( !in_array($each_day, array_keys($sales)) ) $sales[$each_day] = 0;\n\t}\n\n\t// sort the values by date\n\tksort($sales);\n?>\n\n<div id=\"placeholder\"></div>\n\n<script language=\"javascript\" type=\"text/javascript\">\n// <![CDATA[\njQuery(function () {\n\n\tvar posts = [\n\t\t<?php\n\t\tforeach ($listings as $day => $value) {\n\t\t\t$sdate = strtotime($day);\n\t\t\t$sdate = $sdate * 1000; // js timestamps measure milliseconds vs seconds\n\t\t\t$newoutput = \"[$sdate, $value],\\n\";\n\t\t\t//$theoutput[] = $newoutput;\n\t\t\techo $newoutput;\n\t\t}\n\t\t?>\n\t]\n\n\tvar subscriptions = [\n\t\t<?php\n\t\tforeach ($subscriptions as $day => $value) {\n\t\t\t$sdate = strtotime($day);\n\t\t\t$sdate = $sdate * 1000; // js timestamps measure milliseconds vs seconds\n\t\t\t$newoutput = \"[$sdate, $value],\\n\";\n\t\t\t//$theoutput[] = $newoutput;\n\t\t\techo $newoutput;\n\t\t}\n\t\t?>\n\t]\n\n\tvar sales = [\n\t\t<?php\n\t\tforeach ($sales as $day => $value) {\n\t\t\t$sdate = strtotime($day);\n\t\t\t$sdate = $sdate * 1000; // js timestamps measure milliseconds vs seconds\n\t\t\t$newoutput = \"[$sdate, $value],\\n\";\n\t\t\t//$theoutput[] = $newoutput;\n\t\t\techo $newoutput;\n\t\t}\n\t\t?>\n\t];\n\n\n\tvar placeholder = jQuery(\"#placeholder\");\n\n\tvar output = [\n\t\t{\n\t\t\tdata: posts,\n\t\t\tlabel: \"<?php _e('Job Listings', APP_TD) ?>\",\n\t\t\tsymbol: ''\n\t\t},\n\t\t{\n\t\t\tdata: subscriptions,\n\t\t\tlabel: \"<?php _e('Resumes Subscriptions', APP_TD) ?>\",\n\t\t\tsymbol: ''\n\t\t},\n\t\t{\n\t\t\tdata: sales,\n\t\t\tlabel: \"<?php _e('Total Sales', APP_TD) ?>\",\n\t\t\tsymbol: '<?php echo APP_Currencies::get_current_symbol(); ?>',\n\t\t\tyaxis: 2\n\t\t}\n\t];\n\n\tvar options = {\n series: {\n\t\t lines: { show: true },\n\t\t points: { show: true }\n\t },\n\t grid: {\n\t\t tickColor:'#f4f4f4',\n\t\t hoverable: true,\n\t\t clickable: true,\n\t\t borderColor: '#f4f4f4',\n\t\t backgroundColor:'#FFFFFF'\n\t },\n xaxis: { mode: 'time',\n\t\t\t\ttimeformat: \"%m/%d\"\n\t },\n\t yaxis: { min: 0 },\n\t y2axis: { min: 0, tickFormatter: function (v, axis) { return v.toFixed(axis.tickDecimals) + \" <?php echo APP_Currencies::get_current_symbol(); ?>\" }},\n\t legend: { position: 'nw' }\n };\n\n\tjQuery.plot(placeholder, output, options);\n\n\t// reload the plot when browser window gets resized\n\tjQuery(window).resize(function() {\n\t\tjQuery.plot(placeholder, output, options);\n\t});\n\n\tfunction showChartTooltip(x, y, contents) {\n\t\tjQuery('<div id=\"charttooltip\">' + contents + '</div>').css( {\n\t\tposition: 'absolute',\n\t\tdisplay: 'none',\n\t\ttop: y + 5,\n\t\tleft: x + 5,\n\t\topacity: 1\n\t\t}).appendTo(\"body\").fadeIn(200);\n\t}\n\n\tvar previousPoint = null;\n\tjQuery(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n\t\tjQuery(\"#x\").text(pos.x.toFixed(2));\n\t\tjQuery(\"#y\").text(pos.y.toFixed(2));\n\t\tif (item) {\n\t\t\tif (previousPoint != item.datapoint) {\n previousPoint = item.datapoint;\n\n\t\t\t\tjQuery(\"#charttooltip\").remove();\n\t\t\t\tvar x = new Date(item.datapoint[0]), y = item.datapoint[1];\n\t\t\t\tvar xday = x.getDate(), xmonth = x.getMonth()+1; // jan = 0 so we need to offset month\n\t\t\t\tshowChartTooltip(item.pageX, item.pageY, xmonth + \"/\" + xday + \" - <b>\" + item.series.symbol + y + \"</b> \" + item.series.label);\n\t\t\t}\n\t\t} else {\n\t\t\tjQuery(\"#charttooltip\").remove();\n\t\t\tpreviousPoint = null;\n\t\t}\n\t});\n});\n// ]]>\n</script>\n\n<?php\n}", "public function get_least_revenue_generating_posts( $args = array(), $start_timestamp = null, $interval = 'week' ) {\n $default_args = array(\n 'group_by' => 'post_id',\n 'order_by' => 'amount',\n 'order' => 'ASC',\n 'fields' => array(\n 'post_id',\n 'post_title',\n 'SUM(price) AS amount',\n ),\n 'limit' => 10,\n 'join' => $this->post_join,\n );\n $args = wp_parse_args( $args, $default_args );\n\n $results = $this->get_results( $args );\n\n if ( $start_timestamp === null ) {\n return $results;\n }\n\n foreach ( $results as $key => $data ) {\n // the sparkline for the last x days\n $sparkline = $this->get_sparkline( $data->post_id, $start_timestamp, $interval );\n $data->sparkline = implode( ',', $sparkline );\n $data->amount = round( $data->amount, 2 );\n $results[ $key ] = $data;\n }\n\n return $results;\n }", "public function getSalesProperty()\n {\n $min = $this->periodDates['min'];\n $max = $this->periodDates['max'];\n $format = 'Y-m-d H:i:s';\n $result = [];\n $data = [];\n\n if ($this->periodCategory === 'all') {\n $data = DB::connection('carmu')\n ->table('sale')\n ->where('sale_date', '>=', $min->format($format))\n ->where('sale_date', '<=', $max->format($format))\n ->orderBy('sale_id')\n ->orderBy('sale_date')\n ->get();\n } else {\n $data = DB::connection('carmu')\n ->table('sale as t1')\n ->join('sale_has_category as t2', 't1.sale_id', '=', 't2.sale_id')\n ->where('t2.category_id', $this->periodCategory)\n ->where('sale_date', '>=', $min->format($format))\n ->where('sale_date', '<=', $max->format($format))\n ->select('t1.*')\n ->get();\n }\n\n foreach ($data as $sale) {\n $result[] = [\n 'id' => $sale->sale_id,\n 'date' => Carbon::createFromFormat('Y-m-d H:i:s', $sale->sale_date)->format('d-m-Y'),\n 'description' => $sale->description,\n 'amount' => floatval($sale->amount)\n ];\n }\n\n return $result;\n }", "public function getReporteVentasDiario($data)\n\t{\n\t\t$spreadsheet = new Spreadsheet();\n\t\t$sheet = $spreadsheet->getActiveSheet();\n\t\t$sql = (\"SELECT \n\t\t\t\t\tfacturascli.codpago,\n\t\t\t\t\tclientes.nombre,\n\t\t\t\t\tclientes.razonsocial,\n\t\t\t\t\tclientes.codagente AS codigo_vendedor,\n\t\t\t\t\tagentes.nombre AS nombre_vendedor,\n\t\t\t\t\tfacturascli.fecha AS fecha_facturacion,\n\t\t\t\t\tfacturascli.vencimiento AS fecha_vencimiento,\n\t\t\t\t\tfacturascli.codigo,\n\t\t\t\t\tfacturascli.observaciones,\n\t\t\t\t\tfacturascli.total\n\t\t\t\tFROM\n\t\t\t\t\t`facturascli`\n\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\tclientes ON clientes.codcliente = facturascli.codcliente\n\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\tagentes AS agentes ON agentes.codagente = clientes.codagente\n\t\t\t\tWHERE\n\t\t\t\t\tDATE(facturascli.fecha) = :fecha\n\t\t\t\tORDER BY clientes.codagente;\");\n\t\t\t\t\n\t\t$this->consulta('SET NAMES utf8');\n\t\t# Escribir encabezado de los productos\n\t\t$encabezado = [\"codpago\",\"nombre\",\"razonsocial\",\"codigo_vendedor\",\"nombre_vendedor\",\"fecha_facturacion\",\"fecha_vencimiento\",\"codigo\",\"observaciones\",\"total\",\"fecha_pago\"];\n\t\t# El último argumento es por defecto A1 pero lo pongo para que se explique mejor\n\t\t$sheet->fromArray($encabezado, null, 'A1');\n\t\t$parametros = array('fecha'=>$data);\n\t\t$resultado = $this->consulta($sql,$parametros);\n\t\t$res = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t$numeroDeFila = 2;\n\t\tforeach ($res as $data ) {\n\t\t\t# Obtener los datos de la base de datos\n\t\t\t$codpago = $data['codpago'];\n\t\t\t$nombre = $data['nombre'];\n\t\t\t$razonsocial = $data['razonsocial'];\n\t\t\t$codigo_vendedor = $data['codigo_vendedor'];\n\t\t\t$nombre_vendedor = $data['nombre_vendedor'];\n\t\t\t$fecha_facturacion = $data['fecha_facturacion'];\n\t\t\t$fecha_vencimiento = $data['fecha_vencimiento'];\n\t\t\t$codigo = $data['codigo'];\n\t\t\t$observaciones = $data['observaciones'];\n\t\t\t$total = $data['total'];\n\t\t\t# Escribirlos en el documento\n\t\t\t$sheet->setCellValueByColumnAndRow(1, $numeroDeFila, $codpago);\n\t\t\t$sheet->setCellValueByColumnAndRow(2, $numeroDeFila, $nombre);\n\t\t\t$sheet->setCellValueByColumnAndRow(3, $numeroDeFila, $razonsocial);\n\t\t\t$sheet->setCellValueByColumnAndRow(4, $numeroDeFila, $codigo_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(5, $numeroDeFila, $nombre_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(6, $numeroDeFila, $fecha_facturacion);\n\t\t\t$sheet->setCellValueByColumnAndRow(7, $numeroDeFila, $fecha_vencimiento);\n\t\t\t$sheet->setCellValueByColumnAndRow(8, $numeroDeFila, $codigo);\n\t\t\t$sheet->setCellValueByColumnAndRow(9, $numeroDeFila, $observaciones);\n\t\t\t$sheet->setCellValueByColumnAndRow(10, $numeroDeFila, $total);\n\t\t\t$numeroDeFila++;\n\t\t}\n\t\t$writer = new Xlsx($spreadsheet);\n\t\t$writer->save('../../reporte/reporte.xlsx');\n\t\techo \"true\";\n\t}", "private function trackerGrid() {\n\t\t\t\t\n\t\t$latestDays = filters\\timeFilter::getPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars);\n\t\t\t\t\n\t\t$arr \t\t= array();\n\t\t$arrChart \t= array();\n\t\t$cols \t\t= array();\n\t\t\n\t\tif(isset($_REQUEST['PROMOTION']))\n\t\t{\n\t\t\tif($_REQUEST['PROMOTION'] == 'YES')\n\t\t\t{\n\t\t\t\t// filters\\timeFilter::prepareTyLyMydateRange($this->settingVars); //Total Weeks\n\t\t\t\t\n\t\t\t\t$qPart = '';\n\t\t\t\tif (isset($_REQUEST[\"FS\"]) && $_REQUEST[\"FS\"] != ''){\n\t\t\t\t\t$storeStock \t= $this->settingVars->dataArray['F18']['NAME'];\n\t\t\t\t\t$availInst \t\t= $this->settingVars->dataArray['F15']['NAME'];\n\t\t\t\t\t$depotService\t= $this->settingVars->dataArray['F14']['NAME'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$latestDay = filters\\timeFilter::getPeriodWithinRange(0, 1, $this->settingVars);\n\t\t\t\t\t\n\t\t\t\t\t//MAIN TABLE QUERY\t\t\t\n\t\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\t\t\t\",\".$this->settingVars->dateField.\" AS MYDATES \" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY\" .\n\t\t\t\t\t\t\t\t\",SUM($storeStock) AS STORESTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($availInst) AS STOREINSTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($depotService) AS DEPOTSERVICE\".\n\t\t\t\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\t\t\t\" AND (\" . filters\\timeFilter::$tyWeekRange . \" OR \" . filters\\timeFilter::$lyWeekRange . \") GROUP BY SKUID, SKU, MYDATES ORDER BY MYDATES ASC, SALES DESC\";\n\t\t\t\t\t//echo $query;exit;\n\t\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\t\n\t\t\t\t\t$temp1\t= array();\n\t\t\t\t\t$temp2\t= array();\n\t\t\t\t\t$temp3\t= array();\n\t\t\t\t\t$temp4\t= array();\n\t\t\t\t\t$temp5\t= array();\n\t\t\t\t\t$latestDays = array_reverse($latestDays);\n\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t$cols[] \t= array('data'=>'L_'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\t\t\t$searchKey = array_search($lw,array_column($result,\"MYDATES\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($searchKey)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$value = $result[$searchKey];\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['SALES'];\n\t\t\t\t\t\t\t$temp2[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp3[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$account = $lw;\n\t\t\t\t\t\t\tif (in_array($account, filters\\timeFilter::$tyDaysRange)) { //$numberFrom AND $numberTo COMES HANDY HERE\n\t\t\t\t\t\t\t\t$temp4[\"L_\".str_replace(\"-\",\"\",$lw)] \t= number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t\t$temp5[\"L_\".str_replace(\"-\",\"\",$lw)]\t= number_format($value['DEPOTSERVICE'],1, '.', '');\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp['STORESTOCK'] = (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$temp['STOREINSTOCK'] = number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t$temp['DEPOTSERVICE'] = number_format($value['DEPOTSERVICE'],1, '.', '');\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp2[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp3[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp4[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp5[\"L_\".str_replace(\"-\",\"\",$lw)] = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = $temp['STORESTOCK'] = $temp['STOREINSTOCK'] = $temp['DEPOTSERVICE'] = 0;\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$temp1['label'] = \"SALES \".$this->settingVars->currencySign;\n\t\t\t\t\t$temp2['label'] = \"QTY\";\n\t\t\t\t\t$temp3['label'] = \"STORE STOCK\";\n\t\t\t\t\t$temp4['label'] = \"STORE INSTOCK %\";\n\t\t\t\t\t$temp5['label'] = \"DEPOT SERVICE %\";\n\t\t\t\t\t\n\t\t\t\t\t$arr[0]\t= $temp1;\t\t\t\t\n\t\t\t\t\t$arr[1]\t= $temp2;\t\t\t\t\n\t\t\t\t\t$arr[2]\t= $temp3;\t\t\t\t\n\t\t\t\t\t$arr[3]\t= $temp4;\t\t\t\t\n\t\t\t\t\t$arr[4]\t= $temp5;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilters\\timeFilter::fetchPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars); //To get $mydateRange\n\t\t\t\t\n\t\t\t\t$act = $_REQUEST['ACCOUNT'];\n\t\t\t\t$account = $this->settingVars->dataArray[$act]['NAME'];\n\t\t\t\t\n\t\t\t\t//asort($latestDays);\n\t\t\t\t\n\t\t\t\t$getLdates = array();\n\t\t\t\tforeach($latestDays as $date)\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$getLdates[] = \"MAX((CASE WHEN \" . $this->settingVars->period . \"='\".$date.\"' THEN 1 ELSE 0 END)*$account) AS DATE\".str_replace(\"-\",\"\",$date);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qPart = implode(\",\",$getLdates);\n\t\t\t\t\n\t\t\t\t//MAIN TABLE QUERY\n\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY,\" .\n\t\t\t\t\t$qPart.\n\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\" AND \" . filters\\timeFilter::$mydateRange . \" GROUP BY SKUID, SKU ORDER BY SALES DESC\";\n\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\n\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\tforeach ($result as $key => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$temp \t\t\t\t= array();\n\t\t\t\t\t\t$temp['SKUID'] \t\t= $value['SKUID'];\n\t\t\t\t\t\t$temp['SKU'] \t\t= $value['SKU'];\n\t\t\t\t\t\t$temp['SALES'] \t\t= number_format($value['SALES'], 1, '.', '');\n\t\t\t\t\t\t$temp['QTY'] \t\t= number_format($value['QTY'], 1, '.', '');\n\t\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t\t$cols[] \t= array('data'=>'Tracker_L'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp['Tracker_L'.str_replace(\"-\",\"\",$lw)] \t= number_format($value['DATE'.str_replace(\"-\",\"\",$lw)], 1, '.', '');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$arr[] \t\t\t\t= $temp;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n $this->jsonOutput['TrackerGrid'] \t= $arr;\n $this->jsonOutput['TrackerChart'] \t= $arrChart;\n $this->jsonOutput['Tracker_L'] \t\t= $cols;\n }", "function getData($strKriteria)\n{\n global $tblEmployee;\n global $strDataTotal;\n global $strChartPath;\n global $strPageTitle;\n global $strWordsTitle;\n global $strDirPath;\n global $strFilePath;\n global $strDate;\n global $strPageTitle;\n global $strDataInterval;\n global $strResultInTable;\n global $db;\n global $ARRAY_EMPLOYEE_STATUS;\n $chart = new VerticalBarChart();\n $dataSet = new XYDataSet();\n //get all edu level\n $arrCode = $ARRAY_EMPLOYEE_STATUS;\n $arrCode[] = null;\n foreach ($arrCode as $key => $codeData) {\n $strSQL = \"SELECT COUNT(*) FROM hrd_employee AS t1\n\t\tLEFT JOIN hrd_salary_detail AS t2 ON t1.id = t2.id_employee \";//AND t1.position_code = t2.position_code \";\n $strExecuteKriteria = \" AND t1.employee_status = '$key' \";\n $strExecuteSQL = $strSQL . $strKriteria . $strExecuteKriteria;\n $numOfEmployee = $db->execute($strExecuteSQL);\n $numOfEmployee = $db->fetchrow($numOfEmployee);\n $numOfEmployee = $numOfEmployee[\"count\"];\n if ($codeData == null) {\n $codeData = getWords(\"No $strWordsTitle Data\");\n }\n $dataSet->addPoint(new Point(\"$codeData\", $numOfEmployee));\n $strResultInTable .= \"\n\t\t<tr>\n\t\t\t<td>$codeData</td>\n\t\t\t<td align=right>$numOfEmployee</td>\n\t\t</tr>\n\t\t\";\n $strDataTotal += $numOfEmployee;\n }\n $chart->setDataSet($dataSet);\n $chart->setTitle($strPageTitle);\n $strChartPath = $strDirPath . \"/\" . $strFilePath;\n if (!file_exists($strChartPath)) {\n if (!file_exists($strDirPath)) {\n mkdir($strDirPath);\n }\n $temp = fopen($strChartPath, \"w\");\n fwrite($temp, \"\");\n fclose($temp);\n }\n $chart->render($strChartPath);\n}", "public function run()\n {\n\n // $order = Requests::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"), date('Y'))\n // // ->jorn('request', 'request.request_id', '=', 'order.request_id')\n // ->get();\n\n // $data['charts'] = Charts::database($order, 'bar', 'highcharts')\n\n // ->title(\"thống kê\")\n\n // ->elementLabel(\"payment\")\n\n // ->dimensions(1000, 500)\n\n // ->responsive(false)\n\n // ->groupByMonth(date('Y'), true);\n\n $data['name'] = 'CMS';\n return view('Order::widgets.revenue', $data);\n }", "function getVenues()\n{\n\tglobal $db;\n\tglobal $venueName;\n\t$venues = array();\n\t$venue['venue_id'] = 0;\n $venue['accepting'] = getAccepting();\n $venue['name'] = $venueName;\n\t$venue['url_name'] = \"none\";\n\t$venues['venues'][] = $venue;\n\treturn $venues;\n}", "private function _get_itemreport_customs_old($usr_profitview, $profitview, $start_date, $end_report, $brand) {\n\n $profit_type = $usr_profitview;\n $cust_scryears=$customs=$custom_keys=array();\n\n foreach ($profitview as $prow) {\n if ($prow['websys_page_link'] == 'itemsalescustoms') {\n $profit_type = $prow['profit_view'];\n }\n }\n $this->db->select(\"date_format(from_unixtime(o.order_date),'%Y') as repyear, date_format(from_unixtime(o.order_date),'%m') as repmonth\", FALSE);\n $this->db->select('count(o.order_id) as cnt_orders, sum(o.revenue) as revenue, sum(o.profit) as profit');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $start_date);\n $this->db->where('o.order_date < ', $end_report);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->group_by('repyear, repmonth');\n $this->db->order_by('repyear, repmonth');\n $custom_monthdat = $this->db->get()->result_array();\n foreach ($custom_monthdat as $row) {\n $profitval = floatval($row['profit']);\n $profitpnts = round($profitval * $this->config->item('profitpts'), 0);\n // 3 Special Users - Robert - 19, Sage -3, Sean - 1\n $startmonth = strtotime($row['repyear'] . '-' . $row['repmonth'] . '-01');\n $endmonth = strtotime(date(\"Y-m-d\", $startmonth) . \" +1 month\");\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 19);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $robres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 3);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $sageres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 1);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $seanres = $this->db->get()->row_array();\n $customs[] = array(\n 'year' => $row['repyear'],\n 'month' => $row['repmonth'],\n 'numorders' => intval($row['cnt_orders']),\n 'revenue' => floatval($row['revenue']),\n 'profit' => $profitval,\n 'profitpnts' => $profitpnts,\n 'rob' => $robres['cnt_orders'],\n 'sage' => $sageres['cnt_orders'],\n 'sean' => $seanres['cnt_orders'],\n );\n array_push($custom_keys, $row['repyear'] . '-' . $row['repmonth']);\n }\n $this->db->select(\"date_format(from_unixtime(o.order_date),'%Y') as repyear, date_format(from_unixtime(o.order_date),'%m') as repmonth\", FALSE);\n $this->db->select('count(o.order_id) as cnt_orders, sum(o.revenue) as revenue, sum(o.profit) as profit');\n $this->db->from('ts_orders o');\n $this->db->join(\"(select distinct(order_id) from ts_order_items where item_id={$this->config->item('custom_id')}) oi\", \"oi.order_id=o.order_id\");\n $this->db->where('o.item_id != ', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $start_date);\n $this->db->where('o.order_date < ', $end_report);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->group_by('repyear, repmonth');\n $this->db->order_by('repyear, repmonth');\n $custom_monthotherdat = $this->db->get()->result_array();\n\n foreach ($custom_monthotherdat as $row) {\n // 3 Special Users - Robert - 19, Sage -3, Sean - 1\n $startmonth = strtotime($row['repyear'] . '-' . $row['repmonth'] . '-01');\n $endmonth = strtotime(date(\"Y-m-d\", $startmonth) . \" +1 month\");\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 19);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $robres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 3);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $sageres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 1);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $seanres = $this->db->get()->row_array();\n $key = $row['repyear'] . '-' . $row['repmonth'];\n if (!in_array($key, $custom_keys)) {\n array_push($custom_keys, $key);\n $customs[] = array(\n 'year' => $row['repyear'],\n 'month' => $row['repmonth'],\n 'numorders' => intval($row['cnt_orders']),\n 'revenue' => floatval($row['revenue']),\n 'profit' => floatval($row['profit']),\n 'profitpnts' => round(floatval($row['profit']) * $this->config->item('profitpts'), 0),\n 'rob' => $robres['cnt_orders'],\n 'sage' => $sageres['cnt_orders'],\n 'sean' => $seanres['cnt_orders'],\n );\n } else {\n $cidx = 0;\n foreach ($customs as $crow) {\n if ($crow['month'] == $row['repmonth'] && $crow['year'] == $row['repyear']) {\n $customs[$cidx]['numorders'] += $row['cnt_orders'];\n $customs[$cidx]['revenue'] += $row['revenue'];\n $customs[$cidx]['profit'] += $row['profit'];\n $customs[$cidx]['profitpnts'] += round(floatval($row['profit']) * $this->config->item('profitpts'), 0);\n $customs[$cidx]['rob'] += $robres['cnt_orders'];\n $customs[$cidx]['sage'] += $sageres['cnt_orders'];\n $customs[$cidx]['sean'] += $seanres['cnt_orders'];\n } else {\n $cidx++;\n }\n }\n }\n }\n\n // Manage Customs\n for ($i = $this->salestype_start; $i < intval(date('Y')); $i++) {\n $total = array(\n 'numorders' => $this->empty_show,\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $this->empty_show,\n 'profitpnts' => $this->empty_show,\n 'revenue' => $this->empty_show,\n 'profit_view' => $profit_type,\n 'rob' => $this->empty_show,\n 'sage' => $this->empty_show,\n 'sean' => $this->empty_show,\n /* Values */\n 'numorders_val'=>0,\n 'profit_val' => 0,\n 'profitpnts_val' => 0,\n 'revenue_val' => 0,\n 'rob_val' => 0,\n 'sage_val' => 0,\n 'sean_val' => 0,\n /* Diff of values */\n 'numorders_diff'=>$this->empty_show,\n 'profit_diff' =>$this->empty_show,\n 'profitpnts_diff' => $this->empty_show,\n 'profit_percent_diff'=>$this->empty_show,\n 'revenue_diff' => $this->empty_show,\n 'rob_diff' => $this->empty_show,\n 'sage_diff' => $this->empty_show,\n 'sean_diff' => $this->empty_show,\n );\n $months = array();\n for ($j = 1; $j < 13; $j++) {\n $key = array_search($i . '-' . str_pad($j, 2, '0', STR_PAD_LEFT), $custom_keys);\n if ($key === FALSE) {\n $months[] = array(\n 'year' => $i,\n 'month' => $j,\n 'numorders' => $this->empty_show,\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $this->empty_show,\n 'profitpnts' => $this->empty_show,\n 'revenue' => $this->empty_show,\n 'profit_view' => $profit_type,\n 'rob' => $this->empty_show,\n 'sage' => $this->empty_show,\n 'sean' => $this->empty_show,\n 'prvrevenuediff'=>$this->empty_show,\n 'prvrevenueclass'=>'',\n 'prvrevenueprc'=>$this->empty_show,\n 'prvrevenueshow'=>0,\n );\n } else {\n // Get a previous revenue\n $nxtmnth=($j==12 ? 1 : $j+1);\n $nxtyear=($j==12 ? $i : $i-1);\n $prvyear=$i-1;\n $prvrevenue=0;\n $prvclass='';\n $outrevenue='';\n $outrevenueprc='';\n\n\n $months[] = array(\n 'year' => $i,\n 'month' => $j,\n 'numorders' => $customs[$key]['numorders'],\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $customs[$key]['profit'],\n 'profitpnts' => $customs[$key]['profitpnts'],\n 'revenue' => $customs[$key]['revenue'],\n 'profit_view' => $profit_type,\n 'rob' => $customs[$key]['rob'],\n 'sage' => $customs[$key]['sage'],\n 'sean' => $customs[$key]['sean'],\n );\n }\n }\n $cust_scryears[] = array(\n 'year' => $i,\n 'totals' => $total,\n 'months' => $months,\n 'profit_type' => $profit_type,\n );\n }\n // Rebuild Customs\n $cust_years = $this->_prepare_olddata($cust_scryears, 1);\n return $cust_years;\n }", "function get_historical_views_chart() {\r\n\tif (current_user_authored($post)){\r\n\t\tglobal $wp_query;\r\n\t\tget_and_store_page_views(false, true);\r\n\t\t$historical_views = get_user_meta($wp_query->get_queried_object_id(), 'ga_author_historical_views');\r\n\r\n\t\tif(empty($historical_views)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$page_views_string = \"'\" . implode ( \"', '\", array_keys($historical_views[0]) ) . \"'\";\r\n\t\t$dates_string = implode( ',', $historical_views[0] );\r\n\r\n\t\t$result = '<section class=\"stats_charts\">\r\n\t\t\t\t\t\t<h2 class=\"kicker\">All articles by month</h2>\r\n\t\t\t\t\t\t<div class=\"graphic\">\r\n\t\t\t\t\t\t\t<canvas id=\"monthly-views\" width=\"800\" height=\"450\"></canvas>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</section>';\r\n\t\t$result.= '<script>\r\n\t\t\t\t\t\tnew Chart(document.getElementById(\"monthly-views\"), {\r\n\t\t\t\t\t\t\ttype: \"line\",\r\n\t\t\t\t\t\t\tdata: {\r\n\t\t\t\t\t\t\t\tlabels: [' . $page_views_string . '],\r\n\t\t\t\t\t\t\t\tdatasets: [{ \r\n\t\t\t\t\t\t\t\t\tdata: [' . $dates_string . '],\r\n\t\t\t\t\t\t\t\t\tlabel: \"Users\",\r\n\t\t\t\t\t\t\t\t\tborderColor: \"#BF2528\",\r\n\t\t\t\t\t\t\t\t\tfill: true\r\n\t\t\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\t\t\t]\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\toptions: {\r\n\t\t\t\t\t\t\t\ttitle: {\r\n\t\t\t\t\t\t\t\tdisplay: false,\r\n\t\t\t\t\t\t\t\ttext: \"Monthly views\"\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tlegend: {\r\n\t\t\t\t\t\t\t\t\t\tdisplay: false\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tlayout: {\r\n\t\t\t\t\t\t\t\t\tpadding: {\r\n\t\t\t\t\t\t\t\t\t\tleft: 5,\r\n\t\t\t\t\t\t\t\t\t\tright: 5,\r\n\t\t\t\t\t\t\t\t\t\ttop: 25,\r\n\t\t\t\t\t\t\t\t\t\tbottom: 5\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t</script>';\r\n\t\treturn $result;\r\n\t}\r\n}", "protected function getChartData()\n {\n $data = $this->loadChartData(); //load data from CSV\n\n $groupedByWeek = $data->groupBy(function ($item) { // Group data base on week start date\n return $item->created_at->startOfWeek()->format('d/m/Y');\n });\n\n $chartData = array();\n foreach ($groupedByWeek as $key => $item) {\n $cohort = new \\stdClass();\n $cohort->name = $key;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 0)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 20)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 40)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 50)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 70)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 90)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 99)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 100)->count() / $item->count()) * 100;\n array_push($chartData, $cohort);\n };\n\n return Response()->json( // return data for chart as Json\n $chartData\n );\n }", "function make_chart($range,$from='',$to=''){\n\t\n\n$holidays['2020-04-12'] = 'Easter';\n$holidays['2020-05-25'] = 'Memorial Day';\n$holidays['2020-07-04'] = '4th of July';\n$holidays['2020-09-07'] = 'Labor Day';\n$holidays['2020-10-31'] = 'Halloween';\n$holidays['2020-11-27'] = 'Thanksgiving';\n$holidays['2020-12-25'] = 'Christmas';\t\n$holidays['2021-01-01'] = 'New Years';\t\t\n\t\n\tglobal $covid_db;\n\tglobal $zip;\n\tglobal $zip2;\n\tglobal $remove;\n\tglobal $remove2;\n\tglobal $active_count_high;\n\tglobal $active_count_low;\n\tglobal $active_count_date_high;\n\tglobal $active_count_date_low;\n\t$new_chart_sma = '';\n\t$new_chart_sma_30 = '';\n$time_chart='';\n$text_div='';\n$time_chart2='';\n$text_div2='';\n\tif ($from == ''){\n\t\t$q = \"SELECT * FROM coronavirus_zip where zip_code = '$zip' order by report_date \";\n\t\t$r = $covid_db->query($q);\n\t\t$rows = mysqli_num_rows($r);\n\t\t$start = $rows - $range;\n\t\t$range2= $range - 1;\n\t\t$start = max($start, 0);\n\t\t$q = \"SELECT * FROM coronavirus_zip where zip_code = '$zip' order by report_date limit $start, $range\";\n\t\t$r = $covid_db->query($q);\n\t\t\n\t}else{\n\t\t$q = \"SELECT * FROM coronavirus_zip where zip_code = '$zip' and report_date > '$from' and report_date < '$to' order by report_date \";\n\t\t//echo \"<h1>DEVELOPER DEBUGGING: $q</h1>\";\n\t\t//slack_general(\"$q\",'covid19-sql');\n\t\t$r = $covid_db->query($q);\n\t\t\n\t}\n$i=0;\n\t$remove_total=0;\n\t$remove2_total=0;\n\t\n$trend_setter_direction = 'FLAT';\t\n$trend_setter_duration = 0;\n$trend_setter_memory_count = 0;\n$trend_setter_memory_direction = '';\n\t\n\t$new_sma_timePeriod=0;\nwhile ($d = mysqli_fetch_array($r)){\n\t\n\tif (intval($d['report_count']) == $trend_setter_memory_count){\n\t\t$trend_setter_direction = 'FLAT';\n\t}elseif(intval($d['report_count']) > $trend_setter_memory_count){\n\t\t$trend_setter_direction = 'UP';\n\t}elseif(intval($d['report_count']) < $trend_setter_memory_count){\n\t\t$trend_setter_direction = 'DOWN';\n\t}\n\t\n\tif ($trend_setter_memory_direction == $trend_setter_direction){\n\t\t$trend_setter_duration++;\n\t}else{\n\t\t$trend_setter_duration = 0;\n\t}\n\t\n\t\n\t// Save current values for next loop\n\t$trend_setter_memory_direction = $trend_setter_direction;\n\t$trend_setter_memory_count = intval($d['report_count']);\n\t\n\tif ($d['town_name'] != ''){\n\t\t$name = \"$d[town_name], $d[state_name]\";\n\t}else{\n\t\t$state = $d['state_name'];\t\n\t}\n\t$in_14_days = date('Y-m-d',strtotime($d['report_date'])+1209600); // date + 14 days\n\t$in_28_days = date('Y-m-d',strtotime($d['report_date'])+2419200); // date + 28 days\n\tif ($i == 0){\n\t\t$me = 0;\n\t\t$remove_base=$d['report_count']; // we can only assume all prior cases were reported on the first day of the graph\n\t\t$remove[$in_14_days] = $remove_base; //difference to remove\n\t\t$remove2_base=$d['report_count']; // we can only assume all prior cases were reported on the first day of the graph\n\t\t$remove2[$in_28_days] = $remove_base; //difference to remove\n\t}else{\n\t\t$me = intval($d['report_count'] - $last);\n\t\t//$meX = intval($d['report_count'] - $last);\n\t\t//$mey = $d['report_count'];\n\t\t//if($me < 0 || $me > 50){\n\t\t//\tslack_general99(\"Attempting to graph $me testing $last2 / $last / $mey \",'covid19');\n\t\t//\t$me = intval($last2); // this is within a band, incomplete data to ignore\n\t\t//\t$meX = intval($d['report_count'] - $last2);\n\t\t//}\n\t\t$remove[$in_14_days] = $me; //difference to remove\n\t\t$remove2[$in_28_days] = $me; //difference to remove\n\t}\n\n\t$remove_date = $d['report_date'];\n\t$remove_count = $remove[$remove_date]; \n\t$remove_total = $remove_total + $remove_count;\n\t\n\t$rolling = $d['report_count'] - $remove_total;\n\t\n\t\n\t$remove2_date = $d['report_date'];\n\t$remove2_count = $remove2[$remove2_date]; \n\t$remove2_total = $remove2_total + $remove2_count;\n\t\n\t$rolling2 = $d['report_count'] - $remove2_total;\n\t\n\n\n\t$report_date = $d['report_date'];\n\tif ($holidays[$report_date] != ''){\n\t\tif ($me == 0){\n\t\t\t//slack_general99(\"Attempting to graph \".$holidays[$report_date].\" on a day with $me fails, displaying 1\",'covid19');\n\t\t\t$new_chart .= '{ label: \"'.$report_date.'\", y: 1, indexLabel: \"'.$holidays[$report_date].'\", indexLabelFontColor: \"#000000\" }, ';\n\t\t}else{\n\t\t\t$new_chart .= '{ label: \"'.$report_date.'\", y: '.$me.', indexLabel: \"'.$holidays[$report_date].'\", indexLabelFontColor: \"#000000\" }, ';\t\n\t\t}\t\n\t}else{\n\t\t$new_chart .= '{ label: \"'.$report_date.'\", y: '.$me.' }, ';\n\t}\n\t\n\t\n\t$trader_sma_real[] = intval($d['report_count']);\n\t$trader_sma_timePeriod++;\n\t$trader_sma_7 = trader_sma($trader_sma_real,7);\n\t$trader_sma_3 = trader_sma($trader_sma_real,3);\n\t//print_r($trader_sma);\n\t$the_index = $trader_sma_timePeriod - 1;\n\t$this_sma7 = $trader_sma_7[$the_index]; // should be last value\n\t$this_sma3 = $trader_sma_3[$the_index]; // should be last value\n\tif ( $this_sma7 > 0 && $remove_total > 0 && $range == '90' ){\n\t\t\n\t\t$remove_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$rolling.' }, ';\n\t\tif ($remove2_total > 0){\n\t\t\t// start graph line later?\n\t\t\t$remove2_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$rolling2.' }, ';\n\t\t}else{\n\t\t\t// test placeholder\n\t\t\t$remove2_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$active_count_high.' }, '; // use this till we get data\n\t\t}\n\t\t// start making the charts when SMA and rolling have a value for the 60 day chart\n\t\t$time_chart .= '{ label: \"'.$d['report_date'].'\", y: '.fix_zero($d['report_count']).' }, ';\n\t\t$testing_chart .= '{ label: \"'.$d['report_date'].'\", y: '.fix_zero($d['testing_count']).' }, ';\n\t\t\n\n\t\t\n\t\t//$new_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$me.' }, ';\n\t\t$new_sma_real[] = intval($me);\n\t\t$new_sma_7 = trader_sma($new_sma_real,7);\n\t\t$new_sma_30 = trader_sma($new_sma_real,30);\n\t\t$new_sma_timePeriod++;\n\t\t$the_new_index = $new_sma_timePeriod - 1;\n\t\t$this_new_sma7 = $new_sma_7[$the_new_index]; // should be last value\n\t\t$this_new_sma30 = $new_sma_30[$the_new_index]; // should be last value\n\t\t$new_chart_sma .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_new_sma7).' }, ';\n\t\t$new_chart_sma_30 .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_new_sma30).' }, ';\n\t\t$sma_chart .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_sma7).' }, ';\n\t\t$sma_chart3 .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_sma3).' }, ';\n\t\t//$remove_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$rolling.' }, ';\n\t\t// only check and set once we are graphing\n\t\tif ($rolling > $active_count_high){\n\t\t\t$active_count_high \t= $rolling;\t\n\t\t\t$active_count_date_high = $d['report_date'];\n\t\t}\n\t\tif ($active_count_low > $rolling){\n\t\t\t$active_count_low \t= $rolling;\t\n\t\t\t$active_count_date_low \t= $d['report_date'];\n\t\t}\n\t\t$low_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$active_count_high.' }, ';\n\t\t$high_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$active_count_low.' }, ';\n\t}elseif( $range != '90' ){\n\t\t$time_chart .= '{ label: \"'.$d['report_date'].'\", y: '.fix_zero($d['report_count']).' }, ';\n\t\t$testing_chart .= '{ label: \"'.$d['report_date'].'\", y: '.fix_zero($d['testing_count']).' }, ';\n\n\t\t$new_sma_real[] = intval($me);\n\t\t$new_sma_7 = trader_sma($new_sma_real,7);\n\t\t$new_sma_30 = trader_sma($new_sma_real,30);\n\t\t$new_sma_timePeriod++;\n\t\t$the_new_index = $new_sma_timePeriod - 1;\n\t\t$this_new_sma7 = $new_sma_7[$the_new_index]; // should be last value\n\t\t$this_new_sma30 = $new_sma_30[$the_new_index]; // should be last value\n\t\t$new_chart_sma .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_new_sma7).' }, ';\n\t\t$new_chart_sma_30 .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_new_sma30).' }, ';\n\t\t$sma_chart .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_sma7).' }, ';\n\t\t$sma_chart3 .= '{ label: \"'.$d['report_date'].'\", y: '.intval($this_sma3).' }, ';\n\t\t$remove_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$rolling.' }, ';\n\t\t$remove2_chart .= '{ label: \"'.$d['report_date'].'\", y: '.$rolling2.' }, ';\n\t\tif ( $this_sma7 > 0 && $remove_total > 0 ){\n\t\t\tif ($rolling > $active_count_high){\n\t\t\t\t$active_count_high \t= $rolling;\t\n\t\t\t\t$active_count_date_high = $d['report_date'];\n\t\t\t}\n\t\t\tif ($active_count_low > $rolling){\n\t\t\t\t$active_count_low \t= $rolling;\t\n\t\t\t\t$active_count_date_low \t= $d['report_date'];\n\t\t\t}\t\n\t\t}\n\t}\n\n\t$last2 = $me;\n\t$last = $d['report_count'];\n\t$text_div .= \"<li>$d[report_date] $d[report_count] $d[trend_direction] $d[trend_duration]</li>\";\n\t$last_count = $d['report_count'];\n\tif($i == 0){\n\t\t$start_value = fix_zero($d['report_count']);\n\t}\n\tif($i == $range2){\n\t\t$end_value = fix_zero($d['report_count']);\n\t}\n\t$i++; // number of days in the graph\n}\n\t\n\t$remove_chart \t\t= rtrim(trim($remove_chart), \",\");\n\t$remove2_chart \t\t= rtrim(trim($remove2_chart), \",\");\n\t$low_chart \t\t= rtrim(trim($low_chart), \",\");\n\t$high_chart \t\t= rtrim(trim($high_chart), \",\");\n\t$sma_chart \t\t= rtrim(trim($sma_chart), \",\");\n\t$testing_chart \t\t= rtrim(trim($testing_chart), \",\");\n\t$sma_chart3 \t\t= rtrim(trim($sma_chart3), \",\");\n\t$time_chart \t\t= rtrim(trim($time_chart), \",\");\n\t$new_chart \t\t= rtrim(trim($new_chart), \",\");\n\t$new_chart_sma \t\t= rtrim(trim($new_chart_sma), \",\");\n\t$new_chart_sma_30 \t= rtrim(trim($new_chart_sma_30), \",\");\n\t$page_description \t= \"$date $name at $last_count Cases ($active_count_low to $active_count_high) \";\n\t$name2\t\t\t= '';\n\t$i2\t\t\t= 0;\n\n\t\nif ($name == ''){\n\t$name = $state;\n}\n$name = $zip.' '.$name.$name2;\n\nif ($zip2 != '99999'){\n\tif ($i > $i2){\n\t\t$time_chart2_pre='';\n\t\t// add blank days to the front of $time_chart2\n\t\tforeach (range($i2, $i-1) as $back_days) {\n\t\t\t$back_days = -1 * $back_days; \n\t\t\t$date = date('Y-m-d',strtotime($back_days.' days'));\n\t\t\t$time_chart2_pre = '{ label: \"'.$date.'\", y: 0 }, ' . $time_chart2_pre;\n\t\t}\n\t\t$time_chart2 = $time_chart2_pre.$time_chart2;\n\t}elseif($i < $i2){\n\t\t$time_chart_pre='';\n\t\t$back_days = -1 * $back_days; \n\t\t// add blank days to the front of $time_chart\n\t\tforeach (range($i, $i2-1) as $back_days) {\n\t\t\t$back_days = -1 * $back_days; \n\t\t\t$date = date('Y-m-d',strtotime($back_days.' days'));\n\t\t\t$time_chart_pre = '{ label: \"'.$date.'\", y: 0 }, ' . $time_chart_pre;\n\t\t}\n\t\t$time_chart = $time_chart_pre.$time_chart;\n\t}\n}\nob_start();\n?>\n<div class=\"row\">\n\t<?PHP \n\t$per = round( ( ( fix_zero($end_value) - fix_zero($start_value) ) / fix_zero($start_value) ) * 100); \n\tif ($per == '0'){\n\t\t$color = 'lightgreen';\t\n\t}elseif($per < '10'){\n\t\t$color = 'lightyellow';\n\t}else{\n\t\t$color = '#fed8b1'; // light orange\n\t}\n\t?>\n\t\n\t<p style='text-align:center; background-color:<?PHP echo $color;?>;'>\n\t\t<b>From <?PHP echo fix_zero($start_value);?> cases to <?PHP echo fix_zero($end_value);?> cases is a <?PHP echo $per;?>% change in <?PHP echo $range;?> days.</b>\n\t</p>\n\t\n</div>\n<?PHP \n$per = abs($per); // fix -%\n$page_description = $per.\"% change $page_description\";\n$alert = ob_get_clean();\n\t$return = array();\n\t$return['trend_setter_duration'] = $trend_setter_duration;\n\t$return['trend_setter_direction'] = $trend_setter_direction;\n\t$return['alert'] = $alert;\n\t$return['page_description'] = $page_description;\n\t$return['time_chart'] = $time_chart;\n\t$return['time_chart2'] = $time_chart2;\n\t$return['testing_chart'] = $testing_chart;\n\t$return['new_chart'] = $new_chart;\n\t$return['new_chart_sma'] = $new_chart_sma;\n\t$return['new_chart_sma_30'] = $new_chart_sma_30;\n\t$return['remove_chart'] = $remove_chart;\n\t$return['remove2_chart'] = $remove2_chart;\n\t$return['high_chart'] = $high_chart;\n\t$return['low_chart'] = $low_chart;\n\t$return['sma_chart'] = $sma_chart;\n\t$return['sma3_chart'] = $sma_chart3;\n\t$return['range'] = $range;\n\t$return['active_count'] = $rolling;\n\t$return['active2_count'] = $rolling2;\n\t$return['name'] = $name;\n\t$return['per'] = $per;\n\treturn $return;\n}", "public function resumenSerie(){\n return $resumen=$this->mysqli->query(\"SELECT plot FROM titles\");\n }", "function get_reptotal_ventas($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and i.usuario_id = \".$usuario_id.\" \";\r }\r $ingresos = $this->db->query(\"\r select\r SUM(d.detalleven_total) as total\r from\r\r venta v, detalle_venta d, producto p\r\r where\r\r date(v.venta_fecha) >= '\".$fecha1.\"'\r and date(v.venta_fecha) <= '\".$fecha2.\"'\r and v.forma_id = 1\r and v.venta_id = d.venta_id\r and d.producto_id = p.producto_id \r \".$cadusuario.\" \r order by v.venta_fecha desc, v.venta_hora desc\r \")->row_array();\r \r return $ingresos['total'];\r }", "function drawLineChart($companies,$data,$chartName,$div=\"\",$width=500,$height=500,$background=\"#f0f0f0\",$xaxisType='date') {\n // format = array(\"string \"=>array(client,competitorA,CompetitorB));\n // Eg : array(\"month 2\"=>array(600,300,800),\"month 3\"=>array(800,700,100),\"Month 4\"=>array(500,900,600),\"Month 5\"=>array(400,400,900),\"Month 6\"=>array(500,600,90));\n\n // The $companies should be in the following format\n // format : array(client,competitorA,competitorB);\n // Eg: (www.scoot.co.uk,www.touchlocal.com,www.yell.com);\n\n $arrDataColsHTML = array();\t// the columns\n\t\t $arrDataRowsHTML = array();\n \n $arrDataCol = array();\n $arrDataCol['label'] = \"\";\n\t $arrDataCol['type'] = $xaxisType;\n\t $arrDataColsHTML[] = $arrDataCol;\n\n foreach ($companies as $c) {\n\n $arrDataCol = array();\n \t\t $arrDataCol['label'] = $c;\n\t \t\t\t $arrDataCol['type'] = \"number\";\n\t \t\t\t$arrDataColsHTML[] = $arrDataCol;\n }\n\n foreach ($data as $key=>$A) {\n \n \t\t\t$arrDataRowsCell = array();\t\n\t\t \t\t\t\t$arrDataRowsCell[]=$key;\n \t\t\t foreach($A as $B) {\n \t\t\t\t$arrDataRowsCell[]=$B;\n \t\t\t\t}\n\n \t\t$arrDataRowsHTML[] = $arrDataRowsCell;\n\n }\n\n $arrColumns = exportGoogleVisColumns($arrDataColsHTML);\t\t\t\n\t\t\t// Build Google Vis Rows\n\t $arrRows = exportGoogleVisRows($arrDataRowsHTML);\n\n\t $strTable = GoogleVisDataTable($arrColumns,$arrRows,\"data\");\n\n\t?>\n <script type=\"text/javascript\">\n function drawVisualization<?=$chartName?>() {\n // Create and populate the data table.\n \t\t\t\t\t\t<? echo $strTable; ?>\n \n // Create and draw the visualization.\n new google.visualization.LineChart(document.getElementById('<?=$div?>')).\n draw(data, {curveType: \"none\",\n width: <?=$width?>, height: <?=$height?>,\n vAxis: {maxValue: 10},legend: \"top\",pointSize:\"5\",backgroundColor: \"<?=$background?>\"}\n );\n }\n \n\n google.setOnLoadCallback(drawVisualization<?=$chartName?>);\n </script>\n\t<?\n }", "function block_ranking_create_group_points_evolution_chart($groupid) {\n $records = block_ranking_get_points_evolution_by_group($groupid);\n\n $pointsbydate = [];\n\n // Pega o primeiro registro, tira do array e soma os pontos na data.\n if (count($records)) {\n $firstrecord = array_shift($records);\n $lastdate = date('d-m-Y', $firstrecord->timecreated);\n\n $pointsbydate[$lastdate] = $firstrecord->points;\n }\n\n // Percorre os demais registros.\n if (count($records)) {\n foreach ($records as $points) {\n $currentdate = date('d-m-Y', $points->timecreated);\n\n if ($lastdate != $currentdate && !array_key_exists($currentdate, $pointsbydate)) {\n $lastdate = $currentdate;\n\n // Cria novo indice de novo data com valor zero.\n $pointsbydate[$lastdate] = 0;\n }\n\n $pointsbydate[$lastdate] += $points->points;\n }\n }\n\n if (empty($pointsbydate)) {\n return '';\n }\n\n $chart = new \\core\\chart_line(); // Create a bar chart instance.\n $chart->set_smooth(true);\n $series = new \\core\\chart_series(get_string('graph_group_evolution_title', 'block_ranking'), array_values($pointsbydate));\n $series->set_type(\\core\\chart_series::TYPE_LINE);\n $chart->add_series($series);\n $chart->set_labels(array_keys($pointsbydate));\n\n return $chart;\n}", "public function index()\n {\n $business_id = request()->session()->get('user.business_id');\n\n if (!auth()->user()->can('dashboard.data')) {\n return view('home.index');\n }\n\n $fy = $this->businessUtil->getCurrentFinancialYear($business_id);\n $date_filters['start'] = date('Y-m-d');\n $date_filters['end'] = date('Y-m-d');\n\n $currency = Currency::where('id', request()->session()->get('business.currency_id'))->first();\n \n //Chart for sells last 30 days\n $sells_last_30_days = $this->transactionUtil->getSellsLast30Days($business_id);\n $labels = [];\n $values = [];\n for ($i = 29; $i >= 0; $i--) {\n $date = \\Carbon::now()->subDays($i)->format('Y-m-d');\n\n $labels[] = date('j M Y', strtotime($date));\n\n if (!empty($sells_last_30_days[$date])) {\n $values[] = $sells_last_30_days[$date];\n } else {\n $values[] = 0;\n }\n }\n\n $sells_this_fy = $this->transactionUtil->getSellsCurrentFy($business_id, $fy['start'], $fy['end']);\n\n $labels = [];\n $values = [];\n\n $months = [];\n $date = strtotime($fy['start']);\n $last = date('M Y', strtotime($fy['end']));\n\n return view('home.index', compact('date_filters'));\n }", "public function getCashReceipt($txn_ref){\n\n $remits = Remittance::where('transaction_reference',$txn_ref)->first();\n $data =[];\n\n if($remits ){\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n $year = substr($remits->month, 0,4);\n $month = substr($remits->month, 5,2);\n $BS = Revenue::select('revenues.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','revenues.invoice','revenues.amount','revenues.created_at as date')\n ->join('users','users.userable_id','revenues.agent_id')\n ->join('services','services.id','revenues.service_id')\n ->join('revenue_points','revenue_points.id','revenues.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('revenues.created_at', '=', $year)\n ->whereMonth('revenues.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n //->where([[DB::raw('date(revenues.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]] )\n ->get();\n\n\n $QP = QuickPrintInvoice::select('quick_print_invoices.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','quick_print_invoices.invoice','quick_print_invoices.amount','quick_print_invoices.created_at as date')\n ->join('users','users.userable_id','quick_print_invoices.agent_id')\n ->join('services','services.id','quick_print_invoices.service_id')\n ->join('revenue_points','revenue_points.id','quick_print_invoices.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('quick_print_invoices.created_at', '=', $year)\n ->whereMonth('quick_print_invoices.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n\n // ->where([[DB::raw('date(quick_print_invoices.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]])\n\n ->get();\n\n\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n if(!empty($invoiceIds)){\n extract($invoiceIds);\n\n $i=0;\n foreach($BS as $bs){\n\n foreach ($b as $id){\n if($bs['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $bs['agentName'];\n $data[$i]['serviceName'] = $bs['serviceName'];\n $data[$i]['lgaName'] = $bs['lgaName'];\n $data[$i]['revPtName'] = $bs['revPtName'];\n $data[$i]['amount'] = $bs['amount'];\n $data[$i]['invoice'] = $bs['invoice'];\n $data[$i]['date'] = $bs['date'];\n $i++;\n }\n }\n }\n\n foreach($QP as $qp){\n\n foreach ($q as $id){\n if($qp['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $qp['agentName'];\n $data[$i]['serviceName'] = $qp['serviceName'];\n $data[$i]['lgaName'] = $qp['lgaName'];\n $data[$i]['revPtName'] = $qp['revPtName'];\n $data[$i]['amount'] = $qp['amount'];\n $data[$i]['invoice'] = $qp['invoice'];\n $data[$i]['date'] = $qp['date'];\n $i++;\n }\n }\n }\n\n }\n\n\n\n }\n\n\n\n\n return response()->json(['status' => 'success',\n 'data' => $data\n ]);\n\n }", "public static function BUILD_CHART()\n {\n $data = self::GET_GEN_STATS();\n\n $dataset = [];\n $fsdata = [];\n\t\t\n\t\t$labels = [];\n $m = [];\n $f = [];\n\t\t\n foreach ($data as $key => $value) {\n $obj = (object)$value;\n\t\t\t$labels[] = ['label'=>self::ABBR_CNAME($obj->COL_NAME)];\n $m[] = ['value'=>$obj->MALE];\n $f[] = ['value'=>$obj->FEMALE];\n // $dataLb[] = [\n\t\t\t\t// 'label'=>self::ABBR_CNAME($obj->COL_NAME),\n\t\t\t\t// 'value'=>($obj->TOT)\n\t\t\t// ];\n }\n\t\t\n\t\t$dataset[]=[\"seriesname\"=>\"MALE\",\"data\"=>$m];\n\t\t$dataset[]=[\"seriesname\"=>\"FEMALE\",\"data\"=>$f];\n\n $graphData = [\n\t\t\t'type'=>'MSColumn3D',\n\t\t\t'renderAt'=>'gender-graph',\n\t\t\t'width'=>'100%',\n\t\t\t'height'=>'100%',\n\t\t\t'dataFormat'=>'json',\n\t\t\t'dataSource'=>[\n\t\t\t\t\"chart\"=>[\n\t\t\t\t\t\"autoScale\"=>\"1\",\n\t\t\t\t\t\"showvalues\"=>\"0\",\n\t\t\t\t\t\"caption\"=>\"Staff Gender Distribution\",\n\t\t\t\t\t// \"numberprefix\"=>\"$\",\n\t\t\t\t\t\"xaxisname\"=>\"COLLEGES\",\n\t\t\t\t\t\"yaxisname\"=>\"Staff No.\",\n\t\t\t\t\t\"showBorder\"=>\"0\",\n\t\t\t\t\t\"paletteColors\"=>\"#0075c2,#ffb6c1\",\n\t\t\t\t\t\"exportEnabled\"=>\"1\",\n\t\t\t\t\t\"bgColor\"=>\"#ffffff\",\n\t\t\t\t\t\"canvasBgColor\"=>\"#fffff0\",\n\t\t\t\t\t\"captionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontBold\"=>\"0\",\n\t\t\t\t\t\"divlineColor\"=>\"#999999\",\n\t\t\t\t\t\"divLineIsDashed\"=>\"1\",\n\t\t\t\t\t\"divLineDashLen\"=>\"1\",\n\t\t\t\t\t\"divLineGapLen\"=>\"1\",\n\t\t\t\t\t\"toolTipColor\"=>\"#ffffff\",\n\t\t\t\t\t\"toolTipBorderThickness\"=>\"0\",\n\t\t\t\t\t\"toolTipBgColor\"=>\"#000000\",\n\t\t\t\t\t\"toolTipBgAlpha\"=>\"80\",\n\t\t\t\t\t\"toolTipBorderRadius\"=>\"2\",\n\t\t\t\t\t\"toolTipPadding\"=>\"5\",\n\t\t\t\t\t\"legendBgColor\"=>\"#ffffff\",\n\t\t\t\t\t\"legendBorderAlpha\"=>'0',\n\t\t\t\t\t\"legendShadow\"=>'0',\n\t\t\t\t\t\"legendItemFontSize\"=>'10',\n\t\t\t\t\t\"legendItemFontColor\"=>'#666666'\n\t\t\t\t],\n\t\t\t\t\"categories\"=>[\n\t\t\t\t\t[\"category\"=>$labels],\n\t\t\t\t],\n\t\t\t\t\"dataset\"=>$dataset,\n\t\t\t]\n\t\t];\n\t\t\n\t\t$fsdata = ['graph'=>$graphData];\n\n return $fsdata;\n }", "public function barGraph()\n \t{\n \t\t//All products\n \t\t$data = LemonService::listProducts();\n\n \t\t//highest price\n \t\t$max = LemonService::max($data,'base_price');\n\n \t\treturn View::make('barGraph')->with('data',$data)->with('max',$max);\n\n \t}", "public function calculateRentalFees($rentalsData): array\n {\n// die(var_dump('test'));\n $totalAmount = 0;\n $frequentRenterPoints = 0;\n $rentals = [];\n\n foreach ($rentalsData as $rental) {\n\n $thisAmount = 0;\n\n switch($rental->code_name) {\n case Movie::REGULAR:\n case Movie::SCI_FI:\n $thisAmount += 2;\n if ($rental->duration > 2) {\n $thisAmount += ($rental->duration - 2) * 1.5;\n }\n break;\n case Movie::NEW_RELEASE:\n $thisAmount += $rental->total_rentals * 3;\n if ($rental->duration > 1) {\n $frequentRenterPoints++;\n }\n break;\n case Movie::CHILDRENS:\n $thisAmount += 1.5;\n if ($rental->duration > 3) {\n $thisAmount += ($rental->duration - 3) * 1.5;\n }\n break;\n }\n\n $totalAmount += $thisAmount;\n $frequentRenterPoints++;\n $rentals[] = [\n 'name' => $rental->name,\n 'total_rentals' => $rental->total_rentals,\n 'duration' => $rental->duration,\n 'individual_amount_owed' => number_format($thisAmount, 2, '.', '')\n ];\n }\n\n $totals = [\n 'total_amount_owed' => number_format($totalAmount, 2, '.', ''),\n 'frequent_renter_points' => $frequentRenterPoints\n ];\n\n return [\n 'rentals' => $rentals,\n 'totals' => $totals\n ];\n }", "public function purchaseSalesCancelInvoiceGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t$cancelInvoiceArray=array();\r\n\t\t$cancelInvoiceData=array();\r\n\t\t\r\n\t\t$cancelSaleInvoice='SELECT count(reference_number) as sales_invoice FROM '.$this->tableNames['client_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"1\"';\r\n\t\t\r\n\t\t//total purchase invoice\r\n\t\t$cancelPurchaseInvoice = 'SELECT count(reference_number) as purchase_invoice \r\n\t\tFROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\tand added_by=\"'.$userId.'\"\r\n\t\tand is_deleted=\"0\" \r\n\t\tand is_canceled=\"1\"';\r\n\r\n\t\t$totalCancelSalesInvoice = $this->get_row($cancelSaleInvoice,false);\r\n\t\t$totalCancelPurchaseInvoice = $this->get_row($cancelPurchaseInvoice,false);\r\n\t\t\r\n\t\tif(empty($totalCancelSalesInvoice)) {\r\n\t\t\t$cancelInvoiceData['sales'] = \"0\";\r\n\t\t} else {\r\n\t\t\t$cancelInvoiceData['sales'] = $totalCancelSalesInvoice[0];\r\n\t\t}\r\n\t\t\r\n\t\tif(empty($totalCancelPurchaseInvoice)) {\r\n\t\t\t$invoiceData['purchase'] = \"0.00\";\r\n\t\t} else {\r\n\t\t\t$cancelInvoiceData['purchase'] = $totalCancelPurchaseInvoice[0];\r\n\t\t\t$cancelInvoiceData['month'] = $financial_month;\r\n\t\t}\r\n\t\tarray_push($cancelInvoiceArray, $cancelInvoiceData);\r\n\t\treturn $cancelInvoiceArray;\r\n\t}" ]
[ "0.6808142", "0.6577448", "0.6535899", "0.61825943", "0.6147914", "0.60683346", "0.59769905", "0.5923115", "0.5867847", "0.58664966", "0.58308786", "0.5800799", "0.57747054", "0.5715249", "0.5677219", "0.56616706", "0.5611785", "0.5584933", "0.55576986", "0.55254954", "0.5508388", "0.5504666", "0.5482957", "0.542023", "0.5404219", "0.5401058", "0.5359872", "0.53249246", "0.5317315", "0.5302873", "0.5293973", "0.5238512", "0.5232068", "0.52237195", "0.518981", "0.516901", "0.5165292", "0.51554275", "0.51291853", "0.51270616", "0.51162136", "0.5109992", "0.5106002", "0.505953", "0.5055737", "0.5048083", "0.50385886", "0.5031277", "0.5024818", "0.5022684", "0.5020496", "0.50181556", "0.50167197", "0.5016718", "0.5004585", "0.4996455", "0.4988862", "0.49884003", "0.4978953", "0.49455163", "0.4941893", "0.49279442", "0.4916527", "0.4903073", "0.4901364", "0.48939872", "0.48854968", "0.48775733", "0.48744348", "0.48725778", "0.48628926", "0.4851823", "0.48474187", "0.48443043", "0.48434016", "0.4828709", "0.48094532", "0.48089635", "0.4805973", "0.4805454", "0.4803568", "0.479731", "0.4781856", "0.4771769", "0.47691962", "0.4768195", "0.47641203", "0.47590116", "0.4752322", "0.4744197", "0.4736759", "0.47355002", "0.47345364", "0.47243384", "0.47226122", "0.47183377", "0.47181556", "0.46961486", "0.4686651", "0.46773678" ]
0.6911764
0
retrieve revenue data to generate the description
public function retrieveRevenueThisMonth() { $query = "SELECT SUM(exlAmount) as thisMonthTotal FROM payment WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));"; $result = mysqli_query($GLOBALS['db'], $query); $row = mysqli_fetch_assoc($result); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieveRevenueData()\n {\n //setting header to json\n header('Content-Type: application/json');\n\n //query to get the revenue data\n $query = sprintf(\"SELECT CONCAT(YEAR(date), '/', WEEK(date)) AS theWeek, SUM(exlAmount) AS revenue FROM payment GROUP BY theWeek ORDER BY YEAR(DATE) ASC, WEEK(date) ASC;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "public function get_revenue() {\n return response()->json(Revenue::active()->get()->toArray(), 200);\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "function getRevenuesData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='daily' || $varAction=='yesterday'){\n if($varAction=='daily'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n $sum=0;\n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,TIME(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded < '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$i]['time']=$arrData;\n $arrRes['data'][$i]['count']=$currSum;\n }\n $arrRes['total']=$sum;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='weekly'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n //\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count;\n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='monthly'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $currMonth.'=='.$currMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n \n \n //$arrClms = array('DATE(ItemDateAdded) as date');\n //$argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n //$argWhere .= 'AND Status <> \"Canceled\"';\n //\n //$arrData = $this->select($varTable, $arrClms, $argWhere);\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count; \n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "static function get_plan_revenue()\n {\n $cond_str = RestaurantTotalReportDB::get_month_year_string($_REQUEST['from_date'],$_REQUEST['to_date']);\n $sql = 'select\n (bar.name || \\'_\\' || pim.bar_index) as id,\n sum(pim.value) as value,\n pim.portal_id,\n pim.bar_index\n from\n plan_in_month pim\n inner join bar on bar.id = pim.bar\n where\n (pim.month || pim.year) in ('.$cond_str.')\n and pim.bar is not null\n and pim.bar_index is not null\n group by \n bar.name,\n pim.portal_id,\n pim.bar_index\n ';\n $items = DB::fetch_all($sql);\n return $items;\n }", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function display_site_revenue() {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n\t\t\t$company_id=$this->data['company_id'];\n $billingsList = $this->revenue_model->get_all_details(TRANSACTION, array(), array('bill_generated' => 'DESC'));\n\n $req = (empty($_GET['range'])) ? '' : $_GET['range'];\n $this->data['range'] = $range = (empty($_GET['range'])) ? '' : base64_decode(rawUrlDecode($_GET['range']));\n\t\t\t\n\t\t\t$dateFrom = $this->input->get('from'); \n\t\t\t$dateTo = $this->input->get('to');\n\t\t\tif($range == '' && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t$range = $dateFrom.' - '.$dateTo; \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$locationId = $this->input->get('location_id');\n\t\t\t$driverCond = array();\n\t\t\t$driverCond = array('company_id'=>$company_id);\n\t\t\tif($locationId != '' && $locationId != 'all'){\n\t\t\t\t$driverCond = array('driver_location' => $locationId,'company_id'=>$company_id);\n\t\t\t}\n\t\t\t\n $selectFields = array('email', 'image', 'driver_name', 'vehicle_number', 'vehicle_model', 'no_of_rides', 'cancelled_rides', 'mobile_number', 'dail_code');\n $driversCount = $this->revenue_model->get_all_counts(DRIVERS,$driverCond);\n if ($driversCount > 500) {\n $limitPerPage = 100;\n $offsetVal = 0;\n if (isset($_GET['per_page'])) {\n $offsetVal = $this->input->get('per_page');\n }\n\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields, array(), $limitPerPage, $offsetVal);\n\n if(!isset($_GET['range']) && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t\t$manRange = 'from='.urlencode($dateFrom).'&to='.urlencode($dateTo);\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?' . $manRange;\n\t\t\t\t} else {\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?range=' . $req;\n\t\t\t\t}\n\t\t\t\t\n $config['num_links'] = 3;\n $config['display_pages'] = TRUE;\n $config['page_query_string'] = TRUE;\n $config['base_url'] = $searchbaseUrl;\n $config['total_rows'] = $driversCount;\n $config[\"per_page\"] = $limitPerPage;\n $config[\"uri_segment\"] = 4;\n $config['first_link'] = '';\n $config['last_link'] = '';\n $config['full_tag_open'] = '<ul class=\"tsc_pagination tsc_paginationA tsc_paginationA01\">';\n $config['full_tag_close'] = '</ul>';\n if ($this->lang->line('pagination_prev_lbl') != '') $config['prev_link'] =stripslashes($this->lang->line('pagination_prev_lbl')); else $config['prev_link'] ='Prev';\n $config['prev_tag_open'] = '<li>';\n $config['prev_tag_close'] = '</li>';\n if ($this->lang->line('pagination_next_lbl') != '') $config['next_link'] =stripslashes($this->lang->line('pagination_next_lbl')); else $config['next_link'] ='Next';\n $config['next_tag_open'] = '<li>';\n $config['next_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"current\"><a href=\"javascript:void(0);\" style=\"cursor:default;\">';\n $config['cur_tag_close'] = '</a></li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['first_tag_open'] = '<li>';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_tag_close'] = '</li>';\n if ($this->lang->line('pagination_first_lbl') != '') $config['first_link'] =stripslashes($this->lang->line('pagination_first_lbl')); else $config['first_link'] ='First';\n if ($this->lang->line('pagination_last_lbl') != '') $config['last_link'] = stripslashes($this->lang->line('pagination_last_lbl')); else $config['last_link'] ='Last';\n $this->pagination->initialize($config);\n $paginationLink = $this->pagination->create_links();\n $this->data['paginationLink'] = $paginationLink;\n } else {\n $this->data['paginationLink'] = '';\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields);\n }\n \n $dates = @explode('-', $range);\n $mfrom = '';\n $mto = '';\n\n if (count($dates) == 2) {\n $mfrom = trim($dates[0]);\n $mto = trim($dates[1]);\n } else {\n $mto = get_time_to_string(\"m/d/Y\");\n if ($billingsList->num_rows() == 0) {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n }\n\n if ($billingsList->num_rows() == 0) {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n\n $filter = '';\n $fromdate = '';\n $todate = '';\n $fdate = '';\n $tdate = '';\n if ($mfrom != \"\" && $mto != \"\") {\n $filter = 'dummy';\n $fromdate = strtotime($mfrom . ' 00:00:00');\n $todate = strtotime($mto . ' 23:59:59');\n }\n $this->data['filter'] = $filter;\n $this->data['last_bill'] = $last_bill;\n\n $cB = get_time_to_string(\"m/d/Y\", $fromdate) . ' - ' . get_time_to_string(\"m/d/Y\", $todate);\n $this->data['cB'] = $cB;\n\n if ($fromdate != '' && $todate != '') {\n $fdate = $fromdate;\n $tdate = $todate;\n }\n\n $totalRides = 0;\n $totalRevenue = 0;\n $siteRevenue = 0;\n $driverRevenue = 0;\n if ($driverDetails->num_rows() > 0) {\n foreach ($driverDetails->result() as $driver) {\n $total_rides = 0;\n $cancelled_rides = 0;\n $successfull_rides = 0;\n $total_revenue = 0;\n $in_site = 0;\n $couponAmount = 0;\n $in_driver = 0;\n $total_due = 0;\n $site_earnings = 0;\n $driver_earnings = 0;\n $tips_amount = 0;\n $tips_in_site = 0;\n $tips_in_driver = 0;\n\n $driver_id = (string) $driver->_id;\n $driver_name = (string) $driver->driver_name;\n $driver_email = (string) $driver->email;\n $driver_phone = (string) $driver->dail_code . $driver->mobile_number;\n $driver_image = USER_PROFILE_IMAGE_DEFAULT;\n if (isset($driver->image)) {\n if ($driver->image != '') {\n $driver_image = USER_PROFILE_IMAGE . $driver->image;\n }\n }\n $rideDetails = $this->revenue_model->get_ride_details_company($driver_id, $fdate, $tdate,$company_id);\n\n if (!empty($rideDetails['result'])) {\n $total_rides = $rideDetails['result'][0]['totalTrips'];\n $total_revenue = $rideDetails['result'][0]['totalAmount'];\n #$in_site = $rideDetails['result'][0]['by_wallet'];\n $couponAmount = $rideDetails['result'][0]['couponAmount'];\n $site_earnings = $rideDetails['result'][0]['site_earnings'];\n $driver_earnings = $rideDetails['result'][0]['driver_earnings'];\n\t\t\t\t\t\t\n if (isset($rideDetails['result'][0]['tipsAmount'])) {\n $tips_amount = $rideDetails['result'][0]['tipsAmount'];\n }\n if (isset($rideDetails['result'][0]['amount_in_site'])) {\n $in_site = $rideDetails['result'][0]['amount_in_site'];\n }\n if (isset($rideDetails['result'][0]['amount_in_driver'])) {\n $in_driver = $rideDetails['result'][0]['amount_in_driver'];\n }\n }\n\n $driver_earnings = $driver_earnings + $tips_amount;\n\n $this->data['driversList'][$driver_id]['id'] = $driver_id;\n $this->data['driversList'][$driver_id]['driver_name'] = $driver_name;\n $this->data['driversList'][$driver_id]['driver_email'] = $driver_email;\n $this->data['driversList'][$driver_id]['driver_image'] = base_url() . $driver_image;\n $this->data['driversList'][$driver_id]['driver_phone'] = $driver_phone;\n\t\t\t\t\t\n\t\t\t\t\t$this->data['driversList'][$driver_id]['total_rides'] = $total_rides;\n $this->data['driversList'][$driver_id]['total_revenue'] = $total_revenue;\n $this->data['driversList'][$driver_id]['in_site'] = $in_site;\n $this->data['driversList'][$driver_id]['couponAmount'] = $couponAmount;\n $this->data['driversList'][$driver_id]['in_driver'] = $in_driver;\n $this->data['driversList'][$driver_id]['total_due'] = $total_due;\n\n $this->data['driversList'][$driver_id]['site_earnings'] = $site_earnings;\n $this->data['driversList'][$driver_id]['driver_earnings'] = $driver_earnings;\n $this->data['driversList'][$driver_id]['driver_tips'] = $tips_amount;\n\t\n }\n } \n $rideSummary = $this->revenue_model->get_ride_summary_company($fdate, $tdate,$company_id,$locationId);\n \n if (!empty($rideSummary['result'])) {\n $totalRides = $rideSummary['result'][0]['totalTrips'];\n $siteRevenue = $rideSummary['result'][0]['site_earnings'];\n $driverRevenue = $rideSummary['result'][0]['driver_earnings'];\n $totalRevenue = $siteRevenue + $driverRevenue;\n }\n\n $this->data['totalRides'] = $totalRides;\n $this->data['totalRevenue'] = $totalRevenue;\n $this->data['siteRevenue'] = $siteRevenue;\n $this->data['driverRevenue'] = $driverRevenue;\n\n $this->data['fromdate'] = $mfrom;\n $this->data['todate'] = $mto;\n\n\n $this->data['billingsList'] = $billingsList;\n\t\t\t\n\t\t\t $this->data['locationList'] = $this->revenue_model->get_all_details(LOCATIONS, array('status' => 'Active'), array('city' => 'ASC'));\n\n if ($this->lang->line('admin_site_earnings_total_revenue_list') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_site_earnings_total_revenue_list')); \n\t\t else $this->data['heading'] = 'Total Revenue List';\n $this->load->view(COMPANY_NAME.'/revenue/display_site_revenue', $this->data);\n }\n }", "public function show(Revenue $revenue)\n {\n return $this->response->item($revenue, new Transformer());\n }", "public function actionPending_revenue() {\n\n /* redirect a user if not super admin */\n if (!Yii::$app->CustomComponents->check_permission('pending_revenue')) {\n return $this->redirect(['site/index']);\n }\n\n $dataService = $this->quickbook_instance();\n $courses_from_qb = $dataService->Query(\"SELECT * FROM Item\");\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $user = Yii::$app->user->identity;\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n $data = Yii::$app->request->post();\n\n $filter_data = array();\n $by_team_arr = array();\n $month_year_arr = array();\n $all_invoice_of_customer = array();\n $allInvoices = array();\n $allPayments = array();\n\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n\n if ($data) {\n\n if ($user_role == 33) {\n $this->pending_revenue_manager_filter();\n } else {\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $user_id = $data['sales_user_id'];\n } else {\n $user_id = $user->id;\n }\n\n if ($user_role == 7) {\n $filters = [];\n } else if ($user_role == 6) {\n $filters = ['sales_user_id' => $data['sales_user_id']];\n } else if ($user_role == 1) {\n $filters = [];\n } else {\n $filters = ['sales_user_id' => $user_id];\n }\n\n $team_ids = array();\n if (isset($data['email']) && $data['email'] != '') {\n $filter_data['email'] = $data['email'];\n }\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n\n $new_date = explode('_', $data['bymonth']);\n $fyear = $new_date['1'];\n $fmonth = $new_date['0'];\n\n if ($fmonth <= 9 && strlen($fmonth) == 1) {\n $fmonth = \"0\" . $fmonth;\n }\n $first_date_of_current_month = date(\"$fyear-$fmonth-01\");\n $last_date_of_current_month = $lastday = date('Y-m-t', strtotime($first_date_of_current_month));\n } else if ($data['by_date_month'] == 'd') {\n $first_date_of_current_month = date(\"Y-m-d\", strtotime($data['sdate']));\n $last_date_of_current_month = date(\"Y-m-d\", strtotime($data['edate']));\n }\n\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $allInvoices = array();\n $qb_cust_id_arr = array();\n\n if ($user_role == 7) {\n \n } else if ($user_role == 6) {\n \n } else if ($user_role != 1) {\n $filter_data['sales_user_id'] = $user->id;\n }\n if (isset($data['by_date_month'])) {\n\n if ($user_role == 7) { /* If current user is not super admin */\n\n if (isset($data['byTeam']) && !empty($data['byTeam'])) {\n $by_team_arr['byTeam'] = $data['byTeam'];\n $byteam = $data['byTeam'];\n if (isset($data['sales_user_id']) && !empty($data['sales_user_id'])) {\n if (count($data['sales_user_id']) == 1 && empty($data['sales_user_id'][0])) {\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = $byteam \")->queryAll();\n $sales_head_str = \"\";\n if (!empty($team_model_val)) {\n foreach ($team_model_val as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str .= $byteam;\n $sales_head_str = rtrim($sales_head_str, \",\");\n\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n $sales_user_id_arr = $data['sales_user_id'];\n if (empty($data['sales_user_id'][0])) {\n $sales_user_id_arr[] = $data['byTeam'];\n }\n\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['in', 'sales_user_id', $sales_user_id_arr])->all();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n if (!empty($data['byTeam'])) {\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id = $team\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n }\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else if ($user_role == 6) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $data['sales_user_id']])->all();\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else if ($user_role != 1) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else { /* If current user is super admin */\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n } else {\n if ($user_role == 7) { /* If current user is not super admin */\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n }\n\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n if ($data['sdate'] != \"\" && $data['by_date_month'] == 'd') {\n $query = DvRegistration::find()\n ->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } elseif ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['assist_participant.id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n\n $query->andWhere(['>', 'qb_customer_id', 0]);\n $query->groupBy(['email']);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 20]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $filter_data['bymonth'] = $data['bymonth'];\n }\n if ($data['by_date_month'] != '') {\n $filter_data['by_date_month'] = $data['by_date_month'];\n }\n\n if ($data['sdate'] != '' && $data['by_date_month'] == 'd') {\n $filter_data['sdate'] = $data['sdate'];\n $filter_data['edate'] = $data['edate'];\n }\n\n if ($data['email'] != \"\") {\n $filter_data['email'] = $data['email'];\n }\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $filter_data['sales_user_id'] = $data['sales_user_id'];\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n\n $invoice_number = \"\";\n $total_of_all_currencys = array();\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n /* echo \"<pre>\";\n print_r($models);\n die; */\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'pagination' => $pagination,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'count' => $offset,\n 'total_count' => $count,\n 'filter_data' => $filter_data,\n 'by_team_arr' => $by_team_arr,\n 'allInvoices' => $allInvoices,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month,\n 'courses_from_qb' => $courses_from_qb\n ]);\n }\n } else {\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n if ($user_role == 1) {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n $query = DvRegistration::find()->where(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 6) {\n $sales_heads = Yii::$app->db->createCommand(\"SELECT assist_users.id FROM assist_users INNER JOIN assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.status = 1 AND assist_users.department = 1 AND assist_user_meta.meta_key = 'team' AND assist_user_meta.meta_value=$user->id\")->queryAll();\n $sales_heads_str = \"\";\n if (!empty($sales_heads)) {\n foreach ($sales_heads as $m_sales_head) {\n $sales_heads_str .= $m_sales_head['id'] . \",\";\n }\n }\n $sales_heads_str .= $user->id;\n $sales_heads_str = rtrim($sales_heads_str, \",\");\n\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_heads_str )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 7) {\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' \")->queryAll();\n\n $executive_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) \")->queryAll();\n $team_model_val[]['uid'] = $user->id;\n $combined_sales_head_arr = array_merge($team_model_val, $executive_model_val);\n\n $sales_head_str = \"\";\n if (!empty($combined_sales_head_arr)) {\n foreach ($combined_sales_head_arr as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str = rtrim($sales_head_str, \",\");\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n /* echo \"<pre>\";\n print_r($all_invoice_of_customer);\n die; */\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['sales_user_id' => $user->id])->andWhere(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n $query->groupBy(['email']);\n $query->orderBy(['id' => SORT_DESC]);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 10]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n // echo \"in\"; die;\n // Start Get Total of different currency \n $invoice_number = \"\";\n $total_of_all_currencys = array();\n\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'pagination' => $pagination,\n 'count' => $offset,\n 'total_count' => $count,\n 'allInvoices' => $allInvoices,\n 'courses_from_qb' => $courses_from_qb,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month\n ]);\n }\n }", "public function index()\n {\n return Revenue::latest()->paginate(10);\n }", "function list_revenue_type() \n\t\t{\n\t\t\t\n\t\t\t$this->db->order_by('revenue_type_value','ASC');\n\t\t\t\n\t\t\t$query\t\t\t\t\t=\t\t$this->db->get($this->table_name);\n\t\t\t\n\t\t\treturn $query->result();\n\t\t\t\n\t\t}", "public function fetchCostData()\n {\n $finance_pid = $this->getSystemSetting('em-finance-pid');\n\n if (!isset($finance_pid))\n throw new \\Exception('Error: no finance Project ID has been passed');\n\n $custom_field = $this->fetchCustomField();\n\n $fields = array(\n 'module_name',\n 'stanford_module',\n 'module_description',\n 'actual_monthly_cost',\n 'maintenance_fee',\n $custom_field ?? ''\n );\n $params = array('project_id' => $finance_pid, 'return_format' => 'json', 'fields' => $fields, 'events' => 'modules_arm_1', 'filterLogic' => '[actual_monthly_cost] != 0');\n $result = json_decode(\\REDCap::getData($params), true);\n\n if ($result && array_key_exists($custom_field, $result[0]))\n return $this->transformMap($result); //Fetch task record\n else\n throw new \\Exception(\"No field by the name of $custom_field found\");\n }", "public function reports_revenue(Request $request){\n // $reports_salary = DB::table('reservation_details')->orderBy('id','desc')->paginate();\n return view('admin.reports.reports_revenue');\n }", "public function index()\n {\n return \\response()->json(collect(Revenue::latest()->paginate(15)));\n }", "public function revenues()\n {\n return $this->hasMany('App\\revenue','store_id');\n }", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function retrieveRevenueAverage()\n {\n $query = \"SELECT AVG(revenue) AS avgRevenue FROM (SELECT CONCAT(YEAR(date), '/', MONTH(date)) AS theMonth, SUM(exlAmount) AS revenue FROM payment GROUP BY theMonth ORDER BY YEAR(DATE) ASC, MONTH(date) ASC) AS T1;\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "function total_video_revenue() {\n return PayPerView::sum('amount');\n}", "public function getSummaryData();", "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function getDataByID($strDataID)\n{\n global $db;\n $tbl = new cGaConsumablePurchase();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrTemp = getEmployeeInfoByID($db, $dataEdit[$strDataID]['id_employee'], \"employee_id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id_item'];\n $arrResult['dataRequestDate'] = $dataEdit[$strDataID]['request_date'];\n $arrResult['dataItemAmount'] = $dataEdit[$strDataID]['item_amount'];\n $arrResult['dataRemark'] = $dataEdit[$strDataID]['remark'];\n $arrResult['dataConsPurchaseNo'] = $dataEdit[$strDataID]['consumable_purchase_no'];\n $arrResult['dataConsReqNo'] = $dataEdit[$strDataID]['id_consumable_request'];\n //foreach($arrTripCost[$dataDonation ['trip_type']\n return $arrResult;\n}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function getResturantDetails(){\n // $endPrice = $this->_request['endPrice'] != \"undefined\" ? intval ($this->_request['endPrice']) : -1;\n \n $sql = \"select * from resturants r join city c on r.CityId = c.CityID\";\n // if($startPrice!=\"undefined\")\n // {\n // $sql.=\" where r.start_price>=$startPrice \";\n // if($endPrice != -1 )\n // $sql.=\" and r.end_price<=$endPrice\";\n // }\n $rows = $this->executeGenericDQLQuery($sql);\n $resturantDetails = array();\n for($i=0;$i<sizeof($rows);$i++)\n {\n\n\n $resturantDetails[$i]['Name'] =($rows[$i]['Name'] == null || $rows[$i]['Name'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Name'] ;\n $resturantDetails[$i]['Address'] =($rows[$i]['Address'] == null || $rows[$i]['Address'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Address'] ;\n $resturantDetails[$i]['content'] =($rows[$i]['content'] == null || $rows[$i]['content'] ==\"null\") ? \"No Data Available\" : $rows[$i]['content'] ;\n $resturantDetails[$i]['Phone1'] =($rows[$i]['Phone1'] == null || $rows[$i]['Phone1'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone1'] ;\n $resturantDetails[$i]['Phone2'] =($rows[$i]['Phone2'] == null || $rows[$i]['Phone2'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone2'] ;\n $resturantDetails[$i]['Phone3'] =($rows[$i]['Phone3'] == null || $rows[$i]['Phone3'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone3'] ;\n $resturantDetails[$i]['Mobile'] =($rows[$i]['Mobile'] == null || $rows[$i]['Mobile'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Mobile'] ;\n $resturantDetails[$i]['Website'] =($rows[$i]['Website'] == null || $rows[$i]['Website'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Website'] ;\n $resturantDetails[$i]['Category'] =($rows[$i]['Category'] == null) ? 0 : $rows[$i]['Category'] ;\n $resturantDetails[$i]['Facilities'] =$this->getFacilitiesByIds($rows[$i]['Facilities']);\n $resturantDetails[$i]['CityId'] =$rows[$i]['CityId'] ;\n $resturantDetails[$i]['stdCode'] =$rows[$i]['STDCode'] ;\n $resturantDetails[$i]['icon_image'] =($rows[$i]['icon_image'] == null || $rows[$i]['icon_image'] ==\"null\") ? \"img/not_found.jpg\" : $rows[$i]['icon_image'] ;\n $resturantDetails[$i]['home_image'] =($rows[$i]['home_image'] == null || $rows[$i]['home_image'] ==\"null\") ? \"img/not_found.jpg\" : $rows[$i]['home_image'] ;\n \n \n }\n $this->response($this->json($resturantDetails), 200);\n\n }", "public function index()\n {\n $revenues = Revenue::with(['account', 'customer', 'category'])->collect();\n\n return $this->response->paginator($revenues, new Transformer());\n }", "public function getCashReceipt($txn_ref){\n\n $remits = Remittance::where('transaction_reference',$txn_ref)->first();\n $data =[];\n\n if($remits ){\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n $year = substr($remits->month, 0,4);\n $month = substr($remits->month, 5,2);\n $BS = Revenue::select('revenues.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','revenues.invoice','revenues.amount','revenues.created_at as date')\n ->join('users','users.userable_id','revenues.agent_id')\n ->join('services','services.id','revenues.service_id')\n ->join('revenue_points','revenue_points.id','revenues.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('revenues.created_at', '=', $year)\n ->whereMonth('revenues.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n //->where([[DB::raw('date(revenues.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]] )\n ->get();\n\n\n $QP = QuickPrintInvoice::select('quick_print_invoices.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','quick_print_invoices.invoice','quick_print_invoices.amount','quick_print_invoices.created_at as date')\n ->join('users','users.userable_id','quick_print_invoices.agent_id')\n ->join('services','services.id','quick_print_invoices.service_id')\n ->join('revenue_points','revenue_points.id','quick_print_invoices.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('quick_print_invoices.created_at', '=', $year)\n ->whereMonth('quick_print_invoices.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n\n // ->where([[DB::raw('date(quick_print_invoices.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]])\n\n ->get();\n\n\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n if(!empty($invoiceIds)){\n extract($invoiceIds);\n\n $i=0;\n foreach($BS as $bs){\n\n foreach ($b as $id){\n if($bs['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $bs['agentName'];\n $data[$i]['serviceName'] = $bs['serviceName'];\n $data[$i]['lgaName'] = $bs['lgaName'];\n $data[$i]['revPtName'] = $bs['revPtName'];\n $data[$i]['amount'] = $bs['amount'];\n $data[$i]['invoice'] = $bs['invoice'];\n $data[$i]['date'] = $bs['date'];\n $i++;\n }\n }\n }\n\n foreach($QP as $qp){\n\n foreach ($q as $id){\n if($qp['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $qp['agentName'];\n $data[$i]['serviceName'] = $qp['serviceName'];\n $data[$i]['lgaName'] = $qp['lgaName'];\n $data[$i]['revPtName'] = $qp['revPtName'];\n $data[$i]['amount'] = $qp['amount'];\n $data[$i]['invoice'] = $qp['invoice'];\n $data[$i]['date'] = $qp['date'];\n $i++;\n }\n }\n }\n\n }\n\n\n\n }\n\n\n\n\n return response()->json(['status' => 'success',\n 'data' => $data\n ]);\n\n }", "public function get_total_platform_revenue(): void\n {\n $trackingService = new TrackingService();\n create(Customer::class);\n create(Conversion::class, ['platform' => 'trivago', 'revenue' => 10]);\n create(Conversion::class, ['platform' => 'trivago', 'revenue' => 25]);\n $result = $trackingService->getPlatformRevenue('trivago');\n $this->assertEquals($result, 35);\n }", "function getDashboardData() {\n $arrRes=array();\n \n //For Calculating orders count\n $arrClms = 'pkOrderItemID';\n $varTable = TABLE_ORDER_ITEMS;\n $argWhere = 'AND Status <> \"Canceled\"';\n $arrNum = $this->getNumRows($varTable, $arrClms, $argWhere);\n $arrRes['ordersCount']=$arrNum;\n \n //For Calculating Unique visitors count\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR;\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['visitorsCount']=$arrData;\n \n \n //For Calculating Total Revenue(from orders) sum\n $varQuery = \"SELECT pkOrderItemID,ItemType,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled'\";\n $arrData = $this->getArrayResult($varQuery);\n $sum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n }\n //echo $sum;\n \n //pre($arrData);\n $arrRes['revenueSum']=$sum;\n \n //pre($arrRes);\n return $arrRes;\n }", "public function get_revenue_history( $args = array() ) {\n $default_args = array(\n 'group_by' => 'currency_id',\n 'order' => 'ASC',\n 'fields' => array(\n 'currency_id',\n 'SUM(price) AS amount',\n 'COUNT(*) AS quantity',\n 'DATE(date) AS date',\n 'DAY(date) AS day',\n 'MONTH(date) AS month',\n 'HOUR(date) AS hour',\n ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_results( $args );\n }", "public function getPraposalFinsummary( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $loan = null;\n $loanType = null;\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n\n\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $test = Cashflow::where('loan_id', '=', $loanId)->get();\n $fromCashflowTable = Cashflow::periodsCashflowIdMap($loanId);\n //echo $existingPeriodsCashsasflowIdMap[76]->value;\n /* echo \"<pre>\";\n print_r($fromCashflowTable['FY 2017-18(Prov)'][79]->value);\n echo \"</pre>\";*/\n\n \n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._finsummary';\n $formaction = 'Loans\\LoansController@postPraposalFinsummary';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'formaction',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'fromCashflowTable',\n 'validLoanHelper',\n 'userProfileFirm',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'financialDataRecords'\n ));\n }", "private function getStatistik() {\n $SHOW_DAYS = 365;\n self::$today = new DateTime();\n $resultHtml = \"\";\n\n // Jetzt Berechnungen pro Budget:\n $budgets = Persistence::getInstances(\"BUD\", \"name\", false);\n $werte = array();\n $jahre = array();\n $budgetNames = array();\n $budgetAmount = array();\n foreach ($budgets as $budget) {\n $budgetName = $budget->getProperty(\"name\", \"unbekannt\");\n $budgetNames[\"\" . $budgetName] = \"$budgetName\";\n $budgetZeitraum = $budget->getProperty(\"zeitraum\", \"\") == \"\" ? \"\" : \" \" . $budget->getProperty(\"zeitraum\", \"\");\n $budgetAmount[\"\" . $budgetName] = $budget->getProperty(\"btotal\", \"\") . $budgetZeitraum;\n if (!isset($werte[\"$budgetName\"])) {\n $werte[\"$budgetName\"] = array();\n }\n $instances = Persistence::getInstances(\"ARB\", \"datum\", false, $budget->getId(), true);\n $resultData = array();\n foreach ($instances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n $kaz = $instance->getProperty(ARB::PROPERTY_KAZ, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= \"2017\") {\n $jahre[\"\" . $jahr] = \"\" . \"$jahr\";\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] = 0;\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"] = array();\n }\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] = 0;\n }\n $wert = $kaz != \"\" && $h != \"\" ? ($kaz > $h ? $kaz : $h) : ($kaz != \"\" ? $kaz : ($h != \"\" ? $h : 0));\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] += $wert;\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] += $wert;\n }\n }\n }\n ksort($jahre);\n $monatWerte = array();\n $jahresWerte = array();\n foreach ($budgetNames as $budgetName) {\n $budgetWert[$budgetName] = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][$jahr . \"\"][\"\" . $monat] = 0;\n }\n }\n $jahresWerte[$budgetName][$jahr . \"\"] = 0;\n }\n }\n foreach ($werte as $budgetName => $jahrWerte) {\n foreach ($jahrWerte as $jahr => $jahrUndMonatWerte) {\n $jahresWerte[$budgetName][$jahr . \"\"] = $jahrUndMonatWerte[\"Jahr\"];\n foreach ($jahrUndMonatWerte[\"monate\"] as $monat => $wert) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][\"\" . $jahr][\"\" . $monat] = $wert;\n }\n }\n }\n }\n\n // Summen über alle ARB Instanzen berechnen (Budget unabhaengig, da ARB Instanzen\n // mehreren Budgets gleichzeitig zugeordnet sein koennen\n $monatSumme = array();\n $jahrSumme = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n $monatSumme[\"$jahr-$monat\"] = 0;\n }\n $jahrSumme[\"$jahr\"] = 0;\n }\n $arbInstances = Persistence::getInstances(\"ARB\", \"datum\", false, \"\", true);\n foreach ($arbInstances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= 2017 && is_numeric($h)) {\n $jahrSumme[\"$jahr\"] += $h;\n $monatSumme[\"$jahr-$monat\"] += $h;\n }\n }\n\n // Darstellung:\n $table = \"<table>\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $table .= \"<tr><td>Budget</td><td style='width: 90px;'>Max</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n $table .= \"<td>\" . $monat . \"/\" . ($jahr - 2000) . \"</td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n $table .= \"<td>$jahr</td>\";\n }\n break;\n }\n $table .= \"</tr>\";\n\n $trclass = \"odd\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $trclass = $trclass == \"odd\" ? \"even\" : \"odd\";\n $strong = \"\";\n foreach (array(\"#022\", \"#028\", \"#030\", \"#034\", \"#039\", \"400059\", \"412622\") as $s) {\n if (strpos($budgetName, $s) !== false) {\n $strong = \"strong\";\n }\n }\n $tr = \"<tr class='$trclass $strong'><td><span title='$budgetName'><span style='padding-right: 20px;'>\" . substr($budgetName, 0, 80) . \"</span></td>\";\n $tr .= \"<td>\" . $budgetAmount[\"\" . $budgetName] . \"</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozentm= (stripos($budgetName, \"unproduktiv\") !== false && $monatSumme[\"$jahr-$monat\"] > 0) ? round(($wert / $monatSumme[\"$jahr-$monat\"]) * 100, 0) . \"%\" : \"\";\n $title = \"$prozentm = $wert/\" . $monatSumme[\"$jahr-$monat\"] . \" h @ \";\n $title .= \"$jahr-$monat: $budgetName\";\n $tr .= \"<td title='$title' style='width: 60px;'>$wert<br><strong>$prozentm</strong></td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozent = $jahrSumme[\"$jahr\"] > 0 ? round((($wert / $jahrSumme[\"$jahr\"]) * 100), 1) . \"%\" : \"\";\n $title = (stripos($budgetName, \"unproduktiv\") !== false ? \"$prozent = $wert/\" . $jahrSumme[\"$jahr\"] . \" h\" : \"\");\n $text = $title == \"\" ? \"\" : \"<br><strong>$prozent</strong>\";\n $tr .= \"<td title='$title' style='width: 80px;'>$wert$text</td>\";\n }\n $tr .= \"</tr>\";\n $table .= \"$tr\";\n }\n $table .= \"</table>\";\n\n return \"$table\";\n }", "function getPurchaseProductionInfo($id_purchase,$id_purchase_production) {\n $data = $this->db\n ->where('id_purchase',$id_purchase)\n ->where('id_purchase_production',$id_purchase_production)\n ->limit(1)\n ->get('purchase_production')\n ->row_array();\n \n return $data;\n }", "public function show($id)\n {\n return response()->json(Revenue::findOrFail($id));\n }", "public function Individualgetdata();", "public function index()\n {\n $user = Auth::user();\n $user->authorizeRoles(['College Admin', 'College Super Admin']);\n $institution = $user->institution();\n $collegeName = $user->collegeName;\n\n $revenues = array();\n /** @var College $college */\n foreach ($institution->colleges as $college)\n if ($college->collegeName->id == $collegeName->id)\n foreach ($college->internalRevenues as $internalRevenue)\n $revenues[] = $internalRevenue;\n\n $data = array(\n 'internal_revenues' => $revenues,\n 'page_name' => 'budgets.internal-revenue.index'\n );\n return view('budgets.internal_revenue.index')->with($data);\n }", "public function getReimbursementData()\n {\n return $this->db->get(\"reimburse_details\")->result_array();\n }", "public function get() {\n $this->data = array(\n 101222 => array('label' => 'Awesome product', 'price' => 10.50, 'date_added' => '2012-02-01'),\n 101232 => array('label' => 'Not so awesome product', 'price' => 5.20, 'date_added' => '2012-03-20'),\n 101241 => array('label' => 'Pretty neat product', 'price' => 9.65, 'date_added' => '2012-04-15'),\n 101256 => array('label' => 'Freakishly cool product', 'price' => 12.55, 'date_added' => '2012-01-11'),\n 101219 => array('label' => 'Meh product', 'price' => 3.69, 'date_added' => '2012-06-11'),\n );\n }", "public function get() {\n\t\t$this->data = array(\n\t\t\t101222 => array('label' => 'Awesome product', 'price' => 10.50, 'date_added' => '2012-02-01'),\n\t\t\t101232 => array('label' => 'Not so awesome product', 'price' => 5.20, 'date_added' => '2012-03-20'),\n\t\t\t101241 => array('label' => 'Pretty neat product', 'price' => 9.65, 'date_added' => '2012-04-15'),\n\t\t\t101256 => array('label' => 'Freakishly cool product', 'price' => 12.55, 'date_added' => '2012-01-11'),\n\t\t\t101219 => array('label' => 'Meh product', 'price' => 3.69, 'date_added' => '2012-06-11'),\n\t\t);\n\t}", "public function run()\n\t{\n\t\t$produtos = collect([\n\t\t\t[\n\t\t\t\t'isbn' => '9788547000646',\n\t\t\t\t'nome' => 'Minha História',\n\t\t\t\t'autor' => 'Michelle Obama',\n\t\t\t\t'sinopse' => 'Um relato íntimo, poderoso e inspirador da ex-primeira-dama dos Estados Unidos. O livro que já vendeu mais de 10 milhões de exemplares no mundo e está há mais de 50 semanas na lista de mais vendidos da Veja. Com uma vida repleta de realizações significativas, Michelle Obama se consolidou como uma das mulheres mais icônicas e cativantes de nosso tempo. Como primeira-dama dos Estados Unidos — a primeira afro-americana a ocupar essa posição —, ela ajudou a criar a mais acolhedora e inclusiva Casa Branca da história. Ao mesmo tempo, se posicionou como uma poderosa porta-voz das mulheres e meninas nos Estados Unidos e ao redor do mundo, mudando drasticamente a forma como as famílias levam suas vidas em busca de um modelo mais saudável e ativo, e se posicionando ao lado de seu marido durante os anos em que Obama presidiu os Estados Unidos em alguns dos momentos mais angustiantes da história do país. Ao longo do caminho, ela nos ensinou alguns passos de dança, arrasou no Carpool Karaoke e criou duas filhas responsáveis e centradas, apesar do impiedoso olhar da mídia.Em suas memórias, um trabalho de profunda reflexão e com uma narrativa envolvente, Michelle Obama convida os leitores a conhecer seu mundo, recontando as experiências que a moldaram — da infância na região de South Side, em Chicago, e os seus anos como executiva tentando equilibrar as demandas da maternidade e do trabalho, ao período em que passou no endereço mais famoso do mundo. Com honestidade e uma inteligência aguçada, ela descreve seus triunfos e suas decepções, tanto públicas quanto privadas, e conta toda a sua história, conforme a viveu — em suas próprias palavras e em seus próprios termos. Reconfortante, sábio e revelador, Minha história traz um relato íntimo e singular, de uma mulher com alma e consistência que desafiou constantemente as expectativas — e cuja história nos inspira a fazer o mesmo.',\n\t\t\t\t'id_categoria' => 'Biografia',\n\t\t\t\t'numero_paginas' => '464',\n\t\t\t\t'ano_publicacao' => '2018',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Objetiva',\n\t\t\t\t'preco' => '50,32',\n\t\t\t\t'imagem' => '../img/livros/9788547000646.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788535923438',\n\t\t\t\t'nome' => 'Eu sou Malala',\n\t\t\t\t'autor' => 'Malala Yousafzai',\n\t\t\t\t'sinopse' => 'Quando o Talibã tomou controle do vale do Swat, uma menina levantou a voz. Malala Yousafzai recusou-se a permanecer em silêncio e lutou pelo seu direito à educação. Mas em 9 de outubro de 2012, uma terça-feira, ela quase pagou o preço com a vida. Malala foi atingida na cabeça por um tiro à queima-roupa dentro do ônibus no qual voltava da escola. Poucos acreditaram que ela sobreviveria. Mas a recuperação milagrosa de Malala a levou em uma viagem extraordinária de um vale remoto no norte do Paquistão para as salas das Nações Unidas em Nova York. Aos dezesseis anos, ela se tornou um símbolo global de protesto pacífico e a candidata mais jovem da história a receber o Prêmio Nobel da Paz. Eu sou Malala é a história de uma família exilada pelo terrorismo global, da luta pelo direito à educação feminina e dos obstáculos à valorização da mulher em uma sociedade que valoriza filhos homens. O livro acompanha a infância da garota no Paquistão, os primeiros anos de vida escolar, as asperezas da vida numa região marcada pela desigualdade social, as belezas do deserto e as trevas da vida sob o Talibã. Escrito em parceria com a jornalista britânica Christina Lamb, este livro é uma janela para a singularidade poderosa de uma menina cheia de brio e talento, mas também para um universo religioso e cultural cheio de interdições e particularidades, muitas vezes incompreendido pelo Ocidente.',\n\t\t\t\t'id_categoria' => 'Biografia',\n\t\t\t\t'numero_paginas' => '360',\n\t\t\t\t'ano_publicacao' => '2013',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Companhia Das Letras',\n\t\t\t\t'preco' => '44,90',\n\t\t\t\t'imagem' => '../img/livros/9788535923438.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788576082675',\n\t\t\t\t'nome' => 'Código Limpo: Habilidades Práticas do Agile Software',\n\t\t\t\t'autor' => 'Robert C. Martin',\n\t\t\t\t'sinopse' => 'O renomado especialista em software, Robert C. Martin, apresenta um paradigma revolucionário com Código limpo: Habilidades Práticas do Agile Software. Martin se reuniu com seus colegas do Mentor Object para destilar suas melhores e mais ágeis práticas de limpar códigos “dinamicamente” em um livro que introduzirá gradualmente dentro de você os valores da habilidade de um profissional de softwares e lhe tornar um programador melhor –mas só se você praticar.',\n\t\t\t\t'id_categoria' => 'Informática',\n\t\t\t\t'numero_paginas' => '456',\n\t\t\t\t'ano_publicacao' => '2009',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Alta Books',\n\t\t\t\t'preco' => '96,90',\n\t\t\t\t'imagem' => '../img/livros/9788576082675.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788550800653',\n\t\t\t\t'nome' => 'Domain-Driven Design: Atacando as Complexidades no Coração do Software',\n\t\t\t\t'autor' => 'Eric Evans',\n\t\t\t\t'sinopse' => 'Reunindo práticas de design e implementação, este livro incorpora vários exemplos baseados em projetos que ilustram a aplicação do design dirigido por domínios no desenvolvimento de softwares na vida real.',\n\t\t\t\t'id_categoria' => 'Informática',\n\t\t\t\t'numero_paginas' => '528',\n\t\t\t\t'ano_publicacao' => '2016',\n\t\t\t\t'edicao' => '3',\n\t\t\t\t'editora' => 'Alta Books',\n\t\t\t\t'preco' => '63,00',\n\t\t\t\t'imagem' => '../img/livros/9788550800653.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788584424573',\n\t\t\t\t'nome' => 'Drácula - Edição De Luxo',\n\t\t\t\t'autor' => 'Bram Stoker',\n\t\t\t\t'sinopse' => 'Bram Stoker é o criador genial de uma das mais famosas e horripilantes histórias de terror de todos os tempos. Drácula é uma história de vampiros e lobisomens, de criaturas que estando mortas permanecem vivas. Baseado no folclore da Transilvânia e num personagem real (o rei Vlad, o Empalador), redigiu um relato que tem assombrado gerações consecutivas de leitores, transformando-se num mito adaptado para o cinema, quadrinhos e TV, talvez o mais significativo destes últimos dois séculos. Na história, um jovem inglês é mantido em cativeiro, à espera de um destino terrível. Longe dele, sua noiva bela e jovem é atacada por uma doença misteriosa que parece extrair o sangue de suas veias. Por trás de tudo, a força sinistra que ameaça suas vidas: Conde Drácula, o vampiro vindo do fundo dos séculos.',\n\t\t\t\t'id_categoria' => 'Literatura Estrangeira',\n\t\t\t\t'numero_paginas' => '432',\n\t\t\t\t'ano_publicacao' => '2019',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Pandorga',\n\t\t\t\t'preco' => '59,90',\n\t\t\t\t'imagem' => '../img/livros/9788584424573.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788594318237',\n\t\t\t\t'nome' => 'O Morro Dos Ventos Uivantes',\n\t\t\t\t'autor' => 'Emily Brontë',\n\t\t\t\t'sinopse' => 'Único romance da escritora inglesa Emily Bronte, O morro dos ventos uivantes retrata uma trágica historia de amor e obsessão em que os personagens principais são a obstinada e geniosa Catherine Earnshaw e seu irmão adotivo, Heathcliff. Grosseiro, humilhado e rejeitado, ele guarda apenas rancor no coração, mas tem com Catherine um relaciona- mento marcado por amor e, ao mesmo tempo, ódio. Essa ligação perdura mesmo com o casamento de Catherine com Edgar Linton.',\n\t\t\t\t'id_categoria' => 'Literatura Estrangeira',\n\t\t\t\t'numero_paginas' => '368',\n\t\t\t\t'ano_publicacao' => '2019',\n\t\t\t\t'edicao' => '2',\n\t\t\t\t'editora' => 'Principis',\n\t\t\t\t'preco' => '19,90',\n\t\t\t\t'imagem' => '../img/livros/9788594318237.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788525056009',\n\t\t\t\t'nome' => 'Admirável Mundo Novo',\n\t\t\t\t'autor' => 'Aldous Huxley',\n\t\t\t\t'sinopse' => 'Uma sociedade inteiramente organizada segundo princípios científicos, na qual a mera menção das antiquadas palavras “pai” e “mãe” produzem repugnância. Um mundo de pessoas programadas em laboratório, e adestradas para cumprir seu papel numa sociedade de castas biologicamente definidas já no nascimento. Um mundo no qual a literatura, a música e o cinema só têm a função de solidificar o espírito de conformismo. Um universo que louva o avanço da técnica, a linha de montagem, a produção em série, a uniformidade, e que idolatra Henry Ford. Essa é a visão desenvolvida no clarividente romance distópico de Aldous Huxley, que ao lado de 1984, de George Orwell, constituem os exemplos mais marcantes, na esfera literária, da tematização de estados autoritários. Se o livro de Orwell criticava acidamente os governos totalitários de esquerda e de direita, o terror do stalinismo e a barbárie do nazifascismo, em Huxley o objeto é a sociedade capitalista, industrial e tecnológica, em que a racionalidade se tornou a nova religião, em que a ciência é o novo ídolo, um mundo no qual a experiência do sujeito não parece mais fazer nenhum sentido, e no qual a obra de Shakespeare adquire tons revolucionários. Entretanto, o moderno clássico de Huxley não é um mero exercício de futurismo ou de ficção científica. Trata-se, o que é mais grave, de um olhar agudo acerca das potencialidades autoritárias do próprio mundo em que vivemos.',\n\t\t\t\t'id_categoria' => 'Literatura Estrangeira',\n\t\t\t\t'numero_paginas' => '312',\n\t\t\t\t'ano_publicacao' => '2014',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Biblioteca Azul',\n\t\t\t\t'preco' => '44,90',\n\t\t\t\t'imagem' => '../img/livros/9788525056009.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788532508126',\n\t\t\t\t'nome' => 'A Hora da Estrela',\n\t\t\t\t'autor' => 'Clarice Lispector',\n\t\t\t\t'sinopse' => 'Entre a realidade e o delírio, buscando o social enquanto sua alma a engolfava, Clarice escreveu um livro singular. \"A Hora da Estrela\" é um romance sobre o desamparo a que, apesar da linguagem, todos estamos entregues.',\n\t\t\t\t'id_categoria' => 'Literatura Nacional',\n\t\t\t\t'numero_paginas' => '88',\n\t\t\t\t'ano_publicacao' => '1998',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Rocco',\n\t\t\t\t'preco' => '19,90',\n\t\t\t\t'imagem' => '../img/livros/9788532508126.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788520927823',\n\t\t\t\t'nome' => 'O Cortiço',\n\t\t\t\t'autor' => 'Aluísio de Azevedo',\n\t\t\t\t'sinopse' => 'Publicado em 1890, é considerado uma obra-prima do Naturalismo brasileiro. Apesar da influência notável de Émile Zola, o vigor e a originalidade da narrativa que abordou os problemas sociais de fins do século XIX, possuindo como “cenário” principal um cortiço, são perceptíveis. Pintor de variada galeria de tipos e da representação do cotidiano, Aluísio Azevedo ficou conhecido por seu traço forte e principalmente por personificar a fase naturalista brasileira.',\n\t\t\t\t'id_categoria' => 'Literatura Nacional',\n\t\t\t\t'numero_paginas' => '272',\n\t\t\t\t'ano_publicacao' => '2016',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Nova Fronteira',\n\t\t\t\t'preco' => '19,90',\n\t\t\t\t'imagem' => '../img/livros/9788520927823.jpg'\n\t\t\t],\n\t\t]);\n\n\n\t\t$produtos->map(function ($item) {\n\t\t\t$novoProduto = new Produto();\n\t\t\t$novoProduto->isbn = $item['isbn'];\n\t\t\t$novoProduto->nome = $item['nome'];\n\t\t\t$novoProduto->autor = $item['autor'];\n\t\t\t$novoProduto->sinopse = $item['sinopse'];\n\t\t\t$novoProduto->id_categoria = DB::table('produto_categoria')->where('nome_categoria', $item['id_categoria'])->value('id_categoria');\n\t\t\t$novoProduto->numero_paginas = $item['numero_paginas'];\n\t\t\t$novoProduto->ano_publicacao = $item['ano_publicacao'];\n\t\t\t$novoProduto->edicao = $item['edicao'];\n\t\t\t$novoProduto->editora = $item['editora'];\n\t\t\t$novoProduto->preco = $item['preco'];\n\t\t\t$novoProduto->imagem = $item['imagem'];\n\t\t\t$novoProduto->save();\n\t\t});\n\t}", "public function getMultipleData()\n\t{\n\t\t$calculatedData = $this->getCalculatedData();\n\t\t$items = [];\n\t\t$amountDealCurrencyId = \\CCrmCurrency::GetAccountCurrencyID();\n\n\t\t$config = [\n\t\t\t'title' => $this->getFormElement('label')->getValue()\n\t\t];\n\n\t\tif (!empty($calculatedData))\n\t\t{\n\t\t\t$calculateField = $this->getFormElement('calculate');\n\t\t\t$calculateValue = $calculateField ? $calculateField->getValue() : null;\n\n\t\t\t$shortModeField = $this->getFormElement('shortMode');\n\t\t\t$shortModeValue = $shortModeField ? $shortModeField->getValue() : false;\n\n\t\t\tswitch ($calculateValue)\n\t\t\t{\n\t\t\t\tcase self::WHAT_WILL_CALCULATE_DEAL_CONVERSION:\n\t\t\t\t\t$config['mode'] = 'singleData';\n\t\t\t\t\t$config['unitOfMeasurement'] = '%';\n\t\t\t\t\t$item['value'] = round($calculatedData['withoutGrouping'], 2);\n\t\t\t\t\t$item['color'] = '#9DCF00';\n\t\t\t\t\t$items[] = $item;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$itemCount = 0;\n\t\t\t\t\tforeach ($calculatedData as $key => $data)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ($key === 'amount') //TODO: optimise calculating of amount values\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$item = [\n\t\t\t\t\t\t\t'label' => $data['title'],\n\t\t\t\t\t\t\t'value' => $data['value'],\n\t\t\t\t\t\t\t'color' => $data['color']\n\t\t\t\t\t\t];\n\n\n\n\t\t\t\t\t\tif ($calculateValue === self::WHAT_WILL_CALCULATE_DEAL_DATA_FOR_FUNNEL\n\t\t\t\t\t\t\t|| $calculateValue === self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->isConversionCalculateMode())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$item['link'] = $this->getTargetUrl('/crm/deal/analytics/list/', [\n\t\t\t\t\t\t\t\t\t'STAGE_ID_FROM_SUPPOSED_HISTORY' => $key\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$item['link'] = $this->getTargetUrl('/crm/deal/analytics/list/', [\n\t\t\t\t\t\t\t\t\t'STAGE_ID_FROM_HISTORY' => $key\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$config['additionalValues']['firstAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_COUNT_SHORT_TITLE'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$item['additionalValues']['firstAdditionalValue'] = [\n\t\t\t\t\t\t\t'value' => $data['value']\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (isset($data['additionalValues']['sum']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$amountDealCurrencyId = $data['additionalValues']['sum']['currencyId'];\n\t\t\t\t\t\t\t$config['additionalValues']['secondAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_SUM_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$item['additionalValues']['secondAdditionalValue'] = [\n\t\t\t\t\t\t\t\t'value' => \\CCrmCurrency::MoneyToString(\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['sum']['VALUE'],\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['sum']['currencyId']\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'currencyId' => $data['additionalValues']['sum']['currencyId']\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($data['additionalValues']['avgSpentTime']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$config['additionalValues']['thirdAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_SPENT_TIME_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$item['additionalValues']['thirdAdditionalValue'] = [\n\t\t\t\t\t\t\t\t'value' => $this->getFormattedPassTime(\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['avgSpentTime']['VALUE']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$stageSemanticId = \\CCrmDeal::GetSemanticID($key);\n\t\t\t\t\t\t$config['additionalValues']['forthAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$item['additionalValues']['forthAdditionalValue'] = [\n\t\t\t\t\t\t\t'title' => PhaseSemantics::isLost($stageSemanticId) ?\n\t\t\t\t\t\t\t\t\t\t\tLoc::getMessage(\"CRM_REPORT_DEAL_HANDLER_DEAL_LOSSES_SHORT_TITLE\")\n\t\t\t\t\t\t\t\t\t\t\t: Loc::getMessage(\"CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE\"),\n\t\t\t\t\t\t\t'value' => $calculatedData['amount']['value'] ? round(\n\t\t\t\t\t\t\t\t($data['value'] / $calculatedData['amount']['value']) * 100,\n\t\t\t\t\t\t\t\t2\n\t\t\t\t\t\t\t) : 0,\n\t\t\t\t\t\t\t'unitOfMeasurement' => '%',\n\t\t\t\t\t\t\t'helpLink' => 'someLink',\n\t\t\t\t\t\t\t'helpInSlider' => true\n\t\t\t\t\t\t];\n\t\t\t\t\t\t//hidden conversion on first column\n\t\t\t\t\t\tif ($calculateValue !== self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL && $itemCount < 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($item['additionalValues']['forthAdditionalValue']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$itemCount++;\n\n\n\n\t\t\t\t\t\t$items[] = $item;\n\t\t\t\t\t}\n\n\t\t\t\t\t$calculateField = $this->getFormElement('calculate');\n\t\t\t\t\t$calculateValue = $calculateField ? $calculateField->getValue() : null;\n\n\t\t\t\t\t$config['titleShort'] = Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_COUNT_SHORT_TITLE');\n\n\t\t\t\t\t$config['valuesAmount'] = [\n\t\t\t\t\t\t'firstAdditionalAmount' => [\n\t\t\t\t\t\t\t'title' => Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_SUM_SHORT_TITLE'),\n\t\t\t\t\t\t\t'value' => \\CCrmCurrency::MoneyToString(\n\t\t\t\t\t\t\t\t$calculatedData['amount']['sum'],\n\t\t\t\t\t\t\t\t$amountDealCurrencyId\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'targetUrl' => $this->getTargetUrl('/crm/deal/analytics/list/'),\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\n\t\t\t\t\tif ($calculatedData['amount']['successPassTime'] ?? false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$config['valuesAmount']['secondAdditionalAmount'] = [\n\t\t\t\t\t\t\t'title' => Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_PASS_AVG_TIME_SHORT_TITLE'),\n\t\t\t\t\t\t\t'value' => $this->getFormattedPassTime($calculatedData['amount']['successPassTime'])\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ($calculateValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL:\n\t\t\t\t\t\t\t$config['topAdditionalTitle'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$config['topAdditionalValue'] = !empty($items[0]['additionalValues']['forthAdditionalValue']['value'])\n\t\t\t\t\t\t\t\t? $items[0]['additionalValues']['forthAdditionalValue']['value'] : 0;\n\t\t\t\t\t\t\t$config['topAdditionalValueUnit'] = '%';\n\t\t\t\t\t\t\t$config['valuesAmount']['firstAdditionalAmount']['value'] =\n\t\t\t\t\t\t\t\t($items[0]['additionalValues']['secondAdditionalValue']['value'] ?? null)\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t//$config['valuesAmount']['secondAdditionalAmount']['value'] =\n\t\t\t\t\t\t\t// $items[0]['additionalValues']['thirdAdditionalValue']['value']\n\t\t\t\t\t\t\t//;\n\n\t\t\t\t\t\t\tif ($shortModeValue)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$config['mode'] = 'singleData';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($config['valuesAmount']['thirdAdditionalAmount']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$result = [\n\t\t\t'items' => $items,\n\t\t\t'config' => $config,\n\t\t];\n\n\t\treturn $result;\n\t}", "function ledger($conn){\n $revenue=\"SELECT * FROM fees_details_summary\";\n $revenue=$conn->query($revenue);\n while ($r=$revenue->fetch_assoc()){\n\n echo \"\n <tr class='gradeX'> \n <td>\".$r['revenue'].\"</td>\n <td>\".$r['total'].\"</td>\n <td><a href='account.php?user=fees.income.details&data=\".$r['revenueID'].\"&sort=\".$r['revenue'].\"&error=0&alert=1' class='btn btn-mini btn-xs btn-danger'><span class='glyphicon glyphicon-trash'></span>View Details</a></a></tr>\n \";\n }\n}", "public function getRevenue()\n {\n $order = $this->checkoutSession->getLastRealOrder();\n\n return $order->getData('total_due');\n }", "public function getCurrentMonthTotalRevenue() : float;", "public function model(){\n\t\treturn CategoryRevenue::class;\n\t}", "private function _get_itemreport_customs_old($usr_profitview, $profitview, $start_date, $end_report, $brand) {\n\n $profit_type = $usr_profitview;\n $cust_scryears=$customs=$custom_keys=array();\n\n foreach ($profitview as $prow) {\n if ($prow['websys_page_link'] == 'itemsalescustoms') {\n $profit_type = $prow['profit_view'];\n }\n }\n $this->db->select(\"date_format(from_unixtime(o.order_date),'%Y') as repyear, date_format(from_unixtime(o.order_date),'%m') as repmonth\", FALSE);\n $this->db->select('count(o.order_id) as cnt_orders, sum(o.revenue) as revenue, sum(o.profit) as profit');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $start_date);\n $this->db->where('o.order_date < ', $end_report);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->group_by('repyear, repmonth');\n $this->db->order_by('repyear, repmonth');\n $custom_monthdat = $this->db->get()->result_array();\n foreach ($custom_monthdat as $row) {\n $profitval = floatval($row['profit']);\n $profitpnts = round($profitval * $this->config->item('profitpts'), 0);\n // 3 Special Users - Robert - 19, Sage -3, Sean - 1\n $startmonth = strtotime($row['repyear'] . '-' . $row['repmonth'] . '-01');\n $endmonth = strtotime(date(\"Y-m-d\", $startmonth) . \" +1 month\");\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 19);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $robres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 3);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $sageres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 1);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $seanres = $this->db->get()->row_array();\n $customs[] = array(\n 'year' => $row['repyear'],\n 'month' => $row['repmonth'],\n 'numorders' => intval($row['cnt_orders']),\n 'revenue' => floatval($row['revenue']),\n 'profit' => $profitval,\n 'profitpnts' => $profitpnts,\n 'rob' => $robres['cnt_orders'],\n 'sage' => $sageres['cnt_orders'],\n 'sean' => $seanres['cnt_orders'],\n );\n array_push($custom_keys, $row['repyear'] . '-' . $row['repmonth']);\n }\n $this->db->select(\"date_format(from_unixtime(o.order_date),'%Y') as repyear, date_format(from_unixtime(o.order_date),'%m') as repmonth\", FALSE);\n $this->db->select('count(o.order_id) as cnt_orders, sum(o.revenue) as revenue, sum(o.profit) as profit');\n $this->db->from('ts_orders o');\n $this->db->join(\"(select distinct(order_id) from ts_order_items where item_id={$this->config->item('custom_id')}) oi\", \"oi.order_id=o.order_id\");\n $this->db->where('o.item_id != ', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $start_date);\n $this->db->where('o.order_date < ', $end_report);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->group_by('repyear, repmonth');\n $this->db->order_by('repyear, repmonth');\n $custom_monthotherdat = $this->db->get()->result_array();\n\n foreach ($custom_monthotherdat as $row) {\n // 3 Special Users - Robert - 19, Sage -3, Sean - 1\n $startmonth = strtotime($row['repyear'] . '-' . $row['repmonth'] . '-01');\n $endmonth = strtotime(date(\"Y-m-d\", $startmonth) . \" +1 month\");\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 19);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $robres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 3);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $sageres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 1);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $seanres = $this->db->get()->row_array();\n $key = $row['repyear'] . '-' . $row['repmonth'];\n if (!in_array($key, $custom_keys)) {\n array_push($custom_keys, $key);\n $customs[] = array(\n 'year' => $row['repyear'],\n 'month' => $row['repmonth'],\n 'numorders' => intval($row['cnt_orders']),\n 'revenue' => floatval($row['revenue']),\n 'profit' => floatval($row['profit']),\n 'profitpnts' => round(floatval($row['profit']) * $this->config->item('profitpts'), 0),\n 'rob' => $robres['cnt_orders'],\n 'sage' => $sageres['cnt_orders'],\n 'sean' => $seanres['cnt_orders'],\n );\n } else {\n $cidx = 0;\n foreach ($customs as $crow) {\n if ($crow['month'] == $row['repmonth'] && $crow['year'] == $row['repyear']) {\n $customs[$cidx]['numorders'] += $row['cnt_orders'];\n $customs[$cidx]['revenue'] += $row['revenue'];\n $customs[$cidx]['profit'] += $row['profit'];\n $customs[$cidx]['profitpnts'] += round(floatval($row['profit']) * $this->config->item('profitpts'), 0);\n $customs[$cidx]['rob'] += $robres['cnt_orders'];\n $customs[$cidx]['sage'] += $sageres['cnt_orders'];\n $customs[$cidx]['sean'] += $seanres['cnt_orders'];\n } else {\n $cidx++;\n }\n }\n }\n }\n\n // Manage Customs\n for ($i = $this->salestype_start; $i < intval(date('Y')); $i++) {\n $total = array(\n 'numorders' => $this->empty_show,\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $this->empty_show,\n 'profitpnts' => $this->empty_show,\n 'revenue' => $this->empty_show,\n 'profit_view' => $profit_type,\n 'rob' => $this->empty_show,\n 'sage' => $this->empty_show,\n 'sean' => $this->empty_show,\n /* Values */\n 'numorders_val'=>0,\n 'profit_val' => 0,\n 'profitpnts_val' => 0,\n 'revenue_val' => 0,\n 'rob_val' => 0,\n 'sage_val' => 0,\n 'sean_val' => 0,\n /* Diff of values */\n 'numorders_diff'=>$this->empty_show,\n 'profit_diff' =>$this->empty_show,\n 'profitpnts_diff' => $this->empty_show,\n 'profit_percent_diff'=>$this->empty_show,\n 'revenue_diff' => $this->empty_show,\n 'rob_diff' => $this->empty_show,\n 'sage_diff' => $this->empty_show,\n 'sean_diff' => $this->empty_show,\n );\n $months = array();\n for ($j = 1; $j < 13; $j++) {\n $key = array_search($i . '-' . str_pad($j, 2, '0', STR_PAD_LEFT), $custom_keys);\n if ($key === FALSE) {\n $months[] = array(\n 'year' => $i,\n 'month' => $j,\n 'numorders' => $this->empty_show,\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $this->empty_show,\n 'profitpnts' => $this->empty_show,\n 'revenue' => $this->empty_show,\n 'profit_view' => $profit_type,\n 'rob' => $this->empty_show,\n 'sage' => $this->empty_show,\n 'sean' => $this->empty_show,\n 'prvrevenuediff'=>$this->empty_show,\n 'prvrevenueclass'=>'',\n 'prvrevenueprc'=>$this->empty_show,\n 'prvrevenueshow'=>0,\n );\n } else {\n // Get a previous revenue\n $nxtmnth=($j==12 ? 1 : $j+1);\n $nxtyear=($j==12 ? $i : $i-1);\n $prvyear=$i-1;\n $prvrevenue=0;\n $prvclass='';\n $outrevenue='';\n $outrevenueprc='';\n\n\n $months[] = array(\n 'year' => $i,\n 'month' => $j,\n 'numorders' => $customs[$key]['numorders'],\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $customs[$key]['profit'],\n 'profitpnts' => $customs[$key]['profitpnts'],\n 'revenue' => $customs[$key]['revenue'],\n 'profit_view' => $profit_type,\n 'rob' => $customs[$key]['rob'],\n 'sage' => $customs[$key]['sage'],\n 'sean' => $customs[$key]['sean'],\n );\n }\n }\n $cust_scryears[] = array(\n 'year' => $i,\n 'totals' => $total,\n 'months' => $months,\n 'profit_type' => $profit_type,\n );\n }\n // Rebuild Customs\n $cust_years = $this->_prepare_olddata($cust_scryears, 1);\n return $cust_years;\n }", "public function run()\n {\n //\n $commercialCompreheniveCost = [\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>4.50\n ],\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>5.75\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>7000000, \n 'rate'=>5.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>7000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>3\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>2.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>2000000, \n 'rate'=>7.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>2000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>6\n ],\n [\n 'commercial_class_id'=>5,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>6,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>7,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>8,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>12.5\n ],\n ];\n \n foreach($commercialCompreheniveCost as $key => $value){\n\n CommercialComprehensiveCost::create($value);\n\n }\n }", "protected function getData()\n {\n $occupancies = (new RoomOccupancyRepository)->withoutLabel(['tent', 'free'])->byNational($this->year);\n\n $spendings = (new BillRepository)->withoutResourceLabel(['tent', 'free'])->byMonthNational($this->year);\n\n foreach ($occupancies as $occupancy) {\n $this->occ_arr[$occupancy->country][$occupancy->mth] = $occupancy->counter;\n }\n\n foreach ($spendings as $spending) {\n $this->spend_arr[$spending->country][$spending->mth] = $spending->sum;\n }\n }", "function getFlavorsSalesFromDB()\n{\n\t$con = mysql_connect(\"localhost\", \"DBandGUI\", \"narwhal\");\n\n\tif(!$con) { die('Could not connect: ' . mysql_error()); }\n\n\tmysql_select_db(\"CustomCupcakes\", $con) or die('Could not select db: ' . mysql_error());\n\n\t$query = \"SELECT flavor_Name,purchase_Amount FROM CupcakeFlavor;\";\n\n\t$result = mysql_query($query);\n\n\t$finalArr = array();\n\n\t// This loop iterates over the results from the query and builds it into an array that will be returned later\n\twhile($row = mysql_fetch_array($result))\n\t{\n\t\t$finalArr[$row['flavor_Name']] = $row['purchase_Amount'];\n\t}\n\n\tmysql_close($con);\n\n\treturn $finalArr;\n}", "public function rankAffiliatesByRevenue()\n {\n $this->affiliates = DB::select(\"SELECT SUM(sale_amount) AS 'revenue', affiliate_id FROM \" . $this->source_table . \" GROUP BY (affiliate_id) ORDER BY sale_amount DESC LIMIT 1000;\");\n }", "public function getSubtotalInvoiced();", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function getPurchaseProduction($id_purchase) {\n $data = $this->db\n ->select(\"\n purchase_production.id_item,purchase_production.id_purchase_production,purchase_production.production_code,\n sum({$this->db->dbprefix('purchase_production')}.purchase_qty) as total_qty,\n item.item_name,item.item_code,item_category.item_category\n \")\n ->join('item','item.id_item=purchase_production.id_item','left')\n ->join('item_category','item_category.id_item_category=item.id_item_category','left')\n ->where('id_purchase',$id_purchase)\n ->order_by('item_category')\n ->group_by('purchase_production.id_purchase_production')\n ->get('purchase_production')\n ->result_array();\n \n return $data;\n }", "public function get_company_invoice_payment_recd() {\n $invoice = $this->input->post('invoice');\n $data = $this->classtraineemodel->company_invoice($invoice);\n $data->invoice_excess_amt = empty($data->invoice_excess_amt) ? 0 : $data->invoice_excess_amt;\n \n if ($data->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($data->company_id);\n $data->company_name = $tenant_details->tenant_name;\n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $data->company_id);\n $data->company_name = $company_details[0]->company_name;\n }\n $data->discount_label = rtrim($this->course->get_metadata_on_parameter_id($data->discount_type), ', ');\n $gst_label = ($data->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($data->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($data->gst_rule), ', ');\n }\n $data->gst_label = $gst_label;\n $data->inv_date = date('d/m/Y', strtotime($data->inv_date));\n $data->amount_refund = round($data->amount_refund, 2);\n $recd = $this->classtraineemodel->get_invoice_paid_details($invoice);\n foreach ($recd as $k => $row) {\n $mode_ext = ($row->mode_of_pymnt == 'CHQ') ? ' Chq#: ' . $row->cheque_number: '';\n $recd[$k]->recd_on = date('d/m/Y', strtotime($row->recd_on));\n $recd[$k]->mode = rtrim($this->course->get_metadata_on_parameter_id($row->mode_of_pymnt), ', ').$mode_ext;\n }\n $res = array('data' => $data, 'recd' => $recd);\n echo json_encode($res);\n exit();\n }", "public function create()\n {\n $user = Auth::user();\n $user->authorizeRoles('College Admin');\n $institution = $user->institution();\n $collegeName = $user->collegeName;\n\n $revenues = array();\n /** @var College $college */\n foreach ($institution->colleges as $college)\n if ($college->collegeName->id == $collegeName->id)\n foreach ($college->internalRevenues as $internalRevenue)\n $revenues[] = $internalRevenue;\n\n $revenueDescriptions = InternalRevenue::getEnum('revenue_description');\n\n $data = array(\n 'internal_revenues' => $revenues,\n 'revenue_descriptions' => $revenueDescriptions,\n\n 'has_modal' => 'yes',\n 'page_name' => 'budgets.internal-revenue.create'\n );\n\n return view('budgets.internal_revenue.index')->with($data);\n }", "public function convertSaleItemsData();", "function getReceiptCommercial()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = 'SELECT re.receipt_ref AS \"Receipt Ref\", r.relationship_name AS \"Supplier\", to_char(receipt_date,\\'dd/mm/yyyy\\') AS \"Receipt Date\" \n\t\tFROM '.receipt_table .' re \n\t\tJOIN '.relationships_table.' r ON r.relationship_id=re.supplier_id \n\t\tWHERE re.receipt_id = '.$this->receipt_id;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptCommercial, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "public function getDiscounts(): array;", "function getStocksPurchases($mysqli,$sale_id){\n\t$query = \"SELECT stocks.description,subsales.price_per_ton,subsales.quantity,subsales.subtotal FROM sales INNER join subsales ON sales.id = subsales.sale_id INNER JOIN stocks ON stocks.id = subsales.stock_id WHERE sales.id = '$sale_id'\";\n\n\tif($result = mysqli_query($mysqli,$query)){\n\t\treturn $result ;\n\t}\n\telse{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\t\n}", "public function fetchPurchaseData()\n\t{\n\t\t$result = array('data' => array());\n\n\t\t$data = $this->model_purchase->getPurchaseData();\n\n\t\tforeach ($data as $key => $value) {\n\n\t\t\t$count_total_item = $this->model_purchase->countPurchaseItem($value['purchase_no']);\n\t\t\t// echo $count_total_item;\n\t\t\t// $date = date('Y-m-d', $value['invoice_date']);\n\t\t\t// $time = date('h:i a', $value['date_time']);\n\t\t\t$party_data = $this->model_party->getPartyData($value['party_id']);\n\n\t\t\t// $date_time = $date;\n\n\t\t\tif ($party_data['address'] == NULL) {\n\t\t\t\t$party_data['address'] = \"\";\n\t\t\t}\n\t\t\tif ($party_data['party_name'] == NULL) {\n\t\t\t\t$party_data['party_name'] = \"\";\n\t\t\t}\n\t\t\t// button\n\t\t\t$buttons = '';\n\n\n\t\t\tif (in_array('viewOrder', $this->permission)) {\n\t\t\t\t$buttons .= '<a style=\"font-size: 25px;\" target=\"__blank\" href=\"' . base_url('purchase/printDiv/' . $value['s_no'] . '/' . $value['purchase_no'] . '') . '\" class=\"btn btn-default\"><i class=\"fa fa-print\"></i></a>';\n\t\t\t}\n\n\t\t\tif (in_array('updateOrder', $this->permission)) {\n\t\t\t\t$buttons .= ' <a style=\"font-size: 25px;\" href=\"' . base_url('purchase/update/' . $value['s_no'] . '/' . $value['purchase_no'] . '') . '\" class=\"btn btn-default\"><i class=\"fa fa-pencil\"></i></a>';\n\t\t\t}\n\n\t\t\tif (in_array('deleteOrder', $this->permission)) {\n\t\t\t\t$buttons .= ' <button style=\"font-size: 25px;\" type=\"button\" class=\"btn btn-default\" onclick=\"removeFunc(' . $value['s_no'] . ', ' . $value['purchase_no'] . ')\" data-toggle=\"modal\" data-target=\"#removeModal\"><i class=\"fa fa-trash\"></i></button>';\n\t\t\t}\n\n\t\t\t// if($value['is_payment_received'] == 1) {\n\t\t\t// \t$paid_status = '<span class=\"label label-success\">Paid</span>';\t\n\t\t\t// }\n\t\t\t// else {\n\t\t\t// \t$paid_status = '<span class=\"label label-warning\">Not Paid</span>';\n\t\t\t// }\n\n\n\n\t\t\t$result['data'][$key] = array(\n\t\t\t\t$value['purchase_no'],\n\t\t\t\t$party_data['party_name'],\n\t\t\t\t$value['purchase_date'],\n\t\t\t\t$count_total_item,\n\t\t\t\t// $value['total_amount'],\n\t\t\t\t// $value['mode_of_payment'],\n\t\t\t\t$buttons\n\t\t\t);\n\t\t} // /foreach\n\n\t\techo json_encode($result);\n\t}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function ppv_revenue(Request $request) {\n\n $currency = Setting::get('currency');\n\n $take = $request->take ? $request->take : Setting::get('admin_take_count');\n\n $model = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->orderBy('vod_videos.user_amount', 'desc')->skip($request->skip)\n ->take($take)->get();\n\n $data = [];\n\n $user_commission = VodVideo::where('vod_videos.user_id', $request->id)->sum('user_amount');\n\n foreach ($model as $key => $value) {\n \n $data[] = [\n 'vod_id'=>$value->vod_id,\n 'title'=>$value->title,\n 'user_id'=>$value->user_id,\n 'description'=>$value->description,\n 'image'=>$value->image,\n 'amount'=>$value->amount,\n 'admin_amount'=>$value->admin_amount,\n 'user_amount'=>$value->user_amount,\n 'created_at'=>$value->created_at->diffForhumans(),\n 'currency'=>$value->currency,\n 'unique_id'=>$value->unique_id\n ];\n\n }\n\n $paid_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->where('vod_videos.user_amount', '>', 0)->count();\n\n $total_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)->count();\n\n $response_array = ['success'=>true, 'data'=>$data, \n 'total_amount'=>$user_commission, \n 'currency'=>$currency, \n 'total_paid_videos'=>$paid_videos ? $paid_videos : 0,\n 'total_videos'=>$total_videos ? $total_videos : 0];\n\n return response()->json($response_array);\n }", "protected function create_purchaseorderdetails($ponbr) {\n\t\t\t$lines = array();\n\t\t\t$details = get_dbpurchaseorderdetails($ponbr);\n\t\t\t\n\t\t\tforeach ($details as $detail) {\n\t\t\t\t$line = $this->create_sectionarray($this->structure['detail'], $detail);\n\t\t\t\t$line['Allocation'] = array(array('Amount' => $detail['LineTotal']));\n\t\t\t\t$lines[] = $line;\n\t\t\t}\n\t\t\treturn $lines;\n\t\t}", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function retrieveData(){\n\t\t$mParser = new RecipeParser;\n\t\t$mParser->retrieveInfoForObject($this);\n\t}", "public function get_loss_profit()\n {\n /*\n * retrieve trial balance to get normal position of account.\n * prepare array that handle loss and profit data.\n * prepare expenses and revenues data, show advertising and marketing as separated detail\n */\n $trial = $this->get_trial();\n\n $data = array();\n\n $expense = array();\n $revenue = array();\n\n $advertising = array();\n $marketing = array();\n\n foreach ($trial as $row) {\n if ($row[\"position\"] == \"DEBITS\") {\n $temp = array(\"account\" => $row[\"account\"], \"value\" => $row[\"debit\"]);\n } else {\n $temp = array(\"account\" => $row[\"account\"], \"value\" => $row[\"credit\"]);\n }\n\n /*\n * retrieve account type from pattern.\n * eg: $row['account'] -> [Revenue] then break into parts '['->(0), 'Revenue'->(1), ']'->(3)\n * if type of account is Revenue then pass through it.\n * if type of account is Expense, specially for Advertising and marketing show the detail.\n */\n preg_match(\"/\\[([^]]*)\\]/\", $row[\"account\"], $account);\n preg_match(\"/\\]([^]]*)\\:/\", $row[\"account\"], $sub_expense);\n $account_type = $account[1];\n\n if ($account_type == \"Revenue\") {\n $revenue[] = $temp;\n }\n if ($account_type == \"Expense\") {\n if (sizeof($sub_expense) > 0 && trim($sub_expense[1]) == \"Advertising\") {\n $advertising[] = $temp;\n } else if (sizeof($sub_expense) > 0 && trim($sub_expense[1]) == \"Marketing\") {\n $marketing[] = $temp;\n } else {\n $expense[] = $temp;\n }\n }\n }\n\n /*\n * add advertising and marketing data front of array,\n * push revenue and all expenses into loss and profit array.\n */\n array_unshift($expense, $advertising);\n array_unshift($expense, $marketing);\n\n array_push($data, $revenue, $expense);\n\n return $data;\n }", "public function get_data();", "function einstellungen_data ()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE bgalset_id='1'\",\n\t\t\t$this->db_praefix.\"ecard_einstellungen\"\n\t\t);\n\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "public function getPurchaseDetails()\n {\n if (request()->ajax()) {\n $start = request()->start;\n $end = request()->end;\n $business_id = request()->session()->get('user.business_id');\n\n $purchase_details = $this->transactionUtil->getPurchaseTotals($business_id, $start, $end);\n\n return $purchase_details;\n }\n }", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "function getVenue()\n{\n global $db;\n\tglobal $venueName;\n $serial = -1;\n\t$venue = array();\n\t$venue['venue_id'] = $venue_id;\n $venue['accepting'] = getAccepting();\n\t$venue['name'] = $venueName;\n\t$venue['url_name'] = \"none\";\n\treturn $venue;\n}", "function get_data_product() {\n $query = $this->db->query('select * from BI_emarsys_product_feeds');\n \n \tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\n\t\t}\n }", "public function getFormattedData();", "public function reportRe()\n{\n print_r($this->requestReport(\n \"campaigns\",\n array(\"reportDate\" => \"20190501\",\n \"campaignType\" => \"sponsoredProducts\",\n \"metrics\" => \"impressions,clicks,cost\")));\n\n // amzn1.clicksAPI.v1.m1.5CD444B4.e3c2f999-14b0-4385-bf71-41f8538f712a\n \n \n}", "public function getDiscountDescription();", "public function retrieve_product_data_inv()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$product_id = $this->input->post('product_id');\n\t\t$product_info = $CI->Invoices->get_total_product_invoic($product_id);\n\t\techo json_encode($product_info);\n\t}", "protected function get_purchase_data($records, $cost_divide){\n \t$items = [];\n\t\t$amount = 0;\n\n\t\tif($records){\n\t\t\t$record = current($records);\n\t\t\t$tax_value = $this->get_tax($record->reception_date);\n\n\t\t\tif($cost_divide){\n\t\t\t\tforeach($cost_divide as $cost){\n\t\t\t\t\t$money = is_null($cost->cor_divide_cost) ? $cost->divide_cost : $cost->cor_divide_cost;\n\t\t\t\t\t$vat = 1 + ($tax_value / 100);\n\t\t\t\t\t$before_tax = round($money / $vat);\n\t\t\t\t\t$tax = $money - $before_tax;\n\t\t\t\t\t$items[] = [\n\t\t\t\t\t\t'tax' => $tax,\n\t\t\t\t\t\t'before_tax' => $before_tax,\n\t\t\t\t\t\t'm_department_id' => $cost->m_department_id,\n\t\t\t\t\t\t'department_code' => \\DB::select('code')\n\t\t\t\t\t\t\t\t\t\t\t\t->from('m_department')\n\t\t\t\t\t\t\t\t\t\t\t\t->where('id', $cost->m_department_id)\n\t\t\t\t\t\t\t\t\t\t\t\t->where('item_status','active')\n\t\t\t\t\t\t\t\t\t\t\t\t->execute()\n\t\t\t\t\t\t\t\t\t\t\t\t->get('code')\n\t\t\t\t\t];\n\t\t\t\t\t$amount += $money;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tforeach($records as $record){\n\t\t\t\t\t$money = is_null($record->cor_payments) ? $record->payments : $record->cor_payments;\n\t\t\t\t\t$vat = 1 + ($tax_value / 100);\n\t\t\t\t\t$before_tax = round($money/$vat);\n\t\t\t\t\t$tax = $money - $before_tax;\n\t\t\t\t\t$items[] = [\n\t\t\t\t\t\t'tax' => $tax,\n\t\t\t\t\t\t'before_tax' => $before_tax,\n\t\t\t\t\t\t'm_department_id' => null,\n\t\t\t\t\t\t'department_code' => null\n\t\t\t\t\t];\n\t\t\t\t\t$amount += $money;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t'items' => $items,\n\t\t\t'amount' => $amount\n\t\t];\n }", "function sys_sales($oConnect, $link, $startDate, $endDate,&$sys_log) {\n $sSQL = \"sp_report SalesByItemDetail show Text, Blank, TxnType, Date, Memo, Name, Quantity, UnitPrice, Amount parameters DateFrom = {d'$startDate'}, DateTo= {d'$endDate'}\";\n // Perform the query\n $oResult = odbc_exec($oConnect, $sSQL);\n $keys = array(\"Type\", \"FullName\", \"Description\", \"TxnType\", \"Date\", \"Memo\", \"Name\", \"Quantity\", \"UnitPrice\", \"Amount\");\n $lFieldCount = odbc_num_fields($oResult);\n $rows = array();\n //print_r($keys.\"<br>\");\n while ($myRow = odbc_fetch_array($oResult)) {\n $rows[] = $myRow;\n }\n $values = array();\n $Type = \"\";\n $FullName = \"\";\n $NewFullName = \"\";\n $Description = \"\";\n if (count($rows) > 0) {\n // do delete then add\n $resUpdate = mysqli_query($link, \"delete from r_salesbyitemdetail WHERE date>= '$startDate' \");\n //print (\"delete from r_salesbyitemdetail WHERE date>= '$startDate'\");\n if ($resUpdate) {\n $items = 0;\n for ($i = 0;$i < count($rows);++$i) {\n $values = array();\n $l1_parentCount = 0;\n $l2_parentCount = 0;\n $l3_parentCount = 0;\n // print $rows[$i]['Text'];\n //if ($rows[$i]['Text'] == \"\" && $rows[$i]['Blank'] == \"\" && $rows[$i]['Amount'] != \"\")\n if ($rows[$i]['UnitPrice'] != \"\") {\n if ($i >= 3) {\n if ($rows[$i - 1]['Text'] != \"\" && $rows[$i - 1]['Amount'] == \"\") {\n $Description = $rows[$i - 1]['Text'];\n if ($rows[$i - 2]['Text'] != \"\" && $rows[$i - 2]['Amount'] == \"\") {\n $FullName = $rows[$i - 2]['Text'];\n if ($rows[$i - 3]['Text'] != \"\" && $rows[$i - 3]['Amount'] == \"\") {\n $Type = $rows[$i - 3]['Text'];\n }\n }\n }\n }\n if (strpos($Description, '(') !== false) {\n $newDescription = preg_replace(\"/\\([^)]+\\)/\", \"\", $Description);\n $NewFullName = $FullName . ':' . $newDescription;\n $splitArr = explode(\"(\", $Description);\n $newDescription2 = str_replace(\")\", \"\", $splitArr[1]);\n } else {\n $NewFullName = $FullName . ':' . $Description;\n $newDescription2 = $Description;\n }\n array_push($values, $Type);\n array_push($values, $NewFullName);\n //array_push($values, addslashes($Description));\n array_push($values, addslashes($newDescription2));\n array_push($values, $rows[$i]['TxnType']);\n array_push($values, $rows[$i]['Date']);\n array_push($values, addslashes($rows[$i]['Memo']));\n array_push($values, $rows[$i]['Name']);\n array_push($values, $rows[$i]['Quantity']);\n array_push($values, $rows[$i]['UnitPrice']);\n array_push($values, $rows[$i]['Amount']);\n //print $Type . \"**:***\" . $FullName . \"***:***\" . $Description . \"*************\".$rows[$i]['TxnType'] . \" - \" . $rows[$i]['Date'] . \" - \" . $rows[$i]['Memo'] . \" - \" . $rows[$i]['Name'] . \" - \" . $rows[$i]['Quantity'] . \" - \" . $rows[$i]['UnitPrice'] . \" - \" . $rows[$i]['Amount'] . \"<br />\";\n //print_r($values.\"<br>\");\n $resInsert = mysqli_query($link, \"INSERT INTO r_salesbyitemdetail (\" . implode(\", \", $keys) . \") VALUES ('\" . implode(\"', '\", $values) . \"');\"); // insert one row into new table\n if ($resInsert) {\n //print (\"r_salesbyitemdetail--Insert2 :Success<br>\");\n \n } else {\n print (\"r_salesbyitemdetail--INSERT INTO r_salesbyitemdetail (\" . implode(\", \", $keys) . \") VALUES ('\" . implode(\"', '\", $values) . \"')<br>\");\n }\n $items++;\n }\n }\n } else {\n print (\"delete failed!<br>\");\n }\n }\n odbc_free_result($oResult);\n\t$sys_log .=\"total No. of SalesByItemDetail: $items \\r\\n\";\n\t\n\t\n echo \"<br>total No. of SalesByItemDetail: $items\";\n\t//$arr['SalesByItemDetail'] = \"total No. of SalesByItemDetail: $items\";\n\t\n}", "protected function _getFullRateInfo()\n {\n $rates = Mage::getModel('tax/sales_order_tax')->getCollection()->loadByOrder($this->getOrder())->toArray();\n $fullInfo = Mage::getSingleton('tax/calculation')->reproduceProcess($rates['items']);\n return $fullInfo;\n }", "function get_acquisition_qty_by_country(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \" tblcountry.country, sum(trelVintageHasAcquire.qty) as qty\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" tblcountry.country \";\n //$where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" qty DESC \";\n $limit = '12';\n $rst = $obj ->get_extended($where,$columns,$group, $sort, $limit);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"get_acquisition_qty_by_country() failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n \n}", "function edit_revenue_type($id) \n\t\t{\n\t\t\t\n\t\t\t\t $this->db->where('revenue_id',$id);\n\t\t\t\t\t\t\n\t\t\t\t $query=$this->db->get($this->table_name);\n\t\t\t\n\t\t\t\t return $query->result();\n\t\t\t\t\t\t\t\n\t\t}", "public function getAllSalesMan(){\n\t\t$sql = \"SELECT * FROM vendedor\";\n\t\treturn $this->Model->getData($sql);\n\t}", "abstract public function getDataDesc();", "public function getReporteVentasDiario($data)\n\t{\n\t\t$spreadsheet = new Spreadsheet();\n\t\t$sheet = $spreadsheet->getActiveSheet();\n\t\t$sql = (\"SELECT \n\t\t\t\t\tfacturascli.codpago,\n\t\t\t\t\tclientes.nombre,\n\t\t\t\t\tclientes.razonsocial,\n\t\t\t\t\tclientes.codagente AS codigo_vendedor,\n\t\t\t\t\tagentes.nombre AS nombre_vendedor,\n\t\t\t\t\tfacturascli.fecha AS fecha_facturacion,\n\t\t\t\t\tfacturascli.vencimiento AS fecha_vencimiento,\n\t\t\t\t\tfacturascli.codigo,\n\t\t\t\t\tfacturascli.observaciones,\n\t\t\t\t\tfacturascli.total\n\t\t\t\tFROM\n\t\t\t\t\t`facturascli`\n\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\tclientes ON clientes.codcliente = facturascli.codcliente\n\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\tagentes AS agentes ON agentes.codagente = clientes.codagente\n\t\t\t\tWHERE\n\t\t\t\t\tDATE(facturascli.fecha) = :fecha\n\t\t\t\tORDER BY clientes.codagente;\");\n\t\t\t\t\n\t\t$this->consulta('SET NAMES utf8');\n\t\t# Escribir encabezado de los productos\n\t\t$encabezado = [\"codpago\",\"nombre\",\"razonsocial\",\"codigo_vendedor\",\"nombre_vendedor\",\"fecha_facturacion\",\"fecha_vencimiento\",\"codigo\",\"observaciones\",\"total\",\"fecha_pago\"];\n\t\t# El último argumento es por defecto A1 pero lo pongo para que se explique mejor\n\t\t$sheet->fromArray($encabezado, null, 'A1');\n\t\t$parametros = array('fecha'=>$data);\n\t\t$resultado = $this->consulta($sql,$parametros);\n\t\t$res = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t$numeroDeFila = 2;\n\t\tforeach ($res as $data ) {\n\t\t\t# Obtener los datos de la base de datos\n\t\t\t$codpago = $data['codpago'];\n\t\t\t$nombre = $data['nombre'];\n\t\t\t$razonsocial = $data['razonsocial'];\n\t\t\t$codigo_vendedor = $data['codigo_vendedor'];\n\t\t\t$nombre_vendedor = $data['nombre_vendedor'];\n\t\t\t$fecha_facturacion = $data['fecha_facturacion'];\n\t\t\t$fecha_vencimiento = $data['fecha_vencimiento'];\n\t\t\t$codigo = $data['codigo'];\n\t\t\t$observaciones = $data['observaciones'];\n\t\t\t$total = $data['total'];\n\t\t\t# Escribirlos en el documento\n\t\t\t$sheet->setCellValueByColumnAndRow(1, $numeroDeFila, $codpago);\n\t\t\t$sheet->setCellValueByColumnAndRow(2, $numeroDeFila, $nombre);\n\t\t\t$sheet->setCellValueByColumnAndRow(3, $numeroDeFila, $razonsocial);\n\t\t\t$sheet->setCellValueByColumnAndRow(4, $numeroDeFila, $codigo_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(5, $numeroDeFila, $nombre_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(6, $numeroDeFila, $fecha_facturacion);\n\t\t\t$sheet->setCellValueByColumnAndRow(7, $numeroDeFila, $fecha_vencimiento);\n\t\t\t$sheet->setCellValueByColumnAndRow(8, $numeroDeFila, $codigo);\n\t\t\t$sheet->setCellValueByColumnAndRow(9, $numeroDeFila, $observaciones);\n\t\t\t$sheet->setCellValueByColumnAndRow(10, $numeroDeFila, $total);\n\t\t\t$numeroDeFila++;\n\t\t}\n\t\t$writer = new Xlsx($spreadsheet);\n\t\t$writer->save('../../reporte/reporte.xlsx');\n\t\techo \"true\";\n\t}", "public function getBergrivierSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 116\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function get_data() {\r\n $data = get_object_vars( $this );\r\n $query = new My_Home_Query_Estates();\r\n $query->set_limit( -1 );\r\n $query->set_user( $this->id );\r\n $query->set_all();\r\n if ( ! empty( My_Home_Core()->lang ) ) {\r\n $query->set_lang( My_Home_Core()->lang );\r\n }\r\n $results = $query->get_results();\r\n $data['estates'] = $results['estates'];\r\n\r\n return $data;\r\n }", "public function getProductoRe(){\n\t\t$sql = \"SELECT id_producto, nombre, cantidad, precio_total, presentacion, proveedor, marca, tipo_producto FROM productos INNER JOIN presentaciones USING(id_presentacion) INNER JOIN proveedores USING(id_proveedor) INNER JOIN marca USING(id_marca) INNER JOIN tipo_producto USING(id_tipo_producto) ORDER BY id_producto\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "function getVenues()\n{\n\tglobal $db;\n\tglobal $venueName;\n\t$venues = array();\n\t$venue['venue_id'] = 0;\n $venue['accepting'] = getAccepting();\n $venue['name'] = $venueName;\n\t$venue['url_name'] = \"none\";\n\t$venues['venues'][] = $venue;\n\treturn $venues;\n}", "public function getInventoryAndSales() {\n\t\t$isql=\"SELECT i.id as value,i.item_name as label,i.sell_price,i.quantity FROM inventory i where rstatus='A' and quantity > 0\";\t\t\n\t\t$iresult=$this->runQuery('getAll',$isql);\n\t\t\n\t\t$sosql=\"SELECT so.id as so_id,so.product_id as inv_id,p.item_name as inv_name,date(so.sell_date) as selling_date,so.customer_name,so.sell_price as selling_price,so.prod_qty as selling_qty,so.comments FROM sales_order so, inventory p where p.id = so.product_id and so.rstatus ='A'\";\t\t\n\t\t$soresult=$this->runQuery('getAll',$sosql);\n\t\t\n\t\techo '[{\"invDropdownList\":'.json_encode($iresult).',\"salesOrderList\":'.json_encode($soresult).'}]';\n\t}", "public function GetRestbyHotal(){\n\t\t$data=array();\n\t\t$getres=''; \n\t\t$data=$this->Testimonials_model->getResHotel($_POST['id']);\n\t\t if(!empty($data)){\n\t\t\t$getres .= \"<option value=''> Select Restaurant </option>\";\n\t\t\tforeach($data as $val){\n\t\t\t$getres .= \"<option value=\".$val['id'].\"> \".$val['restaurant_name'].\" </option>\";\n\t\t\t}}\n\t\t\telse\n\t\t\t{\n\t\t\t$getres .= \"<option value=''> There is no Restaurant </option>\";\n\t\t\t}\n\t\t\techo $getres; \n\t }", "public function getContent()\n {\n $objModule = new MpSellerInvoice();\n $invoiceAddressPatternRules = Tools::jsonDecode(Configuration::get('PS_INVCE_INVOICE_ADDR_RULES'), true);\n $deliveryAddressPatternRules = Tools::jsonDecode(Configuration::get('PS_INVCE_DELIVERY_ADDR_RULES'), true);\n $invoiceAddress = new Address((int) $this->order->id_address_invoice);\n $formattedInvoiceAddress = AddressFormat::generateAddress($invoiceAddress, $invoiceAddressPatternRules, '<br />', ' ');\n $deliveryAddress = null;\n $formattedDeliveryAddress = '';\n $deliveryAddress = new Address((int) $this->order->id_address_delivery);\n $formattedDeliveryAddress = AddressFormat::generateAddress($deliveryAddress, $deliveryAddressPatternRules, '<br />', ' ');\n $customer = new Customer((int) $this->order->id_customer);\n $orderDetails = $this->order->getProducts();\n\n $sellerTotalProducts = 0;\n // customize orderDetails to maintain tax\n foreach ($orderDetails as $key => $row) {\n // Add information for virtual product\n if ($orderDetails[$key]['download_hash'] && !empty($row['download_hash'])) {\n $orderDetails[$key]['filename'] = ProductDownload::getFilenameFromIdProduct((int) $row['product_id']);\n // Get the display filename\n $orderDetails[$key]['display_filename'] = ProductDownload::getFilenameFromFilename($row['filename']);\n }\n $orderDetails[$key]['id_address_delivery'] = $this->order->id_address_delivery;\n /* Ecotax */\n $roundMode = $this->order->round_mode;\n $orderDetails[$key]['ecotax_tax_excl'] = $row['ecotax']; // alias for coherence\n $orderDetails[$key]['ecotax_tax_incl'] = $row['ecotax'] * (100 + $row['ecotax_tax_rate']) / 100;\n $row['ecotax_tax_incl'] = $row['ecotax'] * (100 + $row['ecotax_tax_rate']) / 100;\n $row['ecotax_tax_excl'] = $row['ecotax'];\n $orderDetails[$key]['ecotax_tax'] = $row['ecotax_tax_incl'] - $row['ecotax_tax_excl'];\n if ($roundMode == Order::ROUND_ITEM) {\n $row['ecotax_tax_incl'] = Tools::ps_round($row['ecotax_tax_incl'], _PS_PRICE_COMPUTE_PRECISION_, $roundMode);\n }\n $orderDetails[$key]['total_ecotax_tax_excl'] = $row['ecotax_tax_excl'] * $row['product_quantity'];\n $orderDetails[$key]['total_ecotax_tax_incl'] = $row['ecotax_tax_incl'] * $row['product_quantity'];\n $row['total_ecotax_tax_incl'] = $row['ecotax_tax_incl'] * $row['product_quantity'];\n $row['total_ecotax_tax_excl'] = $row['ecotax_tax_excl'] * $row['product_quantity'];\n $orderDetails[$key]['total_ecotax_tax'] = $row['total_ecotax_tax_incl'] - $row['total_ecotax_tax_excl'];\n $row['total_ecotax_tax'] = $row['total_ecotax_tax_incl'] - $row['total_ecotax_tax_excl'];\n $row['ecotax_tax'] = $row['ecotax_tax_incl'] - $row['ecotax_tax_excl'];\n foreach (array(\n 'ecotax_tax_excl',\n 'ecotax_tax_incl',\n 'ecotax_tax',\n 'total_ecotax_tax_excl',\n 'total_ecotax_tax_incl',\n 'total_ecotax_tax',\n ) as $ecotaxfield) {\n $orderDetails[$key][$ecotaxfield] = Tools::ps_round($row[$ecotaxfield], _PS_PRICE_COMPUTE_PRECISION_, $roundMode);\n }\n // Aliases\n $orderDetails[$key]['unit_price_tax_excl_including_ecotax'] = $row['unit_price_tax_excl'];\n $orderDetails[$key]['unit_price_tax_incl_including_ecotax'] = $row['unit_price_tax_incl'];\n $orderDetails[$key]['total_price_tax_excl_including_ecotax'] = $row['total_price_tax_excl'];\n $orderDetails[$key]['total_price_tax_incl_including_ecotax'] = $row['total_price_tax_incl'];\n }\n\n $hasDiscount = false;\n foreach ($orderDetails as $id => &$orderDetail) {\n if ($this->id_seller == 0) {\n $isBelongToSeller = $this->getSellerProductInfoByProductId($orderDetail['product_id']);\n //sending admin invoice then check config if seller invoice enabled and product is seller product then unset otherwise send seller product in admin invoice bescause seller invoice is disabled\n if ($isBelongToSeller && Configuration::get('MP_SELLER_INVOICE_ACTIVE') == 1) {\n unset($orderDetails[$id]);\n continue;\n }\n } else {\n $isBelongToSeller = $this->getSellerProductInfo($orderDetail['product_id']);\n if (!$isBelongToSeller) {\n unset($orderDetails[$id]);\n continue;\n }\n }\n // Find out if column 'price before discount' is required\n if ($orderDetail['reduction_amount_tax_excl'] > 0) {\n $hasDiscount = true;\n $orderDetail['unit_price_tax_excl_before_specific_price'] = $orderDetail['unit_price_tax_excl_including_ecotax'] + $orderDetail['reduction_amount_tax_excl'];\n } elseif ($orderDetail['reduction_percent'] > 0) {\n $hasDiscount = true;\n $orderDetail['unit_price_tax_excl_before_specific_price'] = (100 * $orderDetail['unit_price_tax_excl_including_ecotax']) / (100 - $orderDetail['reduction_percent']);\n }\n if (isset($orderDetail['unit_price_tax_excl_before_specific_price'])) {\n $orderDetail['unit_price_tax_excl_before_specific_price'] = Tools::displayPrice($orderDetail['unit_price_tax_excl_before_specific_price'], $this->currency);\n }\n // Set tax_code\n $taxes = OrderDetail::getTaxListStatic($id);\n $taxTemp = array();\n foreach ($taxes as $tax) {\n $obj = new Tax($tax['id_tax']);\n $taxTemp[] = sprintf($objModule->l('%1$s%2$s%%'), ($obj->rate + 0), '&nbsp;');\n }\n $sellerTotalProducts += $orderDetail['total_price_tax_excl'];\n $orderDetail['order_detail_tax'] = $taxes;\n $orderDetail['order_detail_tax_label'] = implode(', ', $taxTemp);\n $sellerOrder = $this->getProductCommissionDetail($orderDetail['product_id'], $orderDetail['product_attribute_id']);\n if ($sellerOrder) {\n $orderDetails[$id]['admin_commission'] = Tools::displayPrice($sellerOrder['admin_commission'], $this->currency);\n $orderDetails[$id]['admin_commission_tax'] = Tools::displayPrice($sellerOrder['admin_tax'], $this->currency);\n $orderDetails[$id]['seller_amount'] = Tools::displayPrice($sellerOrder['seller_amount'], $this->currency);\n $orderDetails[$id]['seller_amount_tax'] = Tools::displayPrice($sellerOrder['seller_tax'], $this->currency);\n $orderDetails[$id]['order_total_commission'] = Tools::displayPrice($sellerOrder['admin_commission'] + $sellerOrder['admin_tax'], $this->currency);\n }\n unset($sellerOrder);\n }\n\n unset($taxTemp);\n unset($orderDetail);\n // calculating seller voucher if applied\n $mpVoucher = WkMpOrderVoucher::getVoucherDetailByIdSeller($this->order->id, $this->id_seller);\n $voucherTotal = 0;\n if ($mpVoucher) {\n foreach ($mpVoucher as &$voucher) {\n $voucherTotal = $voucherTotal + $voucher['voucher_value'];\n $voucher['voucher_value'] = Tools::displayPrice($voucher['voucher_value'], $this->currency);\n }\n }\n // add product image in invoice\n if (Configuration::get('PS_PDF_IMG_INVOICE')) {\n foreach ($orderDetails as &$orderDetail) {\n if ($this->id_seller == 0) {\n $isBelongToSeller = $this->getSellerProductInfoByProductId($orderDetail['product_id']);\n //sending admin invoice then check config if seller invoice enabled and product is seller product then unset otherwise send seller product in admin invoice bescause seller invoice is disabled\n if ($isBelongToSeller && Configuration::get('MP_SELLER_INVOICE_ACTIVE') == 1) {\n unset($orderDetails[$id]);\n continue;\n }\n } else {\n $isBelongToSeller = $this->getSellerProductInfo($orderDetail['product_id']);\n if (!$isBelongToSeller) {\n unset($orderDetails[$id]);\n continue;\n }\n }\n if ($orderDetail['image'] != null) {\n $name = 'product_mini_'.(int) $orderDetail['product_id'].(isset($orderDetail['product_attribute_id']) ? '_'.(int) $orderDetail['product_attribute_id'] : '').'.jpg';\n $path = _PS_PROD_IMG_DIR_.$orderDetail['image']->getExistingImgPath().'.jpg';\n $orderDetail['image_tag'] = preg_replace(\n '/\\.*'.preg_quote(__PS_BASE_URI__, '/').'/',\n _PS_ROOT_DIR_.DIRECTORY_SEPARATOR,\n ImageManager::thumbnail($path, $name, 45, 'jpg', false),\n 1\n );\n if (file_exists(_PS_TMP_IMG_DIR_.$name)) {\n $orderDetail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_.$name);\n } else {\n $orderDetail['image_size'] = false;\n }\n }\n }\n unset($orderDetail); // don't overwrite the last order_detail later\n }\n $cartRules = $this->order->getCartRules($this->order->id);\n $freeShipping = false;\n foreach ($cartRules as $key => $cartRule) {\n if ($cartRule['free_shipping']) {\n $freeShipping = true;\n /*\n * Adjust cart rule value to remove the amount of the shipping.\n * We're not interested in displaying the shipping discount as it is already shown as \"Free Shipping\".\n */\n $cartRules[$key]['value_tax_excl'] -= $this->order->total_shipping_tax_excl;\n $cartRules[$key]['value'] -= $this->order->total_shipping_tax_incl;\n /*\n * Don't display cart rules that are only about free shipping and don't create\n * a discount on products.\n */\n if ($cartRules[$key]['value'] == 0) {\n unset($cartRules[$key]);\n }\n }\n }\n $productTaxes = 0;\n foreach ($this->getProductTaxesBreakdown() as $details) {\n $productTaxes += $details['total_amount'];\n }\n $productDiscountsTaxExcl = $this->order->total_discounts_tax_excl;\n $productDiscountsTaxIncl = $this->order->total_discounts_tax_incl;\n if ($freeShipping) {\n $productDiscountsTaxExcl -= $this->order->total_shipping_tax_excl;\n $productDiscountsTaxIncl -= $this->order->total_shipping_tax_incl;\n }\n $productsAfterDiscountsTaxExcl = $this->order->total_products - $productDiscountsTaxExcl;\n $productsAfterDiscountsTaxIncl = $this->order->total_products_wt - $productDiscountsTaxIncl;\n $shippingTaxExcl = $freeShipping ? 0 : $this->order->total_shipping_tax_excl;\n $shippingTaxIncl = $freeShipping ? 0 : $this->order->total_shipping_tax_incl;\n $shippingTaxes = $shippingTaxIncl - $shippingTaxExcl;\n $wrappingTaxes = $this->order->total_wrapping_tax_incl - $this->order->total_wrapping_tax_excl;\n $totalTaxes = $this->order->total_paid_tax_incl - $this->order->total_paid_tax_excl;\n $free = 1;\n if ($shippingTaxExcl > 0) {\n $free = 0;\n }\n $footer = array(\n 'products_before_discounts_tax_excl' => $sellerTotalProducts,\n 'product_discounts_tax_excl' => $productDiscountsTaxExcl,\n 'products_after_discounts_tax_excl' => $productsAfterDiscountsTaxExcl,\n 'products_before_discounts_tax_incl' => $this->order->total_products_wt,\n 'product_discounts_tax_incl' => $productDiscountsTaxIncl,\n 'products_after_discounts_tax_incl' => $productsAfterDiscountsTaxIncl,\n 'product_taxes' => $productTaxes,\n 'shipping_tax_excl' => $shippingTaxExcl,\n 'shipping_taxes' => $shippingTaxes,\n 'shipping_tax_incl' => $shippingTaxIncl,\n 'wrapping_tax_excl' => $this->order->total_wrapping_tax_excl,\n 'wrapping_taxes' => $wrappingTaxes,\n 'wrapping_tax_incl' => $this->order->total_wrapping_tax_incl,\n 'ecotax_taxes' => $totalTaxes - $productTaxes - $wrappingTaxes - $shippingTaxes,\n 'total_taxes' => $totalTaxes,\n 'total_paid_tax_excl' => $this->order->total_paid_tax_excl,\n 'total_paid_tax_incl' => $this->order->total_paid_tax_incl,\n 'free_shipping' => $free\n );\n foreach ($footer as $key => $value) {\n $footer[$key] = Tools::ps_round($value, _PS_PRICE_COMPUTE_PRECISION_, $this->order->round_mode);\n }\n $roundType = $this->getRoundType($this->order->round_type);\n $displayProductImages = Configuration::get('PS_PDF_IMG_INVOICE');\n $taxExcludedDisplay = Group::getPriceDisplayMethod($customer->id_default_group);\n $layout = $this->computeLayout(array('has_discount' => $hasDiscount));\n $legalFreeText = Hook::exec('displayInvoiceLegalFreeText', array('order' => $this->order));\n if (!$legalFreeText) {\n $legalFreeText = Configuration::get('PS_INVOICE_LEGAL_FREE_TEXT', (int) Context::getContext()->language->id, null, (int) $this->order->id_shop);\n }\n // Calculate all the seller and admin amount from the order\n $totalAdminCommission = $totalAdminCommissionTax = $sellerTotal = $sellerTotalTax = 0;\n $objOrderDetail = new WkMpSellerOrderDetail();\n $sellerOrderDetail = $objOrderDetail->getSellerProductFromOrder($this->order->id, $this->id_seller_customer);\n if ($sellerOrderDetail) {\n foreach ($sellerOrderDetail as $sellerDetail) {\n if (isset($orderDetails[$sellerDetail['id_order_detail']])) {\n $orderDetails[$sellerDetail['id_order_detail']]['commission_rate'] = Tools::ps_round(\n $sellerDetail['commission_rate'],\n 2\n );\n }\n $totalAdminCommission += $sellerDetail['admin_commission'];\n $totalAdminCommissionTax += $sellerDetail['admin_tax'];\n $sellerTotal += $sellerDetail['seller_amount'];\n $sellerTotalTax += $sellerDetail['seller_tax'];\n }\n }\n $sellerCommission = new WkMpCommission();\n $commissionRate = $sellerCommission->getCommissionRate($this->id_seller_customer);\n if (!$commissionRate) {\n $commissionRate = Configuration::get('WK_MP_GLOBAL_COMMISSION');\n }\n $objCurrency = new Currency($this->order->id_currency);\n if ($orderDetails) {\n foreach ($orderDetails as $key => $value) {\n $orderDetails[$key]['unit_price_tax_excl'] = Tools::displayPrice($value['unit_price_tax_excl'], $objCurrency);\n $orderDetails[$key]['ecotax_tax_excl'] = Tools::displayPrice($value['ecotax_tax_excl'], $objCurrency);\n $orderDetails[$key]['unit_price_tax_incl'] = Tools::displayPrice($value['unit_price_tax_incl'], $objCurrency);\n $orderDetails[$key]['ecotax_tax_incl'] = Tools::displayPrice($value['ecotax_tax_incl'], $objCurrency);\n $orderDetails[$key]['total_price_tax_excl'] = Tools::displayPrice($value['total_price_tax_excl'], $objCurrency);\n }\n }\n $sellerTotal = $footer['products_before_discounts_tax_excl'] + $footer['product_taxes'];\n $footer = $this->getFooterFormatedData($footer, $objCurrency, $voucherTotal);\n $carrier = new Carrier($this->order->id_carrier);\n $data = array(\n 'order' => $this->order,\n 'carrierName' => $carrier->name,\n 'currency' => new Currency($this->order->id_currency),\n 'seller_obj' => $this->obj_seller,\n 'order_invoice' => $this->order,\n 'order_details' => $orderDetails,\n 'cart_rules' => $cartRules,\n 'delivery_address' => $formattedDeliveryAddress,\n 'invoice_address' => $formattedInvoiceAddress,\n 'addresses' => array('invoice' => $invoiceAddress, 'delivery' => $deliveryAddress),\n 'tax_excluded_display' => $taxExcludedDisplay,\n 'display_product_images' => $displayProductImages,\n 'layout' => $layout,\n 'tax_tab' => $this->getTaxTabContent(),\n 'customer' => $customer,\n 'footer' => $footer,\n 'sellerTotal' => Tools::displayPrice($sellerTotal, $objCurrency),\n 'sellerTotalTax' => Tools::displayPrice($sellerTotalTax, $objCurrency),\n 'totalAdminCommission' => Tools::displayPrice($totalAdminCommission, $objCurrency),\n 'totalAdminCommissionTax' => Tools::displayPrice($totalAdminCommissionTax, $objCurrency),\n 'totalCommission' => Tools::displayPrice($totalAdminCommissionTax + $totalAdminCommission, $objCurrency),\n 'sellerCommissionRate' => $commissionRate,\n 'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_,\n 'round_type' => $roundType,\n 'legal_free_text' => $legalFreeText,\n );\n $this->context->smarty->assign($data);\n $this->context->smarty->assign(array('invoice_admin_seller' => 2));\n //To check admin product or not\n if ($this->id_seller) {\n $this->context->smarty->assign(array('is_admin_product' => $objModule->l('Seller')));\n } else {\n $this->context->smarty->assign(array('is_admin_product' => $objModule->l('Admin')));\n }\n $tpls = $this->getTpls();\n $this->context->smarty->assign($tpls);\n return $this->context->smarty->fetch($this->getTemplate('invoice'));\n }", "function getProfitYTD(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT SUM(revenue) - SUM(expense) AS 'profit' FROM invoices\");\n \n $results=false;\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "public function getLangebergSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 104\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getPrices()\n {\n }", "function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}", "public function getSellDetails()\n {\n if (request()->ajax()) {\n $start = request()->start;\n $end = request()->end;\n $business_id = request()->session()->get('user.business_id');\n\n $sell_details = $this->transactionUtil->getSellTotals($business_id, $start, $end);\n \n return $sell_details;\n }\n }", "public function generateExpenses()\n {\n \t//Iva\n \t$iva_expense = new Expense();\n \t$iva_expense->type = 'iva';\n \t$iva_expense->value = ($this->value * $this->iva_percetage)/100;\n \t$iva_expense->exchange_rate_cop = $this->exchange_rate_cop;\n \t$iva_expense->income_id = $this->id;\n \t$iva_expense->currency_id = $this->currency_id;\n \t$iva_expense->save();\n\n \t//Trsoft utility, se calcula con el valor después de descontar el iva\n\t\t$trsoft_utility_expense = new Expense();\n\t\t$trsoft_utility_expense->type = 'trsoft utility';\n\t\t//En la compra de una licencia la utilidad de trsoft aumenta\n\t\tif($this->type == 'license'){\n\t\t\t$trsoft_utility_expense->value = (\n\t\t\t\t//Valor despues de restarle el iva\n\t\t\t\t($this->value - $iva_expense->value) \n\t\t\t\t//Se calcula el % de utilidad de TrSoft, se separa la utilidad de socios\n\t\t\t\t* (100 - $this->partners_utility)\n\t\t\t)/100;\n\t\t}else if($this->type == 'commission'){\n\t\t\t//Cuando se paga una comisión la utiliad de TrSoft es la establecida\n\t\t\t$trsoft_utility_expense->value = (($this->value - $iva_expense->value) * $this->trsoft_utility)/100;\n\t\t}\n\n\t\t$trsoft_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$trsoft_utility_expense->state = 'paid out';\n\t\t$trsoft_utility_expense->income_id = $this->id;\n\t\t$trsoft_utility_expense->currency_id = $this->currency_id;\n\t\t$trsoft_utility_expense->save(); \n\n \t//Partners utility, se calcula con el valor después de descontar el iva\n\t\t$partners_utility_expense = new Expense();\n\t\t$partners_utility_expense->type = 'partners utility';\n\t\t$partners_utility_expense->value = (($this->value - $iva_expense->value) * $this->partners_utility)/100;\n\t\t$partners_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$partners_utility_expense->income_id = $this->id;\n\t\t$partners_utility_expense->currency_id = $this->currency_id;\n\t\t$partners_utility_expense->save(); \t\n\n\t\t//Si es el pago de una comisión se deben generar los egresos\n\t\t//para pago de comisión de traders y desarrollador\n\t\tif($this->type == 'commission'){\n\n\t\t}\n }", "public function obtenerBeneficiados(){\n \n //obtener datos de service\n return IncorporacionService::beneficiados();\n\n }", "public function retrieve_product_search_sales_report( $start_date,$end_date )\n\t{\n\t\t$dateRange = \"c.date BETWEEN '$start_date%' AND '$end_date%'\";\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t\t\n\t\t//$this->db->group_by('b.product_model');\n\t}", "public function getSummary();" ]
[ "0.7052269", "0.6625663", "0.65833104", "0.65596694", "0.6358199", "0.6344937", "0.63185763", "0.62113214", "0.6038706", "0.5953974", "0.5816326", "0.56187576", "0.561654", "0.55583376", "0.5521509", "0.5507102", "0.54821646", "0.547416", "0.54545605", "0.5410496", "0.53917456", "0.5380994", "0.53668666", "0.53547376", "0.5336665", "0.53362614", "0.5332688", "0.53160983", "0.5314483", "0.52971995", "0.5296423", "0.5288552", "0.52719504", "0.5261371", "0.5255692", "0.52325344", "0.5220392", "0.52063584", "0.5184805", "0.5176812", "0.5171159", "0.51641107", "0.51447994", "0.51435536", "0.5137547", "0.5128226", "0.5121749", "0.5121654", "0.51179516", "0.5111366", "0.5110219", "0.5107539", "0.5106044", "0.50988793", "0.50843644", "0.50764495", "0.50750333", "0.5045184", "0.5038982", "0.503897", "0.5038079", "0.5036921", "0.503363", "0.5030728", "0.50271696", "0.5023361", "0.5012401", "0.5011184", "0.50095487", "0.5008937", "0.50068337", "0.50048304", "0.50019705", "0.50005007", "0.50004953", "0.49895045", "0.49790037", "0.49775824", "0.4973869", "0.49710312", "0.4970201", "0.49596745", "0.4953998", "0.4951471", "0.49427915", "0.49395514", "0.4938262", "0.49378917", "0.493464", "0.49288172", "0.4928809", "0.49252915", "0.4925107", "0.49157077", "0.49151617", "0.49147403", "0.49107772", "0.49039772", "0.4903067", "0.48988646" ]
0.5818879
10
retrieve revenue data to generate the description
public function retrieveRevenueAverage() { $query = "SELECT AVG(revenue) AS avgRevenue FROM (SELECT CONCAT(YEAR(date), '/', MONTH(date)) AS theMonth, SUM(exlAmount) AS revenue FROM payment GROUP BY theMonth ORDER BY YEAR(DATE) ASC, MONTH(date) ASC) AS T1;"; $result = mysqli_query($GLOBALS['db'], $query); $row = mysqli_fetch_assoc($result); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieveRevenueData()\n {\n //setting header to json\n header('Content-Type: application/json');\n\n //query to get the revenue data\n $query = sprintf(\"SELECT CONCAT(YEAR(date), '/', WEEK(date)) AS theWeek, SUM(exlAmount) AS revenue FROM payment GROUP BY theWeek ORDER BY YEAR(DATE) ASC, WEEK(date) ASC;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "public function get_revenue() {\n return response()->json(Revenue::active()->get()->toArray(), 200);\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "function getRevenuesData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='daily' || $varAction=='yesterday'){\n if($varAction=='daily'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n $sum=0;\n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,TIME(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded < '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$i]['time']=$arrData;\n $arrRes['data'][$i]['count']=$currSum;\n }\n $arrRes['total']=$sum;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='weekly'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n //\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count;\n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='monthly'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $currMonth.'=='.$currMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $varQuery = \"SELECT pkOrderItemID,ItemType,DATE(ItemDateAdded) as date,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled' AND ItemDateAdded >= '\".$fromTime.\"' AND ItemDateAdded <= '\".$toTime.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $currSum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n $currSum+=$data['revenue'];\n }\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$currSum;\n \n \n //$arrClms = array('DATE(ItemDateAdded) as date');\n //$argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n //$argWhere .= 'AND Status <> \"Canceled\"';\n //\n //$arrData = $this->select($varTable, $arrClms, $argWhere);\n //$count=count($arrData);\n //$arrRes['data'][$key]['dates']=$arrData;\n //$arrRes['data'][$key]['count']=$count;\n //$total +=$count; \n }\n $arrRes['total']=$sum;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "static function get_plan_revenue()\n {\n $cond_str = RestaurantTotalReportDB::get_month_year_string($_REQUEST['from_date'],$_REQUEST['to_date']);\n $sql = 'select\n (bar.name || \\'_\\' || pim.bar_index) as id,\n sum(pim.value) as value,\n pim.portal_id,\n pim.bar_index\n from\n plan_in_month pim\n inner join bar on bar.id = pim.bar\n where\n (pim.month || pim.year) in ('.$cond_str.')\n and pim.bar is not null\n and pim.bar_index is not null\n group by \n bar.name,\n pim.portal_id,\n pim.bar_index\n ';\n $items = DB::fetch_all($sql);\n return $items;\n }", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function display_site_revenue() {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n\t\t\t$company_id=$this->data['company_id'];\n $billingsList = $this->revenue_model->get_all_details(TRANSACTION, array(), array('bill_generated' => 'DESC'));\n\n $req = (empty($_GET['range'])) ? '' : $_GET['range'];\n $this->data['range'] = $range = (empty($_GET['range'])) ? '' : base64_decode(rawUrlDecode($_GET['range']));\n\t\t\t\n\t\t\t$dateFrom = $this->input->get('from'); \n\t\t\t$dateTo = $this->input->get('to');\n\t\t\tif($range == '' && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t$range = $dateFrom.' - '.$dateTo; \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$locationId = $this->input->get('location_id');\n\t\t\t$driverCond = array();\n\t\t\t$driverCond = array('company_id'=>$company_id);\n\t\t\tif($locationId != '' && $locationId != 'all'){\n\t\t\t\t$driverCond = array('driver_location' => $locationId,'company_id'=>$company_id);\n\t\t\t}\n\t\t\t\n $selectFields = array('email', 'image', 'driver_name', 'vehicle_number', 'vehicle_model', 'no_of_rides', 'cancelled_rides', 'mobile_number', 'dail_code');\n $driversCount = $this->revenue_model->get_all_counts(DRIVERS,$driverCond);\n if ($driversCount > 500) {\n $limitPerPage = 100;\n $offsetVal = 0;\n if (isset($_GET['per_page'])) {\n $offsetVal = $this->input->get('per_page');\n }\n\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields, array(), $limitPerPage, $offsetVal);\n\n if(!isset($_GET['range']) && $dateFrom != '' && $dateTo != ''){\n\t\t\t\t\t$manRange = 'from='.urlencode($dateFrom).'&to='.urlencode($dateTo);\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?' . $manRange;\n\t\t\t\t} else {\n\t\t\t\t\t$searchbaseUrl = COMPANY_NAME.'/revenue/display_site_revenue?range=' . $req;\n\t\t\t\t}\n\t\t\t\t\n $config['num_links'] = 3;\n $config['display_pages'] = TRUE;\n $config['page_query_string'] = TRUE;\n $config['base_url'] = $searchbaseUrl;\n $config['total_rows'] = $driversCount;\n $config[\"per_page\"] = $limitPerPage;\n $config[\"uri_segment\"] = 4;\n $config['first_link'] = '';\n $config['last_link'] = '';\n $config['full_tag_open'] = '<ul class=\"tsc_pagination tsc_paginationA tsc_paginationA01\">';\n $config['full_tag_close'] = '</ul>';\n if ($this->lang->line('pagination_prev_lbl') != '') $config['prev_link'] =stripslashes($this->lang->line('pagination_prev_lbl')); else $config['prev_link'] ='Prev';\n $config['prev_tag_open'] = '<li>';\n $config['prev_tag_close'] = '</li>';\n if ($this->lang->line('pagination_next_lbl') != '') $config['next_link'] =stripslashes($this->lang->line('pagination_next_lbl')); else $config['next_link'] ='Next';\n $config['next_tag_open'] = '<li>';\n $config['next_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"current\"><a href=\"javascript:void(0);\" style=\"cursor:default;\">';\n $config['cur_tag_close'] = '</a></li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['first_tag_open'] = '<li>';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_tag_close'] = '</li>';\n if ($this->lang->line('pagination_first_lbl') != '') $config['first_link'] =stripslashes($this->lang->line('pagination_first_lbl')); else $config['first_link'] ='First';\n if ($this->lang->line('pagination_last_lbl') != '') $config['last_link'] = stripslashes($this->lang->line('pagination_last_lbl')); else $config['last_link'] ='Last';\n $this->pagination->initialize($config);\n $paginationLink = $this->pagination->create_links();\n $this->data['paginationLink'] = $paginationLink;\n } else {\n $this->data['paginationLink'] = '';\n $driverDetails = $this->revenue_model->get_selected_fields(DRIVERS, $driverCond, $selectFields);\n }\n \n $dates = @explode('-', $range);\n $mfrom = '';\n $mto = '';\n\n if (count($dates) == 2) {\n $mfrom = trim($dates[0]);\n $mto = trim($dates[1]);\n } else {\n $mto = get_time_to_string(\"m/d/Y\");\n if ($billingsList->num_rows() == 0) {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $mfrom = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n }\n\n if ($billingsList->num_rows() == 0) {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"first day of this month\"));\n } else {\n $last_bill = get_time_to_string(\"m/d/Y\", strtotime(\"+1 day\", MongoEPOCH($billingsList->row()->bill_period_to)));\n }\n\n $filter = '';\n $fromdate = '';\n $todate = '';\n $fdate = '';\n $tdate = '';\n if ($mfrom != \"\" && $mto != \"\") {\n $filter = 'dummy';\n $fromdate = strtotime($mfrom . ' 00:00:00');\n $todate = strtotime($mto . ' 23:59:59');\n }\n $this->data['filter'] = $filter;\n $this->data['last_bill'] = $last_bill;\n\n $cB = get_time_to_string(\"m/d/Y\", $fromdate) . ' - ' . get_time_to_string(\"m/d/Y\", $todate);\n $this->data['cB'] = $cB;\n\n if ($fromdate != '' && $todate != '') {\n $fdate = $fromdate;\n $tdate = $todate;\n }\n\n $totalRides = 0;\n $totalRevenue = 0;\n $siteRevenue = 0;\n $driverRevenue = 0;\n if ($driverDetails->num_rows() > 0) {\n foreach ($driverDetails->result() as $driver) {\n $total_rides = 0;\n $cancelled_rides = 0;\n $successfull_rides = 0;\n $total_revenue = 0;\n $in_site = 0;\n $couponAmount = 0;\n $in_driver = 0;\n $total_due = 0;\n $site_earnings = 0;\n $driver_earnings = 0;\n $tips_amount = 0;\n $tips_in_site = 0;\n $tips_in_driver = 0;\n\n $driver_id = (string) $driver->_id;\n $driver_name = (string) $driver->driver_name;\n $driver_email = (string) $driver->email;\n $driver_phone = (string) $driver->dail_code . $driver->mobile_number;\n $driver_image = USER_PROFILE_IMAGE_DEFAULT;\n if (isset($driver->image)) {\n if ($driver->image != '') {\n $driver_image = USER_PROFILE_IMAGE . $driver->image;\n }\n }\n $rideDetails = $this->revenue_model->get_ride_details_company($driver_id, $fdate, $tdate,$company_id);\n\n if (!empty($rideDetails['result'])) {\n $total_rides = $rideDetails['result'][0]['totalTrips'];\n $total_revenue = $rideDetails['result'][0]['totalAmount'];\n #$in_site = $rideDetails['result'][0]['by_wallet'];\n $couponAmount = $rideDetails['result'][0]['couponAmount'];\n $site_earnings = $rideDetails['result'][0]['site_earnings'];\n $driver_earnings = $rideDetails['result'][0]['driver_earnings'];\n\t\t\t\t\t\t\n if (isset($rideDetails['result'][0]['tipsAmount'])) {\n $tips_amount = $rideDetails['result'][0]['tipsAmount'];\n }\n if (isset($rideDetails['result'][0]['amount_in_site'])) {\n $in_site = $rideDetails['result'][0]['amount_in_site'];\n }\n if (isset($rideDetails['result'][0]['amount_in_driver'])) {\n $in_driver = $rideDetails['result'][0]['amount_in_driver'];\n }\n }\n\n $driver_earnings = $driver_earnings + $tips_amount;\n\n $this->data['driversList'][$driver_id]['id'] = $driver_id;\n $this->data['driversList'][$driver_id]['driver_name'] = $driver_name;\n $this->data['driversList'][$driver_id]['driver_email'] = $driver_email;\n $this->data['driversList'][$driver_id]['driver_image'] = base_url() . $driver_image;\n $this->data['driversList'][$driver_id]['driver_phone'] = $driver_phone;\n\t\t\t\t\t\n\t\t\t\t\t$this->data['driversList'][$driver_id]['total_rides'] = $total_rides;\n $this->data['driversList'][$driver_id]['total_revenue'] = $total_revenue;\n $this->data['driversList'][$driver_id]['in_site'] = $in_site;\n $this->data['driversList'][$driver_id]['couponAmount'] = $couponAmount;\n $this->data['driversList'][$driver_id]['in_driver'] = $in_driver;\n $this->data['driversList'][$driver_id]['total_due'] = $total_due;\n\n $this->data['driversList'][$driver_id]['site_earnings'] = $site_earnings;\n $this->data['driversList'][$driver_id]['driver_earnings'] = $driver_earnings;\n $this->data['driversList'][$driver_id]['driver_tips'] = $tips_amount;\n\t\n }\n } \n $rideSummary = $this->revenue_model->get_ride_summary_company($fdate, $tdate,$company_id,$locationId);\n \n if (!empty($rideSummary['result'])) {\n $totalRides = $rideSummary['result'][0]['totalTrips'];\n $siteRevenue = $rideSummary['result'][0]['site_earnings'];\n $driverRevenue = $rideSummary['result'][0]['driver_earnings'];\n $totalRevenue = $siteRevenue + $driverRevenue;\n }\n\n $this->data['totalRides'] = $totalRides;\n $this->data['totalRevenue'] = $totalRevenue;\n $this->data['siteRevenue'] = $siteRevenue;\n $this->data['driverRevenue'] = $driverRevenue;\n\n $this->data['fromdate'] = $mfrom;\n $this->data['todate'] = $mto;\n\n\n $this->data['billingsList'] = $billingsList;\n\t\t\t\n\t\t\t $this->data['locationList'] = $this->revenue_model->get_all_details(LOCATIONS, array('status' => 'Active'), array('city' => 'ASC'));\n\n if ($this->lang->line('admin_site_earnings_total_revenue_list') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_site_earnings_total_revenue_list')); \n\t\t else $this->data['heading'] = 'Total Revenue List';\n $this->load->view(COMPANY_NAME.'/revenue/display_site_revenue', $this->data);\n }\n }", "public function show(Revenue $revenue)\n {\n return $this->response->item($revenue, new Transformer());\n }", "public function actionPending_revenue() {\n\n /* redirect a user if not super admin */\n if (!Yii::$app->CustomComponents->check_permission('pending_revenue')) {\n return $this->redirect(['site/index']);\n }\n\n $dataService = $this->quickbook_instance();\n $courses_from_qb = $dataService->Query(\"SELECT * FROM Item\");\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $user = Yii::$app->user->identity;\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n $data = Yii::$app->request->post();\n\n $filter_data = array();\n $by_team_arr = array();\n $month_year_arr = array();\n $all_invoice_of_customer = array();\n $allInvoices = array();\n $allPayments = array();\n\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n\n if ($data) {\n\n if ($user_role == 33) {\n $this->pending_revenue_manager_filter();\n } else {\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $user_id = $data['sales_user_id'];\n } else {\n $user_id = $user->id;\n }\n\n if ($user_role == 7) {\n $filters = [];\n } else if ($user_role == 6) {\n $filters = ['sales_user_id' => $data['sales_user_id']];\n } else if ($user_role == 1) {\n $filters = [];\n } else {\n $filters = ['sales_user_id' => $user_id];\n }\n\n $team_ids = array();\n if (isset($data['email']) && $data['email'] != '') {\n $filter_data['email'] = $data['email'];\n }\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n\n $new_date = explode('_', $data['bymonth']);\n $fyear = $new_date['1'];\n $fmonth = $new_date['0'];\n\n if ($fmonth <= 9 && strlen($fmonth) == 1) {\n $fmonth = \"0\" . $fmonth;\n }\n $first_date_of_current_month = date(\"$fyear-$fmonth-01\");\n $last_date_of_current_month = $lastday = date('Y-m-t', strtotime($first_date_of_current_month));\n } else if ($data['by_date_month'] == 'd') {\n $first_date_of_current_month = date(\"Y-m-d\", strtotime($data['sdate']));\n $last_date_of_current_month = date(\"Y-m-d\", strtotime($data['edate']));\n }\n\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $allInvoices = array();\n $qb_cust_id_arr = array();\n\n if ($user_role == 7) {\n \n } else if ($user_role == 6) {\n \n } else if ($user_role != 1) {\n $filter_data['sales_user_id'] = $user->id;\n }\n if (isset($data['by_date_month'])) {\n\n if ($user_role == 7) { /* If current user is not super admin */\n\n if (isset($data['byTeam']) && !empty($data['byTeam'])) {\n $by_team_arr['byTeam'] = $data['byTeam'];\n $byteam = $data['byTeam'];\n if (isset($data['sales_user_id']) && !empty($data['sales_user_id'])) {\n if (count($data['sales_user_id']) == 1 && empty($data['sales_user_id'][0])) {\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = $byteam \")->queryAll();\n $sales_head_str = \"\";\n if (!empty($team_model_val)) {\n foreach ($team_model_val as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str .= $byteam;\n $sales_head_str = rtrim($sales_head_str, \",\");\n\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n $sales_user_id_arr = $data['sales_user_id'];\n if (empty($data['sales_user_id'][0])) {\n $sales_user_id_arr[] = $data['byTeam'];\n }\n\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['in', 'sales_user_id', $sales_user_id_arr])->all();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n if (!empty($data['byTeam'])) {\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id = $team\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n }\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else if ($user_role == 6) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $data['sales_user_id']])->all();\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else if ($user_role != 1) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else { /* If current user is super admin */\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n } else {\n if ($user_role == 7) { /* If current user is not super admin */\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n }\n\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n if ($data['sdate'] != \"\" && $data['by_date_month'] == 'd') {\n $query = DvRegistration::find()\n ->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } elseif ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['assist_participant.id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n\n $query->andWhere(['>', 'qb_customer_id', 0]);\n $query->groupBy(['email']);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 20]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $filter_data['bymonth'] = $data['bymonth'];\n }\n if ($data['by_date_month'] != '') {\n $filter_data['by_date_month'] = $data['by_date_month'];\n }\n\n if ($data['sdate'] != '' && $data['by_date_month'] == 'd') {\n $filter_data['sdate'] = $data['sdate'];\n $filter_data['edate'] = $data['edate'];\n }\n\n if ($data['email'] != \"\") {\n $filter_data['email'] = $data['email'];\n }\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $filter_data['sales_user_id'] = $data['sales_user_id'];\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n\n $invoice_number = \"\";\n $total_of_all_currencys = array();\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n /* echo \"<pre>\";\n print_r($models);\n die; */\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'pagination' => $pagination,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'count' => $offset,\n 'total_count' => $count,\n 'filter_data' => $filter_data,\n 'by_team_arr' => $by_team_arr,\n 'allInvoices' => $allInvoices,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month,\n 'courses_from_qb' => $courses_from_qb\n ]);\n }\n } else {\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n if ($user_role == 1) {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n $query = DvRegistration::find()->where(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 6) {\n $sales_heads = Yii::$app->db->createCommand(\"SELECT assist_users.id FROM assist_users INNER JOIN assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.status = 1 AND assist_users.department = 1 AND assist_user_meta.meta_key = 'team' AND assist_user_meta.meta_value=$user->id\")->queryAll();\n $sales_heads_str = \"\";\n if (!empty($sales_heads)) {\n foreach ($sales_heads as $m_sales_head) {\n $sales_heads_str .= $m_sales_head['id'] . \",\";\n }\n }\n $sales_heads_str .= $user->id;\n $sales_heads_str = rtrim($sales_heads_str, \",\");\n\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_heads_str )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 7) {\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' \")->queryAll();\n\n $executive_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) \")->queryAll();\n $team_model_val[]['uid'] = $user->id;\n $combined_sales_head_arr = array_merge($team_model_val, $executive_model_val);\n\n $sales_head_str = \"\";\n if (!empty($combined_sales_head_arr)) {\n foreach ($combined_sales_head_arr as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str = rtrim($sales_head_str, \",\");\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n /* echo \"<pre>\";\n print_r($all_invoice_of_customer);\n die; */\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['sales_user_id' => $user->id])->andWhere(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n $query->groupBy(['email']);\n $query->orderBy(['id' => SORT_DESC]);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 10]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n // echo \"in\"; die;\n // Start Get Total of different currency \n $invoice_number = \"\";\n $total_of_all_currencys = array();\n\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'pagination' => $pagination,\n 'count' => $offset,\n 'total_count' => $count,\n 'allInvoices' => $allInvoices,\n 'courses_from_qb' => $courses_from_qb,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month\n ]);\n }\n }", "public function retrieveRevenueThisMonth()\n {\n $query = \"SELECT SUM(exlAmount) as thisMonthTotal FROM payment WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));\";\n $result = mysqli_query($GLOBALS['db'], $query);\n $row = mysqli_fetch_assoc($result);\n return $row;\n }", "public function index()\n {\n return Revenue::latest()->paginate(10);\n }", "function list_revenue_type() \n\t\t{\n\t\t\t\n\t\t\t$this->db->order_by('revenue_type_value','ASC');\n\t\t\t\n\t\t\t$query\t\t\t\t\t=\t\t$this->db->get($this->table_name);\n\t\t\t\n\t\t\treturn $query->result();\n\t\t\t\n\t\t}", "public function fetchCostData()\n {\n $finance_pid = $this->getSystemSetting('em-finance-pid');\n\n if (!isset($finance_pid))\n throw new \\Exception('Error: no finance Project ID has been passed');\n\n $custom_field = $this->fetchCustomField();\n\n $fields = array(\n 'module_name',\n 'stanford_module',\n 'module_description',\n 'actual_monthly_cost',\n 'maintenance_fee',\n $custom_field ?? ''\n );\n $params = array('project_id' => $finance_pid, 'return_format' => 'json', 'fields' => $fields, 'events' => 'modules_arm_1', 'filterLogic' => '[actual_monthly_cost] != 0');\n $result = json_decode(\\REDCap::getData($params), true);\n\n if ($result && array_key_exists($custom_field, $result[0]))\n return $this->transformMap($result); //Fetch task record\n else\n throw new \\Exception(\"No field by the name of $custom_field found\");\n }", "public function reports_revenue(Request $request){\n // $reports_salary = DB::table('reservation_details')->orderBy('id','desc')->paginate();\n return view('admin.reports.reports_revenue');\n }", "public function index()\n {\n return \\response()->json(collect(Revenue::latest()->paginate(15)));\n }", "public function revenues()\n {\n return $this->hasMany('App\\revenue','store_id');\n }", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function total_video_revenue() {\n return PayPerView::sum('amount');\n}", "public function getSummaryData();", "public function getLastSevenDaysRevenue() {\n $userClient = Auth::user()->clientID;\n\n if($userClient == 1) {\n \t\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id GROUP BY DATE DESC LIMIT 7\");\n } else {\n\n $result = DB::select(\"SELECT calendar.datefield AS DATE,IFNULL(SUM(r.amount),0) AS total FROM request_logs r RIGHT JOIN calendar ON (DATE(r.date_created) = calendar.datefield) inner join transactions t on t.requestlogID = r.requestlogID inner join client_channels_reference ccr on t.channel_ref_id=ccr.channel_ref_id WHERE ccr.clientID='$userClient' or ccr.destinationClientID='$userClient' GROUP BY DATE DESC LIMIT 7\");\n }\n\n \treturn $result;\n\n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function getDataByID($strDataID)\n{\n global $db;\n $tbl = new cGaConsumablePurchase();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrTemp = getEmployeeInfoByID($db, $dataEdit[$strDataID]['id_employee'], \"employee_id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id_item'];\n $arrResult['dataRequestDate'] = $dataEdit[$strDataID]['request_date'];\n $arrResult['dataItemAmount'] = $dataEdit[$strDataID]['item_amount'];\n $arrResult['dataRemark'] = $dataEdit[$strDataID]['remark'];\n $arrResult['dataConsPurchaseNo'] = $dataEdit[$strDataID]['consumable_purchase_no'];\n $arrResult['dataConsReqNo'] = $dataEdit[$strDataID]['id_consumable_request'];\n //foreach($arrTripCost[$dataDonation ['trip_type']\n return $arrResult;\n}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function getResturantDetails(){\n // $endPrice = $this->_request['endPrice'] != \"undefined\" ? intval ($this->_request['endPrice']) : -1;\n \n $sql = \"select * from resturants r join city c on r.CityId = c.CityID\";\n // if($startPrice!=\"undefined\")\n // {\n // $sql.=\" where r.start_price>=$startPrice \";\n // if($endPrice != -1 )\n // $sql.=\" and r.end_price<=$endPrice\";\n // }\n $rows = $this->executeGenericDQLQuery($sql);\n $resturantDetails = array();\n for($i=0;$i<sizeof($rows);$i++)\n {\n\n\n $resturantDetails[$i]['Name'] =($rows[$i]['Name'] == null || $rows[$i]['Name'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Name'] ;\n $resturantDetails[$i]['Address'] =($rows[$i]['Address'] == null || $rows[$i]['Address'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Address'] ;\n $resturantDetails[$i]['content'] =($rows[$i]['content'] == null || $rows[$i]['content'] ==\"null\") ? \"No Data Available\" : $rows[$i]['content'] ;\n $resturantDetails[$i]['Phone1'] =($rows[$i]['Phone1'] == null || $rows[$i]['Phone1'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone1'] ;\n $resturantDetails[$i]['Phone2'] =($rows[$i]['Phone2'] == null || $rows[$i]['Phone2'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone2'] ;\n $resturantDetails[$i]['Phone3'] =($rows[$i]['Phone3'] == null || $rows[$i]['Phone3'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone3'] ;\n $resturantDetails[$i]['Mobile'] =($rows[$i]['Mobile'] == null || $rows[$i]['Mobile'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Mobile'] ;\n $resturantDetails[$i]['Website'] =($rows[$i]['Website'] == null || $rows[$i]['Website'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Website'] ;\n $resturantDetails[$i]['Category'] =($rows[$i]['Category'] == null) ? 0 : $rows[$i]['Category'] ;\n $resturantDetails[$i]['Facilities'] =$this->getFacilitiesByIds($rows[$i]['Facilities']);\n $resturantDetails[$i]['CityId'] =$rows[$i]['CityId'] ;\n $resturantDetails[$i]['stdCode'] =$rows[$i]['STDCode'] ;\n $resturantDetails[$i]['icon_image'] =($rows[$i]['icon_image'] == null || $rows[$i]['icon_image'] ==\"null\") ? \"img/not_found.jpg\" : $rows[$i]['icon_image'] ;\n $resturantDetails[$i]['home_image'] =($rows[$i]['home_image'] == null || $rows[$i]['home_image'] ==\"null\") ? \"img/not_found.jpg\" : $rows[$i]['home_image'] ;\n \n \n }\n $this->response($this->json($resturantDetails), 200);\n\n }", "public function index()\n {\n $revenues = Revenue::with(['account', 'customer', 'category'])->collect();\n\n return $this->response->paginator($revenues, new Transformer());\n }", "public function getCashReceipt($txn_ref){\n\n $remits = Remittance::where('transaction_reference',$txn_ref)->first();\n $data =[];\n\n if($remits ){\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n $year = substr($remits->month, 0,4);\n $month = substr($remits->month, 5,2);\n $BS = Revenue::select('revenues.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','revenues.invoice','revenues.amount','revenues.created_at as date')\n ->join('users','users.userable_id','revenues.agent_id')\n ->join('services','services.id','revenues.service_id')\n ->join('revenue_points','revenue_points.id','revenues.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('revenues.created_at', '=', $year)\n ->whereMonth('revenues.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n //->where([[DB::raw('date(revenues.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]] )\n ->get();\n\n\n $QP = QuickPrintInvoice::select('quick_print_invoices.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','quick_print_invoices.invoice','quick_print_invoices.amount','quick_print_invoices.created_at as date')\n ->join('users','users.userable_id','quick_print_invoices.agent_id')\n ->join('services','services.id','quick_print_invoices.service_id')\n ->join('revenue_points','revenue_points.id','quick_print_invoices.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('quick_print_invoices.created_at', '=', $year)\n ->whereMonth('quick_print_invoices.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n\n // ->where([[DB::raw('date(quick_print_invoices.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]])\n\n ->get();\n\n\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n if(!empty($invoiceIds)){\n extract($invoiceIds);\n\n $i=0;\n foreach($BS as $bs){\n\n foreach ($b as $id){\n if($bs['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $bs['agentName'];\n $data[$i]['serviceName'] = $bs['serviceName'];\n $data[$i]['lgaName'] = $bs['lgaName'];\n $data[$i]['revPtName'] = $bs['revPtName'];\n $data[$i]['amount'] = $bs['amount'];\n $data[$i]['invoice'] = $bs['invoice'];\n $data[$i]['date'] = $bs['date'];\n $i++;\n }\n }\n }\n\n foreach($QP as $qp){\n\n foreach ($q as $id){\n if($qp['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $qp['agentName'];\n $data[$i]['serviceName'] = $qp['serviceName'];\n $data[$i]['lgaName'] = $qp['lgaName'];\n $data[$i]['revPtName'] = $qp['revPtName'];\n $data[$i]['amount'] = $qp['amount'];\n $data[$i]['invoice'] = $qp['invoice'];\n $data[$i]['date'] = $qp['date'];\n $i++;\n }\n }\n }\n\n }\n\n\n\n }\n\n\n\n\n return response()->json(['status' => 'success',\n 'data' => $data\n ]);\n\n }", "public function get_total_platform_revenue(): void\n {\n $trackingService = new TrackingService();\n create(Customer::class);\n create(Conversion::class, ['platform' => 'trivago', 'revenue' => 10]);\n create(Conversion::class, ['platform' => 'trivago', 'revenue' => 25]);\n $result = $trackingService->getPlatformRevenue('trivago');\n $this->assertEquals($result, 35);\n }", "function getDashboardData() {\n $arrRes=array();\n \n //For Calculating orders count\n $arrClms = 'pkOrderItemID';\n $varTable = TABLE_ORDER_ITEMS;\n $argWhere = 'AND Status <> \"Canceled\"';\n $arrNum = $this->getNumRows($varTable, $arrClms, $argWhere);\n $arrRes['ordersCount']=$arrNum;\n \n //For Calculating Unique visitors count\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR;\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['visitorsCount']=$arrData;\n \n \n //For Calculating Total Revenue(from orders) sum\n $varQuery = \"SELECT pkOrderItemID,ItemType,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled'\";\n $arrData = $this->getArrayResult($varQuery);\n $sum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n }\n //echo $sum;\n \n //pre($arrData);\n $arrRes['revenueSum']=$sum;\n \n //pre($arrRes);\n return $arrRes;\n }", "public function get_revenue_history( $args = array() ) {\n $default_args = array(\n 'group_by' => 'currency_id',\n 'order' => 'ASC',\n 'fields' => array(\n 'currency_id',\n 'SUM(price) AS amount',\n 'COUNT(*) AS quantity',\n 'DATE(date) AS date',\n 'DAY(date) AS day',\n 'MONTH(date) AS month',\n 'HOUR(date) AS hour',\n ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_results( $args );\n }", "public function getPraposalFinsummary( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $loan = null;\n $loanType = null;\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n\n\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $test = Cashflow::where('loan_id', '=', $loanId)->get();\n $fromCashflowTable = Cashflow::periodsCashflowIdMap($loanId);\n //echo $existingPeriodsCashsasflowIdMap[76]->value;\n /* echo \"<pre>\";\n print_r($fromCashflowTable['FY 2017-18(Prov)'][79]->value);\n echo \"</pre>\";*/\n\n \n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._finsummary';\n $formaction = 'Loans\\LoansController@postPraposalFinsummary';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'formaction',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'fromCashflowTable',\n 'validLoanHelper',\n 'userProfileFirm',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'financialDataRecords'\n ));\n }", "private function getStatistik() {\n $SHOW_DAYS = 365;\n self::$today = new DateTime();\n $resultHtml = \"\";\n\n // Jetzt Berechnungen pro Budget:\n $budgets = Persistence::getInstances(\"BUD\", \"name\", false);\n $werte = array();\n $jahre = array();\n $budgetNames = array();\n $budgetAmount = array();\n foreach ($budgets as $budget) {\n $budgetName = $budget->getProperty(\"name\", \"unbekannt\");\n $budgetNames[\"\" . $budgetName] = \"$budgetName\";\n $budgetZeitraum = $budget->getProperty(\"zeitraum\", \"\") == \"\" ? \"\" : \" \" . $budget->getProperty(\"zeitraum\", \"\");\n $budgetAmount[\"\" . $budgetName] = $budget->getProperty(\"btotal\", \"\") . $budgetZeitraum;\n if (!isset($werte[\"$budgetName\"])) {\n $werte[\"$budgetName\"] = array();\n }\n $instances = Persistence::getInstances(\"ARB\", \"datum\", false, $budget->getId(), true);\n $resultData = array();\n foreach ($instances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n $kaz = $instance->getProperty(ARB::PROPERTY_KAZ, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= \"2017\") {\n $jahre[\"\" . $jahr] = \"\" . \"$jahr\";\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] = 0;\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"] = array();\n }\n if (!isset($werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat])) {\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] = 0;\n }\n $wert = $kaz != \"\" && $h != \"\" ? ($kaz > $h ? $kaz : $h) : ($kaz != \"\" ? $kaz : ($h != \"\" ? $h : 0));\n $werte[\"$budgetName\"][\"\" . $jahr][\"monate\"][\"\" . $monat] += $wert;\n $werte[\"$budgetName\"][\"\" . $jahr][\"Jahr\"] += $wert;\n }\n }\n }\n ksort($jahre);\n $monatWerte = array();\n $jahresWerte = array();\n foreach ($budgetNames as $budgetName) {\n $budgetWert[$budgetName] = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][$jahr . \"\"][\"\" . $monat] = 0;\n }\n }\n $jahresWerte[$budgetName][$jahr . \"\"] = 0;\n }\n }\n foreach ($werte as $budgetName => $jahrWerte) {\n foreach ($jahrWerte as $jahr => $jahrUndMonatWerte) {\n $jahresWerte[$budgetName][$jahr . \"\"] = $jahrUndMonatWerte[\"Jahr\"];\n foreach ($jahrUndMonatWerte[\"monate\"] as $monat => $wert) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n if (!self::isOlder($jahr, $monat, $SHOW_DAYS)) {\n $monatWerte[$budgetName][\"\" . $jahr][\"\" . $monat] = $wert;\n }\n }\n }\n }\n\n // Summen über alle ARB Instanzen berechnen (Budget unabhaengig, da ARB Instanzen\n // mehreren Budgets gleichzeitig zugeordnet sein koennen\n $monatSumme = array();\n $jahrSumme = array();\n foreach ($jahre as $jahr) {\n foreach (array(\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\") as $monat) {\n // Monatswerte nur fuer die letzten 365 Tage aufnehmen:\n $monatSumme[\"$jahr-$monat\"] = 0;\n }\n $jahrSumme[\"$jahr\"] = 0;\n }\n $arbInstances = Persistence::getInstances(\"ARB\", \"datum\", false, \"\", true);\n foreach ($arbInstances as $instance) {\n $h = $instance->getProperty(ARB::PROPERTY_STUNDEN, 0);\n list($tag, $monat, $jahr) = explode(\".\", $instance->getProperty(ARB::PROPERTY_DATUM, \"01.01.1800\"));\n if ($jahr >= 2017 && is_numeric($h)) {\n $jahrSumme[\"$jahr\"] += $h;\n $monatSumme[\"$jahr-$monat\"] += $h;\n }\n }\n\n // Darstellung:\n $table = \"<table>\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $table .= \"<tr><td>Budget</td><td style='width: 90px;'>Max</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n $table .= \"<td>\" . $monat . \"/\" . ($jahr - 2000) . \"</td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n $table .= \"<td>$jahr</td>\";\n }\n break;\n }\n $table .= \"</tr>\";\n\n $trclass = \"odd\";\n foreach ($monatWerte as $budgetName => $jahrWerte) {\n $trclass = $trclass == \"odd\" ? \"even\" : \"odd\";\n $strong = \"\";\n foreach (array(\"#022\", \"#028\", \"#030\", \"#034\", \"#039\", \"400059\", \"412622\") as $s) {\n if (strpos($budgetName, $s) !== false) {\n $strong = \"strong\";\n }\n }\n $tr = \"<tr class='$trclass $strong'><td><span title='$budgetName'><span style='padding-right: 20px;'>\" . substr($budgetName, 0, 80) . \"</span></td>\";\n $tr .= \"<td>\" . $budgetAmount[\"\" . $budgetName] . \"</td>\";\n foreach ($jahrWerte as $jahr => $monate) {\n foreach ($monate as $monat => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozentm= (stripos($budgetName, \"unproduktiv\") !== false && $monatSumme[\"$jahr-$monat\"] > 0) ? round(($wert / $monatSumme[\"$jahr-$monat\"]) * 100, 0) . \"%\" : \"\";\n $title = \"$prozentm = $wert/\" . $monatSumme[\"$jahr-$monat\"] . \" h @ \";\n $title .= \"$jahr-$monat: $budgetName\";\n $tr .= \"<td title='$title' style='width: 60px;'>$wert<br><strong>$prozentm</strong></td>\";\n }\n }\n foreach ($jahresWerte[$budgetName] as $jahr => $wert) {\n // fuer unproduktive auch die % darstellen:\n $prozent = $jahrSumme[\"$jahr\"] > 0 ? round((($wert / $jahrSumme[\"$jahr\"]) * 100), 1) . \"%\" : \"\";\n $title = (stripos($budgetName, \"unproduktiv\") !== false ? \"$prozent = $wert/\" . $jahrSumme[\"$jahr\"] . \" h\" : \"\");\n $text = $title == \"\" ? \"\" : \"<br><strong>$prozent</strong>\";\n $tr .= \"<td title='$title' style='width: 80px;'>$wert$text</td>\";\n }\n $tr .= \"</tr>\";\n $table .= \"$tr\";\n }\n $table .= \"</table>\";\n\n return \"$table\";\n }", "function getPurchaseProductionInfo($id_purchase,$id_purchase_production) {\n $data = $this->db\n ->where('id_purchase',$id_purchase)\n ->where('id_purchase_production',$id_purchase_production)\n ->limit(1)\n ->get('purchase_production')\n ->row_array();\n \n return $data;\n }", "public function show($id)\n {\n return response()->json(Revenue::findOrFail($id));\n }", "public function Individualgetdata();", "public function index()\n {\n $user = Auth::user();\n $user->authorizeRoles(['College Admin', 'College Super Admin']);\n $institution = $user->institution();\n $collegeName = $user->collegeName;\n\n $revenues = array();\n /** @var College $college */\n foreach ($institution->colleges as $college)\n if ($college->collegeName->id == $collegeName->id)\n foreach ($college->internalRevenues as $internalRevenue)\n $revenues[] = $internalRevenue;\n\n $data = array(\n 'internal_revenues' => $revenues,\n 'page_name' => 'budgets.internal-revenue.index'\n );\n return view('budgets.internal_revenue.index')->with($data);\n }", "public function getReimbursementData()\n {\n return $this->db->get(\"reimburse_details\")->result_array();\n }", "public function get() {\n $this->data = array(\n 101222 => array('label' => 'Awesome product', 'price' => 10.50, 'date_added' => '2012-02-01'),\n 101232 => array('label' => 'Not so awesome product', 'price' => 5.20, 'date_added' => '2012-03-20'),\n 101241 => array('label' => 'Pretty neat product', 'price' => 9.65, 'date_added' => '2012-04-15'),\n 101256 => array('label' => 'Freakishly cool product', 'price' => 12.55, 'date_added' => '2012-01-11'),\n 101219 => array('label' => 'Meh product', 'price' => 3.69, 'date_added' => '2012-06-11'),\n );\n }", "public function get() {\n\t\t$this->data = array(\n\t\t\t101222 => array('label' => 'Awesome product', 'price' => 10.50, 'date_added' => '2012-02-01'),\n\t\t\t101232 => array('label' => 'Not so awesome product', 'price' => 5.20, 'date_added' => '2012-03-20'),\n\t\t\t101241 => array('label' => 'Pretty neat product', 'price' => 9.65, 'date_added' => '2012-04-15'),\n\t\t\t101256 => array('label' => 'Freakishly cool product', 'price' => 12.55, 'date_added' => '2012-01-11'),\n\t\t\t101219 => array('label' => 'Meh product', 'price' => 3.69, 'date_added' => '2012-06-11'),\n\t\t);\n\t}", "public function run()\n\t{\n\t\t$produtos = collect([\n\t\t\t[\n\t\t\t\t'isbn' => '9788547000646',\n\t\t\t\t'nome' => 'Minha História',\n\t\t\t\t'autor' => 'Michelle Obama',\n\t\t\t\t'sinopse' => 'Um relato íntimo, poderoso e inspirador da ex-primeira-dama dos Estados Unidos. O livro que já vendeu mais de 10 milhões de exemplares no mundo e está há mais de 50 semanas na lista de mais vendidos da Veja. Com uma vida repleta de realizações significativas, Michelle Obama se consolidou como uma das mulheres mais icônicas e cativantes de nosso tempo. Como primeira-dama dos Estados Unidos — a primeira afro-americana a ocupar essa posição —, ela ajudou a criar a mais acolhedora e inclusiva Casa Branca da história. Ao mesmo tempo, se posicionou como uma poderosa porta-voz das mulheres e meninas nos Estados Unidos e ao redor do mundo, mudando drasticamente a forma como as famílias levam suas vidas em busca de um modelo mais saudável e ativo, e se posicionando ao lado de seu marido durante os anos em que Obama presidiu os Estados Unidos em alguns dos momentos mais angustiantes da história do país. Ao longo do caminho, ela nos ensinou alguns passos de dança, arrasou no Carpool Karaoke e criou duas filhas responsáveis e centradas, apesar do impiedoso olhar da mídia.Em suas memórias, um trabalho de profunda reflexão e com uma narrativa envolvente, Michelle Obama convida os leitores a conhecer seu mundo, recontando as experiências que a moldaram — da infância na região de South Side, em Chicago, e os seus anos como executiva tentando equilibrar as demandas da maternidade e do trabalho, ao período em que passou no endereço mais famoso do mundo. Com honestidade e uma inteligência aguçada, ela descreve seus triunfos e suas decepções, tanto públicas quanto privadas, e conta toda a sua história, conforme a viveu — em suas próprias palavras e em seus próprios termos. Reconfortante, sábio e revelador, Minha história traz um relato íntimo e singular, de uma mulher com alma e consistência que desafiou constantemente as expectativas — e cuja história nos inspira a fazer o mesmo.',\n\t\t\t\t'id_categoria' => 'Biografia',\n\t\t\t\t'numero_paginas' => '464',\n\t\t\t\t'ano_publicacao' => '2018',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Objetiva',\n\t\t\t\t'preco' => '50,32',\n\t\t\t\t'imagem' => '../img/livros/9788547000646.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788535923438',\n\t\t\t\t'nome' => 'Eu sou Malala',\n\t\t\t\t'autor' => 'Malala Yousafzai',\n\t\t\t\t'sinopse' => 'Quando o Talibã tomou controle do vale do Swat, uma menina levantou a voz. Malala Yousafzai recusou-se a permanecer em silêncio e lutou pelo seu direito à educação. Mas em 9 de outubro de 2012, uma terça-feira, ela quase pagou o preço com a vida. Malala foi atingida na cabeça por um tiro à queima-roupa dentro do ônibus no qual voltava da escola. Poucos acreditaram que ela sobreviveria. Mas a recuperação milagrosa de Malala a levou em uma viagem extraordinária de um vale remoto no norte do Paquistão para as salas das Nações Unidas em Nova York. Aos dezesseis anos, ela se tornou um símbolo global de protesto pacífico e a candidata mais jovem da história a receber o Prêmio Nobel da Paz. Eu sou Malala é a história de uma família exilada pelo terrorismo global, da luta pelo direito à educação feminina e dos obstáculos à valorização da mulher em uma sociedade que valoriza filhos homens. O livro acompanha a infância da garota no Paquistão, os primeiros anos de vida escolar, as asperezas da vida numa região marcada pela desigualdade social, as belezas do deserto e as trevas da vida sob o Talibã. Escrito em parceria com a jornalista britânica Christina Lamb, este livro é uma janela para a singularidade poderosa de uma menina cheia de brio e talento, mas também para um universo religioso e cultural cheio de interdições e particularidades, muitas vezes incompreendido pelo Ocidente.',\n\t\t\t\t'id_categoria' => 'Biografia',\n\t\t\t\t'numero_paginas' => '360',\n\t\t\t\t'ano_publicacao' => '2013',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Companhia Das Letras',\n\t\t\t\t'preco' => '44,90',\n\t\t\t\t'imagem' => '../img/livros/9788535923438.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788576082675',\n\t\t\t\t'nome' => 'Código Limpo: Habilidades Práticas do Agile Software',\n\t\t\t\t'autor' => 'Robert C. Martin',\n\t\t\t\t'sinopse' => 'O renomado especialista em software, Robert C. Martin, apresenta um paradigma revolucionário com Código limpo: Habilidades Práticas do Agile Software. Martin se reuniu com seus colegas do Mentor Object para destilar suas melhores e mais ágeis práticas de limpar códigos “dinamicamente” em um livro que introduzirá gradualmente dentro de você os valores da habilidade de um profissional de softwares e lhe tornar um programador melhor –mas só se você praticar.',\n\t\t\t\t'id_categoria' => 'Informática',\n\t\t\t\t'numero_paginas' => '456',\n\t\t\t\t'ano_publicacao' => '2009',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Alta Books',\n\t\t\t\t'preco' => '96,90',\n\t\t\t\t'imagem' => '../img/livros/9788576082675.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788550800653',\n\t\t\t\t'nome' => 'Domain-Driven Design: Atacando as Complexidades no Coração do Software',\n\t\t\t\t'autor' => 'Eric Evans',\n\t\t\t\t'sinopse' => 'Reunindo práticas de design e implementação, este livro incorpora vários exemplos baseados em projetos que ilustram a aplicação do design dirigido por domínios no desenvolvimento de softwares na vida real.',\n\t\t\t\t'id_categoria' => 'Informática',\n\t\t\t\t'numero_paginas' => '528',\n\t\t\t\t'ano_publicacao' => '2016',\n\t\t\t\t'edicao' => '3',\n\t\t\t\t'editora' => 'Alta Books',\n\t\t\t\t'preco' => '63,00',\n\t\t\t\t'imagem' => '../img/livros/9788550800653.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788584424573',\n\t\t\t\t'nome' => 'Drácula - Edição De Luxo',\n\t\t\t\t'autor' => 'Bram Stoker',\n\t\t\t\t'sinopse' => 'Bram Stoker é o criador genial de uma das mais famosas e horripilantes histórias de terror de todos os tempos. Drácula é uma história de vampiros e lobisomens, de criaturas que estando mortas permanecem vivas. Baseado no folclore da Transilvânia e num personagem real (o rei Vlad, o Empalador), redigiu um relato que tem assombrado gerações consecutivas de leitores, transformando-se num mito adaptado para o cinema, quadrinhos e TV, talvez o mais significativo destes últimos dois séculos. Na história, um jovem inglês é mantido em cativeiro, à espera de um destino terrível. Longe dele, sua noiva bela e jovem é atacada por uma doença misteriosa que parece extrair o sangue de suas veias. Por trás de tudo, a força sinistra que ameaça suas vidas: Conde Drácula, o vampiro vindo do fundo dos séculos.',\n\t\t\t\t'id_categoria' => 'Literatura Estrangeira',\n\t\t\t\t'numero_paginas' => '432',\n\t\t\t\t'ano_publicacao' => '2019',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Pandorga',\n\t\t\t\t'preco' => '59,90',\n\t\t\t\t'imagem' => '../img/livros/9788584424573.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788594318237',\n\t\t\t\t'nome' => 'O Morro Dos Ventos Uivantes',\n\t\t\t\t'autor' => 'Emily Brontë',\n\t\t\t\t'sinopse' => 'Único romance da escritora inglesa Emily Bronte, O morro dos ventos uivantes retrata uma trágica historia de amor e obsessão em que os personagens principais são a obstinada e geniosa Catherine Earnshaw e seu irmão adotivo, Heathcliff. Grosseiro, humilhado e rejeitado, ele guarda apenas rancor no coração, mas tem com Catherine um relaciona- mento marcado por amor e, ao mesmo tempo, ódio. Essa ligação perdura mesmo com o casamento de Catherine com Edgar Linton.',\n\t\t\t\t'id_categoria' => 'Literatura Estrangeira',\n\t\t\t\t'numero_paginas' => '368',\n\t\t\t\t'ano_publicacao' => '2019',\n\t\t\t\t'edicao' => '2',\n\t\t\t\t'editora' => 'Principis',\n\t\t\t\t'preco' => '19,90',\n\t\t\t\t'imagem' => '../img/livros/9788594318237.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788525056009',\n\t\t\t\t'nome' => 'Admirável Mundo Novo',\n\t\t\t\t'autor' => 'Aldous Huxley',\n\t\t\t\t'sinopse' => 'Uma sociedade inteiramente organizada segundo princípios científicos, na qual a mera menção das antiquadas palavras “pai” e “mãe” produzem repugnância. Um mundo de pessoas programadas em laboratório, e adestradas para cumprir seu papel numa sociedade de castas biologicamente definidas já no nascimento. Um mundo no qual a literatura, a música e o cinema só têm a função de solidificar o espírito de conformismo. Um universo que louva o avanço da técnica, a linha de montagem, a produção em série, a uniformidade, e que idolatra Henry Ford. Essa é a visão desenvolvida no clarividente romance distópico de Aldous Huxley, que ao lado de 1984, de George Orwell, constituem os exemplos mais marcantes, na esfera literária, da tematização de estados autoritários. Se o livro de Orwell criticava acidamente os governos totalitários de esquerda e de direita, o terror do stalinismo e a barbárie do nazifascismo, em Huxley o objeto é a sociedade capitalista, industrial e tecnológica, em que a racionalidade se tornou a nova religião, em que a ciência é o novo ídolo, um mundo no qual a experiência do sujeito não parece mais fazer nenhum sentido, e no qual a obra de Shakespeare adquire tons revolucionários. Entretanto, o moderno clássico de Huxley não é um mero exercício de futurismo ou de ficção científica. Trata-se, o que é mais grave, de um olhar agudo acerca das potencialidades autoritárias do próprio mundo em que vivemos.',\n\t\t\t\t'id_categoria' => 'Literatura Estrangeira',\n\t\t\t\t'numero_paginas' => '312',\n\t\t\t\t'ano_publicacao' => '2014',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Biblioteca Azul',\n\t\t\t\t'preco' => '44,90',\n\t\t\t\t'imagem' => '../img/livros/9788525056009.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788532508126',\n\t\t\t\t'nome' => 'A Hora da Estrela',\n\t\t\t\t'autor' => 'Clarice Lispector',\n\t\t\t\t'sinopse' => 'Entre a realidade e o delírio, buscando o social enquanto sua alma a engolfava, Clarice escreveu um livro singular. \"A Hora da Estrela\" é um romance sobre o desamparo a que, apesar da linguagem, todos estamos entregues.',\n\t\t\t\t'id_categoria' => 'Literatura Nacional',\n\t\t\t\t'numero_paginas' => '88',\n\t\t\t\t'ano_publicacao' => '1998',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Rocco',\n\t\t\t\t'preco' => '19,90',\n\t\t\t\t'imagem' => '../img/livros/9788532508126.jpg'\n\t\t\t],\n\n\t\t\t[\n\t\t\t\t'isbn' => '9788520927823',\n\t\t\t\t'nome' => 'O Cortiço',\n\t\t\t\t'autor' => 'Aluísio de Azevedo',\n\t\t\t\t'sinopse' => 'Publicado em 1890, é considerado uma obra-prima do Naturalismo brasileiro. Apesar da influência notável de Émile Zola, o vigor e a originalidade da narrativa que abordou os problemas sociais de fins do século XIX, possuindo como “cenário” principal um cortiço, são perceptíveis. Pintor de variada galeria de tipos e da representação do cotidiano, Aluísio Azevedo ficou conhecido por seu traço forte e principalmente por personificar a fase naturalista brasileira.',\n\t\t\t\t'id_categoria' => 'Literatura Nacional',\n\t\t\t\t'numero_paginas' => '272',\n\t\t\t\t'ano_publicacao' => '2016',\n\t\t\t\t'edicao' => '1',\n\t\t\t\t'editora' => 'Nova Fronteira',\n\t\t\t\t'preco' => '19,90',\n\t\t\t\t'imagem' => '../img/livros/9788520927823.jpg'\n\t\t\t],\n\t\t]);\n\n\n\t\t$produtos->map(function ($item) {\n\t\t\t$novoProduto = new Produto();\n\t\t\t$novoProduto->isbn = $item['isbn'];\n\t\t\t$novoProduto->nome = $item['nome'];\n\t\t\t$novoProduto->autor = $item['autor'];\n\t\t\t$novoProduto->sinopse = $item['sinopse'];\n\t\t\t$novoProduto->id_categoria = DB::table('produto_categoria')->where('nome_categoria', $item['id_categoria'])->value('id_categoria');\n\t\t\t$novoProduto->numero_paginas = $item['numero_paginas'];\n\t\t\t$novoProduto->ano_publicacao = $item['ano_publicacao'];\n\t\t\t$novoProduto->edicao = $item['edicao'];\n\t\t\t$novoProduto->editora = $item['editora'];\n\t\t\t$novoProduto->preco = $item['preco'];\n\t\t\t$novoProduto->imagem = $item['imagem'];\n\t\t\t$novoProduto->save();\n\t\t});\n\t}", "public function getMultipleData()\n\t{\n\t\t$calculatedData = $this->getCalculatedData();\n\t\t$items = [];\n\t\t$amountDealCurrencyId = \\CCrmCurrency::GetAccountCurrencyID();\n\n\t\t$config = [\n\t\t\t'title' => $this->getFormElement('label')->getValue()\n\t\t];\n\n\t\tif (!empty($calculatedData))\n\t\t{\n\t\t\t$calculateField = $this->getFormElement('calculate');\n\t\t\t$calculateValue = $calculateField ? $calculateField->getValue() : null;\n\n\t\t\t$shortModeField = $this->getFormElement('shortMode');\n\t\t\t$shortModeValue = $shortModeField ? $shortModeField->getValue() : false;\n\n\t\t\tswitch ($calculateValue)\n\t\t\t{\n\t\t\t\tcase self::WHAT_WILL_CALCULATE_DEAL_CONVERSION:\n\t\t\t\t\t$config['mode'] = 'singleData';\n\t\t\t\t\t$config['unitOfMeasurement'] = '%';\n\t\t\t\t\t$item['value'] = round($calculatedData['withoutGrouping'], 2);\n\t\t\t\t\t$item['color'] = '#9DCF00';\n\t\t\t\t\t$items[] = $item;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$itemCount = 0;\n\t\t\t\t\tforeach ($calculatedData as $key => $data)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ($key === 'amount') //TODO: optimise calculating of amount values\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$item = [\n\t\t\t\t\t\t\t'label' => $data['title'],\n\t\t\t\t\t\t\t'value' => $data['value'],\n\t\t\t\t\t\t\t'color' => $data['color']\n\t\t\t\t\t\t];\n\n\n\n\t\t\t\t\t\tif ($calculateValue === self::WHAT_WILL_CALCULATE_DEAL_DATA_FOR_FUNNEL\n\t\t\t\t\t\t\t|| $calculateValue === self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->isConversionCalculateMode())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$item['link'] = $this->getTargetUrl('/crm/deal/analytics/list/', [\n\t\t\t\t\t\t\t\t\t'STAGE_ID_FROM_SUPPOSED_HISTORY' => $key\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$item['link'] = $this->getTargetUrl('/crm/deal/analytics/list/', [\n\t\t\t\t\t\t\t\t\t'STAGE_ID_FROM_HISTORY' => $key\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$config['additionalValues']['firstAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_COUNT_SHORT_TITLE'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$item['additionalValues']['firstAdditionalValue'] = [\n\t\t\t\t\t\t\t'value' => $data['value']\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (isset($data['additionalValues']['sum']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$amountDealCurrencyId = $data['additionalValues']['sum']['currencyId'];\n\t\t\t\t\t\t\t$config['additionalValues']['secondAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_SUM_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$item['additionalValues']['secondAdditionalValue'] = [\n\t\t\t\t\t\t\t\t'value' => \\CCrmCurrency::MoneyToString(\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['sum']['VALUE'],\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['sum']['currencyId']\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'currencyId' => $data['additionalValues']['sum']['currencyId']\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($data['additionalValues']['avgSpentTime']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$config['additionalValues']['thirdAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_SPENT_TIME_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$item['additionalValues']['thirdAdditionalValue'] = [\n\t\t\t\t\t\t\t\t'value' => $this->getFormattedPassTime(\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['avgSpentTime']['VALUE']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$stageSemanticId = \\CCrmDeal::GetSemanticID($key);\n\t\t\t\t\t\t$config['additionalValues']['forthAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$item['additionalValues']['forthAdditionalValue'] = [\n\t\t\t\t\t\t\t'title' => PhaseSemantics::isLost($stageSemanticId) ?\n\t\t\t\t\t\t\t\t\t\t\tLoc::getMessage(\"CRM_REPORT_DEAL_HANDLER_DEAL_LOSSES_SHORT_TITLE\")\n\t\t\t\t\t\t\t\t\t\t\t: Loc::getMessage(\"CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE\"),\n\t\t\t\t\t\t\t'value' => $calculatedData['amount']['value'] ? round(\n\t\t\t\t\t\t\t\t($data['value'] / $calculatedData['amount']['value']) * 100,\n\t\t\t\t\t\t\t\t2\n\t\t\t\t\t\t\t) : 0,\n\t\t\t\t\t\t\t'unitOfMeasurement' => '%',\n\t\t\t\t\t\t\t'helpLink' => 'someLink',\n\t\t\t\t\t\t\t'helpInSlider' => true\n\t\t\t\t\t\t];\n\t\t\t\t\t\t//hidden conversion on first column\n\t\t\t\t\t\tif ($calculateValue !== self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL && $itemCount < 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($item['additionalValues']['forthAdditionalValue']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$itemCount++;\n\n\n\n\t\t\t\t\t\t$items[] = $item;\n\t\t\t\t\t}\n\n\t\t\t\t\t$calculateField = $this->getFormElement('calculate');\n\t\t\t\t\t$calculateValue = $calculateField ? $calculateField->getValue() : null;\n\n\t\t\t\t\t$config['titleShort'] = Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_COUNT_SHORT_TITLE');\n\n\t\t\t\t\t$config['valuesAmount'] = [\n\t\t\t\t\t\t'firstAdditionalAmount' => [\n\t\t\t\t\t\t\t'title' => Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_SUM_SHORT_TITLE'),\n\t\t\t\t\t\t\t'value' => \\CCrmCurrency::MoneyToString(\n\t\t\t\t\t\t\t\t$calculatedData['amount']['sum'],\n\t\t\t\t\t\t\t\t$amountDealCurrencyId\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'targetUrl' => $this->getTargetUrl('/crm/deal/analytics/list/'),\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\n\t\t\t\t\tif ($calculatedData['amount']['successPassTime'] ?? false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$config['valuesAmount']['secondAdditionalAmount'] = [\n\t\t\t\t\t\t\t'title' => Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_PASS_AVG_TIME_SHORT_TITLE'),\n\t\t\t\t\t\t\t'value' => $this->getFormattedPassTime($calculatedData['amount']['successPassTime'])\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ($calculateValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL:\n\t\t\t\t\t\t\t$config['topAdditionalTitle'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$config['topAdditionalValue'] = !empty($items[0]['additionalValues']['forthAdditionalValue']['value'])\n\t\t\t\t\t\t\t\t? $items[0]['additionalValues']['forthAdditionalValue']['value'] : 0;\n\t\t\t\t\t\t\t$config['topAdditionalValueUnit'] = '%';\n\t\t\t\t\t\t\t$config['valuesAmount']['firstAdditionalAmount']['value'] =\n\t\t\t\t\t\t\t\t($items[0]['additionalValues']['secondAdditionalValue']['value'] ?? null)\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t//$config['valuesAmount']['secondAdditionalAmount']['value'] =\n\t\t\t\t\t\t\t// $items[0]['additionalValues']['thirdAdditionalValue']['value']\n\t\t\t\t\t\t\t//;\n\n\t\t\t\t\t\t\tif ($shortModeValue)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$config['mode'] = 'singleData';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($config['valuesAmount']['thirdAdditionalAmount']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$result = [\n\t\t\t'items' => $items,\n\t\t\t'config' => $config,\n\t\t];\n\n\t\treturn $result;\n\t}", "function ledger($conn){\n $revenue=\"SELECT * FROM fees_details_summary\";\n $revenue=$conn->query($revenue);\n while ($r=$revenue->fetch_assoc()){\n\n echo \"\n <tr class='gradeX'> \n <td>\".$r['revenue'].\"</td>\n <td>\".$r['total'].\"</td>\n <td><a href='account.php?user=fees.income.details&data=\".$r['revenueID'].\"&sort=\".$r['revenue'].\"&error=0&alert=1' class='btn btn-mini btn-xs btn-danger'><span class='glyphicon glyphicon-trash'></span>View Details</a></a></tr>\n \";\n }\n}", "public function getRevenue()\n {\n $order = $this->checkoutSession->getLastRealOrder();\n\n return $order->getData('total_due');\n }", "public function getCurrentMonthTotalRevenue() : float;", "public function model(){\n\t\treturn CategoryRevenue::class;\n\t}", "private function _get_itemreport_customs_old($usr_profitview, $profitview, $start_date, $end_report, $brand) {\n\n $profit_type = $usr_profitview;\n $cust_scryears=$customs=$custom_keys=array();\n\n foreach ($profitview as $prow) {\n if ($prow['websys_page_link'] == 'itemsalescustoms') {\n $profit_type = $prow['profit_view'];\n }\n }\n $this->db->select(\"date_format(from_unixtime(o.order_date),'%Y') as repyear, date_format(from_unixtime(o.order_date),'%m') as repmonth\", FALSE);\n $this->db->select('count(o.order_id) as cnt_orders, sum(o.revenue) as revenue, sum(o.profit) as profit');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $start_date);\n $this->db->where('o.order_date < ', $end_report);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->group_by('repyear, repmonth');\n $this->db->order_by('repyear, repmonth');\n $custom_monthdat = $this->db->get()->result_array();\n foreach ($custom_monthdat as $row) {\n $profitval = floatval($row['profit']);\n $profitpnts = round($profitval * $this->config->item('profitpts'), 0);\n // 3 Special Users - Robert - 19, Sage -3, Sean - 1\n $startmonth = strtotime($row['repyear'] . '-' . $row['repmonth'] . '-01');\n $endmonth = strtotime(date(\"Y-m-d\", $startmonth) . \" +1 month\");\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 19);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $robres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 3);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $sageres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 1);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $seanres = $this->db->get()->row_array();\n $customs[] = array(\n 'year' => $row['repyear'],\n 'month' => $row['repmonth'],\n 'numorders' => intval($row['cnt_orders']),\n 'revenue' => floatval($row['revenue']),\n 'profit' => $profitval,\n 'profitpnts' => $profitpnts,\n 'rob' => $robres['cnt_orders'],\n 'sage' => $sageres['cnt_orders'],\n 'sean' => $seanres['cnt_orders'],\n );\n array_push($custom_keys, $row['repyear'] . '-' . $row['repmonth']);\n }\n $this->db->select(\"date_format(from_unixtime(o.order_date),'%Y') as repyear, date_format(from_unixtime(o.order_date),'%m') as repmonth\", FALSE);\n $this->db->select('count(o.order_id) as cnt_orders, sum(o.revenue) as revenue, sum(o.profit) as profit');\n $this->db->from('ts_orders o');\n $this->db->join(\"(select distinct(order_id) from ts_order_items where item_id={$this->config->item('custom_id')}) oi\", \"oi.order_id=o.order_id\");\n $this->db->where('o.item_id != ', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $start_date);\n $this->db->where('o.order_date < ', $end_report);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $this->db->group_by('repyear, repmonth');\n $this->db->order_by('repyear, repmonth');\n $custom_monthotherdat = $this->db->get()->result_array();\n\n foreach ($custom_monthotherdat as $row) {\n // 3 Special Users - Robert - 19, Sage -3, Sean - 1\n $startmonth = strtotime($row['repyear'] . '-' . $row['repmonth'] . '-01');\n $endmonth = strtotime(date(\"Y-m-d\", $startmonth) . \" +1 month\");\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 19);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $robres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 3);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $sageres = $this->db->get()->row_array();\n $this->db->select('count(o.order_id) as cnt_orders');\n $this->db->from('ts_orders o');\n $this->db->where('o.item_id', $this->config->item('custom_id'));\n $this->db->where('o.is_canceled', 0);\n $this->db->where('o.order_date >= ', $startmonth);\n $this->db->where('o.order_date < ', $endmonth);\n $this->db->where('o.order_usr_repic', 1);\n if ($brand!=='ALL') {\n if ($brand=='SR') {\n $this->db->where('o.brand', $brand);\n } else {\n $this->db->where_in('o.brand', ['BT','SB']);\n }\n }\n $seanres = $this->db->get()->row_array();\n $key = $row['repyear'] . '-' . $row['repmonth'];\n if (!in_array($key, $custom_keys)) {\n array_push($custom_keys, $key);\n $customs[] = array(\n 'year' => $row['repyear'],\n 'month' => $row['repmonth'],\n 'numorders' => intval($row['cnt_orders']),\n 'revenue' => floatval($row['revenue']),\n 'profit' => floatval($row['profit']),\n 'profitpnts' => round(floatval($row['profit']) * $this->config->item('profitpts'), 0),\n 'rob' => $robres['cnt_orders'],\n 'sage' => $sageres['cnt_orders'],\n 'sean' => $seanres['cnt_orders'],\n );\n } else {\n $cidx = 0;\n foreach ($customs as $crow) {\n if ($crow['month'] == $row['repmonth'] && $crow['year'] == $row['repyear']) {\n $customs[$cidx]['numorders'] += $row['cnt_orders'];\n $customs[$cidx]['revenue'] += $row['revenue'];\n $customs[$cidx]['profit'] += $row['profit'];\n $customs[$cidx]['profitpnts'] += round(floatval($row['profit']) * $this->config->item('profitpts'), 0);\n $customs[$cidx]['rob'] += $robres['cnt_orders'];\n $customs[$cidx]['sage'] += $sageres['cnt_orders'];\n $customs[$cidx]['sean'] += $seanres['cnt_orders'];\n } else {\n $cidx++;\n }\n }\n }\n }\n\n // Manage Customs\n for ($i = $this->salestype_start; $i < intval(date('Y')); $i++) {\n $total = array(\n 'numorders' => $this->empty_show,\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $this->empty_show,\n 'profitpnts' => $this->empty_show,\n 'revenue' => $this->empty_show,\n 'profit_view' => $profit_type,\n 'rob' => $this->empty_show,\n 'sage' => $this->empty_show,\n 'sean' => $this->empty_show,\n /* Values */\n 'numorders_val'=>0,\n 'profit_val' => 0,\n 'profitpnts_val' => 0,\n 'revenue_val' => 0,\n 'rob_val' => 0,\n 'sage_val' => 0,\n 'sean_val' => 0,\n /* Diff of values */\n 'numorders_diff'=>$this->empty_show,\n 'profit_diff' =>$this->empty_show,\n 'profitpnts_diff' => $this->empty_show,\n 'profit_percent_diff'=>$this->empty_show,\n 'revenue_diff' => $this->empty_show,\n 'rob_diff' => $this->empty_show,\n 'sage_diff' => $this->empty_show,\n 'sean_diff' => $this->empty_show,\n );\n $months = array();\n for ($j = 1; $j < 13; $j++) {\n $key = array_search($i . '-' . str_pad($j, 2, '0', STR_PAD_LEFT), $custom_keys);\n if ($key === FALSE) {\n $months[] = array(\n 'year' => $i,\n 'month' => $j,\n 'numorders' => $this->empty_show,\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $this->empty_show,\n 'profitpnts' => $this->empty_show,\n 'revenue' => $this->empty_show,\n 'profit_view' => $profit_type,\n 'rob' => $this->empty_show,\n 'sage' => $this->empty_show,\n 'sean' => $this->empty_show,\n 'prvrevenuediff'=>$this->empty_show,\n 'prvrevenueclass'=>'',\n 'prvrevenueprc'=>$this->empty_show,\n 'prvrevenueshow'=>0,\n );\n } else {\n // Get a previous revenue\n $nxtmnth=($j==12 ? 1 : $j+1);\n $nxtyear=($j==12 ? $i : $i-1);\n $prvyear=$i-1;\n $prvrevenue=0;\n $prvclass='';\n $outrevenue='';\n $outrevenueprc='';\n\n\n $months[] = array(\n 'year' => $i,\n 'month' => $j,\n 'numorders' => $customs[$key]['numorders'],\n 'profit_class' => 'empty',\n 'profit_percent' => $this->empty_show,\n 'profit' => $customs[$key]['profit'],\n 'profitpnts' => $customs[$key]['profitpnts'],\n 'revenue' => $customs[$key]['revenue'],\n 'profit_view' => $profit_type,\n 'rob' => $customs[$key]['rob'],\n 'sage' => $customs[$key]['sage'],\n 'sean' => $customs[$key]['sean'],\n );\n }\n }\n $cust_scryears[] = array(\n 'year' => $i,\n 'totals' => $total,\n 'months' => $months,\n 'profit_type' => $profit_type,\n );\n }\n // Rebuild Customs\n $cust_years = $this->_prepare_olddata($cust_scryears, 1);\n return $cust_years;\n }", "public function run()\n {\n //\n $commercialCompreheniveCost = [\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>4.50\n ],\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>5.75\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>7000000, \n 'rate'=>5.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>7000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>3\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>2.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>2000000, \n 'rate'=>7.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>2000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>6\n ],\n [\n 'commercial_class_id'=>5,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>6,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>7,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>8,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>12.5\n ],\n ];\n \n foreach($commercialCompreheniveCost as $key => $value){\n\n CommercialComprehensiveCost::create($value);\n\n }\n }", "protected function getData()\n {\n $occupancies = (new RoomOccupancyRepository)->withoutLabel(['tent', 'free'])->byNational($this->year);\n\n $spendings = (new BillRepository)->withoutResourceLabel(['tent', 'free'])->byMonthNational($this->year);\n\n foreach ($occupancies as $occupancy) {\n $this->occ_arr[$occupancy->country][$occupancy->mth] = $occupancy->counter;\n }\n\n foreach ($spendings as $spending) {\n $this->spend_arr[$spending->country][$spending->mth] = $spending->sum;\n }\n }", "function getFlavorsSalesFromDB()\n{\n\t$con = mysql_connect(\"localhost\", \"DBandGUI\", \"narwhal\");\n\n\tif(!$con) { die('Could not connect: ' . mysql_error()); }\n\n\tmysql_select_db(\"CustomCupcakes\", $con) or die('Could not select db: ' . mysql_error());\n\n\t$query = \"SELECT flavor_Name,purchase_Amount FROM CupcakeFlavor;\";\n\n\t$result = mysql_query($query);\n\n\t$finalArr = array();\n\n\t// This loop iterates over the results from the query and builds it into an array that will be returned later\n\twhile($row = mysql_fetch_array($result))\n\t{\n\t\t$finalArr[$row['flavor_Name']] = $row['purchase_Amount'];\n\t}\n\n\tmysql_close($con);\n\n\treturn $finalArr;\n}", "public function rankAffiliatesByRevenue()\n {\n $this->affiliates = DB::select(\"SELECT SUM(sale_amount) AS 'revenue', affiliate_id FROM \" . $this->source_table . \" GROUP BY (affiliate_id) ORDER BY sale_amount DESC LIMIT 1000;\");\n }", "public function getSubtotalInvoiced();", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function getPurchaseProduction($id_purchase) {\n $data = $this->db\n ->select(\"\n purchase_production.id_item,purchase_production.id_purchase_production,purchase_production.production_code,\n sum({$this->db->dbprefix('purchase_production')}.purchase_qty) as total_qty,\n item.item_name,item.item_code,item_category.item_category\n \")\n ->join('item','item.id_item=purchase_production.id_item','left')\n ->join('item_category','item_category.id_item_category=item.id_item_category','left')\n ->where('id_purchase',$id_purchase)\n ->order_by('item_category')\n ->group_by('purchase_production.id_purchase_production')\n ->get('purchase_production')\n ->result_array();\n \n return $data;\n }", "public function get_company_invoice_payment_recd() {\n $invoice = $this->input->post('invoice');\n $data = $this->classtraineemodel->company_invoice($invoice);\n $data->invoice_excess_amt = empty($data->invoice_excess_amt) ? 0 : $data->invoice_excess_amt;\n \n if ($data->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($data->company_id);\n $data->company_name = $tenant_details->tenant_name;\n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $data->company_id);\n $data->company_name = $company_details[0]->company_name;\n }\n $data->discount_label = rtrim($this->course->get_metadata_on_parameter_id($data->discount_type), ', ');\n $gst_label = ($data->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($data->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($data->gst_rule), ', ');\n }\n $data->gst_label = $gst_label;\n $data->inv_date = date('d/m/Y', strtotime($data->inv_date));\n $data->amount_refund = round($data->amount_refund, 2);\n $recd = $this->classtraineemodel->get_invoice_paid_details($invoice);\n foreach ($recd as $k => $row) {\n $mode_ext = ($row->mode_of_pymnt == 'CHQ') ? ' Chq#: ' . $row->cheque_number: '';\n $recd[$k]->recd_on = date('d/m/Y', strtotime($row->recd_on));\n $recd[$k]->mode = rtrim($this->course->get_metadata_on_parameter_id($row->mode_of_pymnt), ', ').$mode_ext;\n }\n $res = array('data' => $data, 'recd' => $recd);\n echo json_encode($res);\n exit();\n }", "public function create()\n {\n $user = Auth::user();\n $user->authorizeRoles('College Admin');\n $institution = $user->institution();\n $collegeName = $user->collegeName;\n\n $revenues = array();\n /** @var College $college */\n foreach ($institution->colleges as $college)\n if ($college->collegeName->id == $collegeName->id)\n foreach ($college->internalRevenues as $internalRevenue)\n $revenues[] = $internalRevenue;\n\n $revenueDescriptions = InternalRevenue::getEnum('revenue_description');\n\n $data = array(\n 'internal_revenues' => $revenues,\n 'revenue_descriptions' => $revenueDescriptions,\n\n 'has_modal' => 'yes',\n 'page_name' => 'budgets.internal-revenue.create'\n );\n\n return view('budgets.internal_revenue.index')->with($data);\n }", "public function convertSaleItemsData();", "function getReceiptCommercial()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = 'SELECT re.receipt_ref AS \"Receipt Ref\", r.relationship_name AS \"Supplier\", to_char(receipt_date,\\'dd/mm/yyyy\\') AS \"Receipt Date\" \n\t\tFROM '.receipt_table .' re \n\t\tJOIN '.relationships_table.' r ON r.relationship_id=re.supplier_id \n\t\tWHERE re.receipt_id = '.$this->receipt_id;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptCommercial, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "public function getDiscounts(): array;", "function getStocksPurchases($mysqli,$sale_id){\n\t$query = \"SELECT stocks.description,subsales.price_per_ton,subsales.quantity,subsales.subtotal FROM sales INNER join subsales ON sales.id = subsales.sale_id INNER JOIN stocks ON stocks.id = subsales.stock_id WHERE sales.id = '$sale_id'\";\n\n\tif($result = mysqli_query($mysqli,$query)){\n\t\treturn $result ;\n\t}\n\telse{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\t\n}", "public function fetchPurchaseData()\n\t{\n\t\t$result = array('data' => array());\n\n\t\t$data = $this->model_purchase->getPurchaseData();\n\n\t\tforeach ($data as $key => $value) {\n\n\t\t\t$count_total_item = $this->model_purchase->countPurchaseItem($value['purchase_no']);\n\t\t\t// echo $count_total_item;\n\t\t\t// $date = date('Y-m-d', $value['invoice_date']);\n\t\t\t// $time = date('h:i a', $value['date_time']);\n\t\t\t$party_data = $this->model_party->getPartyData($value['party_id']);\n\n\t\t\t// $date_time = $date;\n\n\t\t\tif ($party_data['address'] == NULL) {\n\t\t\t\t$party_data['address'] = \"\";\n\t\t\t}\n\t\t\tif ($party_data['party_name'] == NULL) {\n\t\t\t\t$party_data['party_name'] = \"\";\n\t\t\t}\n\t\t\t// button\n\t\t\t$buttons = '';\n\n\n\t\t\tif (in_array('viewOrder', $this->permission)) {\n\t\t\t\t$buttons .= '<a style=\"font-size: 25px;\" target=\"__blank\" href=\"' . base_url('purchase/printDiv/' . $value['s_no'] . '/' . $value['purchase_no'] . '') . '\" class=\"btn btn-default\"><i class=\"fa fa-print\"></i></a>';\n\t\t\t}\n\n\t\t\tif (in_array('updateOrder', $this->permission)) {\n\t\t\t\t$buttons .= ' <a style=\"font-size: 25px;\" href=\"' . base_url('purchase/update/' . $value['s_no'] . '/' . $value['purchase_no'] . '') . '\" class=\"btn btn-default\"><i class=\"fa fa-pencil\"></i></a>';\n\t\t\t}\n\n\t\t\tif (in_array('deleteOrder', $this->permission)) {\n\t\t\t\t$buttons .= ' <button style=\"font-size: 25px;\" type=\"button\" class=\"btn btn-default\" onclick=\"removeFunc(' . $value['s_no'] . ', ' . $value['purchase_no'] . ')\" data-toggle=\"modal\" data-target=\"#removeModal\"><i class=\"fa fa-trash\"></i></button>';\n\t\t\t}\n\n\t\t\t// if($value['is_payment_received'] == 1) {\n\t\t\t// \t$paid_status = '<span class=\"label label-success\">Paid</span>';\t\n\t\t\t// }\n\t\t\t// else {\n\t\t\t// \t$paid_status = '<span class=\"label label-warning\">Not Paid</span>';\n\t\t\t// }\n\n\n\n\t\t\t$result['data'][$key] = array(\n\t\t\t\t$value['purchase_no'],\n\t\t\t\t$party_data['party_name'],\n\t\t\t\t$value['purchase_date'],\n\t\t\t\t$count_total_item,\n\t\t\t\t// $value['total_amount'],\n\t\t\t\t// $value['mode_of_payment'],\n\t\t\t\t$buttons\n\t\t\t);\n\t\t} // /foreach\n\n\t\techo json_encode($result);\n\t}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function ppv_revenue(Request $request) {\n\n $currency = Setting::get('currency');\n\n $take = $request->take ? $request->take : Setting::get('admin_take_count');\n\n $model = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->orderBy('vod_videos.user_amount', 'desc')->skip($request->skip)\n ->take($take)->get();\n\n $data = [];\n\n $user_commission = VodVideo::where('vod_videos.user_id', $request->id)->sum('user_amount');\n\n foreach ($model as $key => $value) {\n \n $data[] = [\n 'vod_id'=>$value->vod_id,\n 'title'=>$value->title,\n 'user_id'=>$value->user_id,\n 'description'=>$value->description,\n 'image'=>$value->image,\n 'amount'=>$value->amount,\n 'admin_amount'=>$value->admin_amount,\n 'user_amount'=>$value->user_amount,\n 'created_at'=>$value->created_at->diffForhumans(),\n 'currency'=>$value->currency,\n 'unique_id'=>$value->unique_id\n ];\n\n }\n\n $paid_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)\n ->where('vod_videos.user_amount', '>', 0)->count();\n\n $total_videos = VodVideo::vodRevenueResponse()\n ->where('vod_videos.user_id', $request->id)->count();\n\n $response_array = ['success'=>true, 'data'=>$data, \n 'total_amount'=>$user_commission, \n 'currency'=>$currency, \n 'total_paid_videos'=>$paid_videos ? $paid_videos : 0,\n 'total_videos'=>$total_videos ? $total_videos : 0];\n\n return response()->json($response_array);\n }", "protected function create_purchaseorderdetails($ponbr) {\n\t\t\t$lines = array();\n\t\t\t$details = get_dbpurchaseorderdetails($ponbr);\n\t\t\t\n\t\t\tforeach ($details as $detail) {\n\t\t\t\t$line = $this->create_sectionarray($this->structure['detail'], $detail);\n\t\t\t\t$line['Allocation'] = array(array('Amount' => $detail['LineTotal']));\n\t\t\t\t$lines[] = $line;\n\t\t\t}\n\t\t\treturn $lines;\n\t\t}", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function retrieveData(){\n\t\t$mParser = new RecipeParser;\n\t\t$mParser->retrieveInfoForObject($this);\n\t}", "public function get_loss_profit()\n {\n /*\n * retrieve trial balance to get normal position of account.\n * prepare array that handle loss and profit data.\n * prepare expenses and revenues data, show advertising and marketing as separated detail\n */\n $trial = $this->get_trial();\n\n $data = array();\n\n $expense = array();\n $revenue = array();\n\n $advertising = array();\n $marketing = array();\n\n foreach ($trial as $row) {\n if ($row[\"position\"] == \"DEBITS\") {\n $temp = array(\"account\" => $row[\"account\"], \"value\" => $row[\"debit\"]);\n } else {\n $temp = array(\"account\" => $row[\"account\"], \"value\" => $row[\"credit\"]);\n }\n\n /*\n * retrieve account type from pattern.\n * eg: $row['account'] -> [Revenue] then break into parts '['->(0), 'Revenue'->(1), ']'->(3)\n * if type of account is Revenue then pass through it.\n * if type of account is Expense, specially for Advertising and marketing show the detail.\n */\n preg_match(\"/\\[([^]]*)\\]/\", $row[\"account\"], $account);\n preg_match(\"/\\]([^]]*)\\:/\", $row[\"account\"], $sub_expense);\n $account_type = $account[1];\n\n if ($account_type == \"Revenue\") {\n $revenue[] = $temp;\n }\n if ($account_type == \"Expense\") {\n if (sizeof($sub_expense) > 0 && trim($sub_expense[1]) == \"Advertising\") {\n $advertising[] = $temp;\n } else if (sizeof($sub_expense) > 0 && trim($sub_expense[1]) == \"Marketing\") {\n $marketing[] = $temp;\n } else {\n $expense[] = $temp;\n }\n }\n }\n\n /*\n * add advertising and marketing data front of array,\n * push revenue and all expenses into loss and profit array.\n */\n array_unshift($expense, $advertising);\n array_unshift($expense, $marketing);\n\n array_push($data, $revenue, $expense);\n\n return $data;\n }", "public function get_data();", "function einstellungen_data ()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE bgalset_id='1'\",\n\t\t\t$this->db_praefix.\"ecard_einstellungen\"\n\t\t);\n\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "public function getPurchaseDetails()\n {\n if (request()->ajax()) {\n $start = request()->start;\n $end = request()->end;\n $business_id = request()->session()->get('user.business_id');\n\n $purchase_details = $this->transactionUtil->getPurchaseTotals($business_id, $start, $end);\n\n return $purchase_details;\n }\n }", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "function getVenue()\n{\n global $db;\n\tglobal $venueName;\n $serial = -1;\n\t$venue = array();\n\t$venue['venue_id'] = $venue_id;\n $venue['accepting'] = getAccepting();\n\t$venue['name'] = $venueName;\n\t$venue['url_name'] = \"none\";\n\treturn $venue;\n}", "function get_data_product() {\n $query = $this->db->query('select * from BI_emarsys_product_feeds');\n \n \tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\n\t\t}\n }", "public function getFormattedData();", "public function reportRe()\n{\n print_r($this->requestReport(\n \"campaigns\",\n array(\"reportDate\" => \"20190501\",\n \"campaignType\" => \"sponsoredProducts\",\n \"metrics\" => \"impressions,clicks,cost\")));\n\n // amzn1.clicksAPI.v1.m1.5CD444B4.e3c2f999-14b0-4385-bf71-41f8538f712a\n \n \n}", "public function getDiscountDescription();", "public function retrieve_product_data_inv()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$product_id = $this->input->post('product_id');\n\t\t$product_info = $CI->Invoices->get_total_product_invoic($product_id);\n\t\techo json_encode($product_info);\n\t}", "protected function get_purchase_data($records, $cost_divide){\n \t$items = [];\n\t\t$amount = 0;\n\n\t\tif($records){\n\t\t\t$record = current($records);\n\t\t\t$tax_value = $this->get_tax($record->reception_date);\n\n\t\t\tif($cost_divide){\n\t\t\t\tforeach($cost_divide as $cost){\n\t\t\t\t\t$money = is_null($cost->cor_divide_cost) ? $cost->divide_cost : $cost->cor_divide_cost;\n\t\t\t\t\t$vat = 1 + ($tax_value / 100);\n\t\t\t\t\t$before_tax = round($money / $vat);\n\t\t\t\t\t$tax = $money - $before_tax;\n\t\t\t\t\t$items[] = [\n\t\t\t\t\t\t'tax' => $tax,\n\t\t\t\t\t\t'before_tax' => $before_tax,\n\t\t\t\t\t\t'm_department_id' => $cost->m_department_id,\n\t\t\t\t\t\t'department_code' => \\DB::select('code')\n\t\t\t\t\t\t\t\t\t\t\t\t->from('m_department')\n\t\t\t\t\t\t\t\t\t\t\t\t->where('id', $cost->m_department_id)\n\t\t\t\t\t\t\t\t\t\t\t\t->where('item_status','active')\n\t\t\t\t\t\t\t\t\t\t\t\t->execute()\n\t\t\t\t\t\t\t\t\t\t\t\t->get('code')\n\t\t\t\t\t];\n\t\t\t\t\t$amount += $money;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tforeach($records as $record){\n\t\t\t\t\t$money = is_null($record->cor_payments) ? $record->payments : $record->cor_payments;\n\t\t\t\t\t$vat = 1 + ($tax_value / 100);\n\t\t\t\t\t$before_tax = round($money/$vat);\n\t\t\t\t\t$tax = $money - $before_tax;\n\t\t\t\t\t$items[] = [\n\t\t\t\t\t\t'tax' => $tax,\n\t\t\t\t\t\t'before_tax' => $before_tax,\n\t\t\t\t\t\t'm_department_id' => null,\n\t\t\t\t\t\t'department_code' => null\n\t\t\t\t\t];\n\t\t\t\t\t$amount += $money;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [\n\t\t\t'items' => $items,\n\t\t\t'amount' => $amount\n\t\t];\n }", "function sys_sales($oConnect, $link, $startDate, $endDate,&$sys_log) {\n $sSQL = \"sp_report SalesByItemDetail show Text, Blank, TxnType, Date, Memo, Name, Quantity, UnitPrice, Amount parameters DateFrom = {d'$startDate'}, DateTo= {d'$endDate'}\";\n // Perform the query\n $oResult = odbc_exec($oConnect, $sSQL);\n $keys = array(\"Type\", \"FullName\", \"Description\", \"TxnType\", \"Date\", \"Memo\", \"Name\", \"Quantity\", \"UnitPrice\", \"Amount\");\n $lFieldCount = odbc_num_fields($oResult);\n $rows = array();\n //print_r($keys.\"<br>\");\n while ($myRow = odbc_fetch_array($oResult)) {\n $rows[] = $myRow;\n }\n $values = array();\n $Type = \"\";\n $FullName = \"\";\n $NewFullName = \"\";\n $Description = \"\";\n if (count($rows) > 0) {\n // do delete then add\n $resUpdate = mysqli_query($link, \"delete from r_salesbyitemdetail WHERE date>= '$startDate' \");\n //print (\"delete from r_salesbyitemdetail WHERE date>= '$startDate'\");\n if ($resUpdate) {\n $items = 0;\n for ($i = 0;$i < count($rows);++$i) {\n $values = array();\n $l1_parentCount = 0;\n $l2_parentCount = 0;\n $l3_parentCount = 0;\n // print $rows[$i]['Text'];\n //if ($rows[$i]['Text'] == \"\" && $rows[$i]['Blank'] == \"\" && $rows[$i]['Amount'] != \"\")\n if ($rows[$i]['UnitPrice'] != \"\") {\n if ($i >= 3) {\n if ($rows[$i - 1]['Text'] != \"\" && $rows[$i - 1]['Amount'] == \"\") {\n $Description = $rows[$i - 1]['Text'];\n if ($rows[$i - 2]['Text'] != \"\" && $rows[$i - 2]['Amount'] == \"\") {\n $FullName = $rows[$i - 2]['Text'];\n if ($rows[$i - 3]['Text'] != \"\" && $rows[$i - 3]['Amount'] == \"\") {\n $Type = $rows[$i - 3]['Text'];\n }\n }\n }\n }\n if (strpos($Description, '(') !== false) {\n $newDescription = preg_replace(\"/\\([^)]+\\)/\", \"\", $Description);\n $NewFullName = $FullName . ':' . $newDescription;\n $splitArr = explode(\"(\", $Description);\n $newDescription2 = str_replace(\")\", \"\", $splitArr[1]);\n } else {\n $NewFullName = $FullName . ':' . $Description;\n $newDescription2 = $Description;\n }\n array_push($values, $Type);\n array_push($values, $NewFullName);\n //array_push($values, addslashes($Description));\n array_push($values, addslashes($newDescription2));\n array_push($values, $rows[$i]['TxnType']);\n array_push($values, $rows[$i]['Date']);\n array_push($values, addslashes($rows[$i]['Memo']));\n array_push($values, $rows[$i]['Name']);\n array_push($values, $rows[$i]['Quantity']);\n array_push($values, $rows[$i]['UnitPrice']);\n array_push($values, $rows[$i]['Amount']);\n //print $Type . \"**:***\" . $FullName . \"***:***\" . $Description . \"*************\".$rows[$i]['TxnType'] . \" - \" . $rows[$i]['Date'] . \" - \" . $rows[$i]['Memo'] . \" - \" . $rows[$i]['Name'] . \" - \" . $rows[$i]['Quantity'] . \" - \" . $rows[$i]['UnitPrice'] . \" - \" . $rows[$i]['Amount'] . \"<br />\";\n //print_r($values.\"<br>\");\n $resInsert = mysqli_query($link, \"INSERT INTO r_salesbyitemdetail (\" . implode(\", \", $keys) . \") VALUES ('\" . implode(\"', '\", $values) . \"');\"); // insert one row into new table\n if ($resInsert) {\n //print (\"r_salesbyitemdetail--Insert2 :Success<br>\");\n \n } else {\n print (\"r_salesbyitemdetail--INSERT INTO r_salesbyitemdetail (\" . implode(\", \", $keys) . \") VALUES ('\" . implode(\"', '\", $values) . \"')<br>\");\n }\n $items++;\n }\n }\n } else {\n print (\"delete failed!<br>\");\n }\n }\n odbc_free_result($oResult);\n\t$sys_log .=\"total No. of SalesByItemDetail: $items \\r\\n\";\n\t\n\t\n echo \"<br>total No. of SalesByItemDetail: $items\";\n\t//$arr['SalesByItemDetail'] = \"total No. of SalesByItemDetail: $items\";\n\t\n}", "protected function _getFullRateInfo()\n {\n $rates = Mage::getModel('tax/sales_order_tax')->getCollection()->loadByOrder($this->getOrder())->toArray();\n $fullInfo = Mage::getSingleton('tax/calculation')->reproduceProcess($rates['items']);\n return $fullInfo;\n }", "function get_acquisition_qty_by_country(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \" tblcountry.country, sum(trelVintageHasAcquire.qty) as qty\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" tblcountry.country \";\n //$where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" qty DESC \";\n $limit = '12';\n $rst = $obj ->get_extended($where,$columns,$group, $sort, $limit);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"get_acquisition_qty_by_country() failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n \n}", "function edit_revenue_type($id) \n\t\t{\n\t\t\t\n\t\t\t\t $this->db->where('revenue_id',$id);\n\t\t\t\t\t\t\n\t\t\t\t $query=$this->db->get($this->table_name);\n\t\t\t\n\t\t\t\t return $query->result();\n\t\t\t\t\t\t\t\n\t\t}", "public function getAllSalesMan(){\n\t\t$sql = \"SELECT * FROM vendedor\";\n\t\treturn $this->Model->getData($sql);\n\t}", "abstract public function getDataDesc();", "public function getReporteVentasDiario($data)\n\t{\n\t\t$spreadsheet = new Spreadsheet();\n\t\t$sheet = $spreadsheet->getActiveSheet();\n\t\t$sql = (\"SELECT \n\t\t\t\t\tfacturascli.codpago,\n\t\t\t\t\tclientes.nombre,\n\t\t\t\t\tclientes.razonsocial,\n\t\t\t\t\tclientes.codagente AS codigo_vendedor,\n\t\t\t\t\tagentes.nombre AS nombre_vendedor,\n\t\t\t\t\tfacturascli.fecha AS fecha_facturacion,\n\t\t\t\t\tfacturascli.vencimiento AS fecha_vencimiento,\n\t\t\t\t\tfacturascli.codigo,\n\t\t\t\t\tfacturascli.observaciones,\n\t\t\t\t\tfacturascli.total\n\t\t\t\tFROM\n\t\t\t\t\t`facturascli`\n\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\tclientes ON clientes.codcliente = facturascli.codcliente\n\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\tagentes AS agentes ON agentes.codagente = clientes.codagente\n\t\t\t\tWHERE\n\t\t\t\t\tDATE(facturascli.fecha) = :fecha\n\t\t\t\tORDER BY clientes.codagente;\");\n\t\t\t\t\n\t\t$this->consulta('SET NAMES utf8');\n\t\t# Escribir encabezado de los productos\n\t\t$encabezado = [\"codpago\",\"nombre\",\"razonsocial\",\"codigo_vendedor\",\"nombre_vendedor\",\"fecha_facturacion\",\"fecha_vencimiento\",\"codigo\",\"observaciones\",\"total\",\"fecha_pago\"];\n\t\t# El último argumento es por defecto A1 pero lo pongo para que se explique mejor\n\t\t$sheet->fromArray($encabezado, null, 'A1');\n\t\t$parametros = array('fecha'=>$data);\n\t\t$resultado = $this->consulta($sql,$parametros);\n\t\t$res = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t$numeroDeFila = 2;\n\t\tforeach ($res as $data ) {\n\t\t\t# Obtener los datos de la base de datos\n\t\t\t$codpago = $data['codpago'];\n\t\t\t$nombre = $data['nombre'];\n\t\t\t$razonsocial = $data['razonsocial'];\n\t\t\t$codigo_vendedor = $data['codigo_vendedor'];\n\t\t\t$nombre_vendedor = $data['nombre_vendedor'];\n\t\t\t$fecha_facturacion = $data['fecha_facturacion'];\n\t\t\t$fecha_vencimiento = $data['fecha_vencimiento'];\n\t\t\t$codigo = $data['codigo'];\n\t\t\t$observaciones = $data['observaciones'];\n\t\t\t$total = $data['total'];\n\t\t\t# Escribirlos en el documento\n\t\t\t$sheet->setCellValueByColumnAndRow(1, $numeroDeFila, $codpago);\n\t\t\t$sheet->setCellValueByColumnAndRow(2, $numeroDeFila, $nombre);\n\t\t\t$sheet->setCellValueByColumnAndRow(3, $numeroDeFila, $razonsocial);\n\t\t\t$sheet->setCellValueByColumnAndRow(4, $numeroDeFila, $codigo_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(5, $numeroDeFila, $nombre_vendedor);\n\t\t\t$sheet->setCellValueByColumnAndRow(6, $numeroDeFila, $fecha_facturacion);\n\t\t\t$sheet->setCellValueByColumnAndRow(7, $numeroDeFila, $fecha_vencimiento);\n\t\t\t$sheet->setCellValueByColumnAndRow(8, $numeroDeFila, $codigo);\n\t\t\t$sheet->setCellValueByColumnAndRow(9, $numeroDeFila, $observaciones);\n\t\t\t$sheet->setCellValueByColumnAndRow(10, $numeroDeFila, $total);\n\t\t\t$numeroDeFila++;\n\t\t}\n\t\t$writer = new Xlsx($spreadsheet);\n\t\t$writer->save('../../reporte/reporte.xlsx');\n\t\techo \"true\";\n\t}", "public function getBergrivierSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 116\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function get_data() {\r\n $data = get_object_vars( $this );\r\n $query = new My_Home_Query_Estates();\r\n $query->set_limit( -1 );\r\n $query->set_user( $this->id );\r\n $query->set_all();\r\n if ( ! empty( My_Home_Core()->lang ) ) {\r\n $query->set_lang( My_Home_Core()->lang );\r\n }\r\n $results = $query->get_results();\r\n $data['estates'] = $results['estates'];\r\n\r\n return $data;\r\n }", "public function getProductoRe(){\n\t\t$sql = \"SELECT id_producto, nombre, cantidad, precio_total, presentacion, proveedor, marca, tipo_producto FROM productos INNER JOIN presentaciones USING(id_presentacion) INNER JOIN proveedores USING(id_proveedor) INNER JOIN marca USING(id_marca) INNER JOIN tipo_producto USING(id_tipo_producto) ORDER BY id_producto\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "function getVenues()\n{\n\tglobal $db;\n\tglobal $venueName;\n\t$venues = array();\n\t$venue['venue_id'] = 0;\n $venue['accepting'] = getAccepting();\n $venue['name'] = $venueName;\n\t$venue['url_name'] = \"none\";\n\t$venues['venues'][] = $venue;\n\treturn $venues;\n}", "public function getInventoryAndSales() {\n\t\t$isql=\"SELECT i.id as value,i.item_name as label,i.sell_price,i.quantity FROM inventory i where rstatus='A' and quantity > 0\";\t\t\n\t\t$iresult=$this->runQuery('getAll',$isql);\n\t\t\n\t\t$sosql=\"SELECT so.id as so_id,so.product_id as inv_id,p.item_name as inv_name,date(so.sell_date) as selling_date,so.customer_name,so.sell_price as selling_price,so.prod_qty as selling_qty,so.comments FROM sales_order so, inventory p where p.id = so.product_id and so.rstatus ='A'\";\t\t\n\t\t$soresult=$this->runQuery('getAll',$sosql);\n\t\t\n\t\techo '[{\"invDropdownList\":'.json_encode($iresult).',\"salesOrderList\":'.json_encode($soresult).'}]';\n\t}", "public function GetRestbyHotal(){\n\t\t$data=array();\n\t\t$getres=''; \n\t\t$data=$this->Testimonials_model->getResHotel($_POST['id']);\n\t\t if(!empty($data)){\n\t\t\t$getres .= \"<option value=''> Select Restaurant </option>\";\n\t\t\tforeach($data as $val){\n\t\t\t$getres .= \"<option value=\".$val['id'].\"> \".$val['restaurant_name'].\" </option>\";\n\t\t\t}}\n\t\t\telse\n\t\t\t{\n\t\t\t$getres .= \"<option value=''> There is no Restaurant </option>\";\n\t\t\t}\n\t\t\techo $getres; \n\t }", "public function getContent()\n {\n $objModule = new MpSellerInvoice();\n $invoiceAddressPatternRules = Tools::jsonDecode(Configuration::get('PS_INVCE_INVOICE_ADDR_RULES'), true);\n $deliveryAddressPatternRules = Tools::jsonDecode(Configuration::get('PS_INVCE_DELIVERY_ADDR_RULES'), true);\n $invoiceAddress = new Address((int) $this->order->id_address_invoice);\n $formattedInvoiceAddress = AddressFormat::generateAddress($invoiceAddress, $invoiceAddressPatternRules, '<br />', ' ');\n $deliveryAddress = null;\n $formattedDeliveryAddress = '';\n $deliveryAddress = new Address((int) $this->order->id_address_delivery);\n $formattedDeliveryAddress = AddressFormat::generateAddress($deliveryAddress, $deliveryAddressPatternRules, '<br />', ' ');\n $customer = new Customer((int) $this->order->id_customer);\n $orderDetails = $this->order->getProducts();\n\n $sellerTotalProducts = 0;\n // customize orderDetails to maintain tax\n foreach ($orderDetails as $key => $row) {\n // Add information for virtual product\n if ($orderDetails[$key]['download_hash'] && !empty($row['download_hash'])) {\n $orderDetails[$key]['filename'] = ProductDownload::getFilenameFromIdProduct((int) $row['product_id']);\n // Get the display filename\n $orderDetails[$key]['display_filename'] = ProductDownload::getFilenameFromFilename($row['filename']);\n }\n $orderDetails[$key]['id_address_delivery'] = $this->order->id_address_delivery;\n /* Ecotax */\n $roundMode = $this->order->round_mode;\n $orderDetails[$key]['ecotax_tax_excl'] = $row['ecotax']; // alias for coherence\n $orderDetails[$key]['ecotax_tax_incl'] = $row['ecotax'] * (100 + $row['ecotax_tax_rate']) / 100;\n $row['ecotax_tax_incl'] = $row['ecotax'] * (100 + $row['ecotax_tax_rate']) / 100;\n $row['ecotax_tax_excl'] = $row['ecotax'];\n $orderDetails[$key]['ecotax_tax'] = $row['ecotax_tax_incl'] - $row['ecotax_tax_excl'];\n if ($roundMode == Order::ROUND_ITEM) {\n $row['ecotax_tax_incl'] = Tools::ps_round($row['ecotax_tax_incl'], _PS_PRICE_COMPUTE_PRECISION_, $roundMode);\n }\n $orderDetails[$key]['total_ecotax_tax_excl'] = $row['ecotax_tax_excl'] * $row['product_quantity'];\n $orderDetails[$key]['total_ecotax_tax_incl'] = $row['ecotax_tax_incl'] * $row['product_quantity'];\n $row['total_ecotax_tax_incl'] = $row['ecotax_tax_incl'] * $row['product_quantity'];\n $row['total_ecotax_tax_excl'] = $row['ecotax_tax_excl'] * $row['product_quantity'];\n $orderDetails[$key]['total_ecotax_tax'] = $row['total_ecotax_tax_incl'] - $row['total_ecotax_tax_excl'];\n $row['total_ecotax_tax'] = $row['total_ecotax_tax_incl'] - $row['total_ecotax_tax_excl'];\n $row['ecotax_tax'] = $row['ecotax_tax_incl'] - $row['ecotax_tax_excl'];\n foreach (array(\n 'ecotax_tax_excl',\n 'ecotax_tax_incl',\n 'ecotax_tax',\n 'total_ecotax_tax_excl',\n 'total_ecotax_tax_incl',\n 'total_ecotax_tax',\n ) as $ecotaxfield) {\n $orderDetails[$key][$ecotaxfield] = Tools::ps_round($row[$ecotaxfield], _PS_PRICE_COMPUTE_PRECISION_, $roundMode);\n }\n // Aliases\n $orderDetails[$key]['unit_price_tax_excl_including_ecotax'] = $row['unit_price_tax_excl'];\n $orderDetails[$key]['unit_price_tax_incl_including_ecotax'] = $row['unit_price_tax_incl'];\n $orderDetails[$key]['total_price_tax_excl_including_ecotax'] = $row['total_price_tax_excl'];\n $orderDetails[$key]['total_price_tax_incl_including_ecotax'] = $row['total_price_tax_incl'];\n }\n\n $hasDiscount = false;\n foreach ($orderDetails as $id => &$orderDetail) {\n if ($this->id_seller == 0) {\n $isBelongToSeller = $this->getSellerProductInfoByProductId($orderDetail['product_id']);\n //sending admin invoice then check config if seller invoice enabled and product is seller product then unset otherwise send seller product in admin invoice bescause seller invoice is disabled\n if ($isBelongToSeller && Configuration::get('MP_SELLER_INVOICE_ACTIVE') == 1) {\n unset($orderDetails[$id]);\n continue;\n }\n } else {\n $isBelongToSeller = $this->getSellerProductInfo($orderDetail['product_id']);\n if (!$isBelongToSeller) {\n unset($orderDetails[$id]);\n continue;\n }\n }\n // Find out if column 'price before discount' is required\n if ($orderDetail['reduction_amount_tax_excl'] > 0) {\n $hasDiscount = true;\n $orderDetail['unit_price_tax_excl_before_specific_price'] = $orderDetail['unit_price_tax_excl_including_ecotax'] + $orderDetail['reduction_amount_tax_excl'];\n } elseif ($orderDetail['reduction_percent'] > 0) {\n $hasDiscount = true;\n $orderDetail['unit_price_tax_excl_before_specific_price'] = (100 * $orderDetail['unit_price_tax_excl_including_ecotax']) / (100 - $orderDetail['reduction_percent']);\n }\n if (isset($orderDetail['unit_price_tax_excl_before_specific_price'])) {\n $orderDetail['unit_price_tax_excl_before_specific_price'] = Tools::displayPrice($orderDetail['unit_price_tax_excl_before_specific_price'], $this->currency);\n }\n // Set tax_code\n $taxes = OrderDetail::getTaxListStatic($id);\n $taxTemp = array();\n foreach ($taxes as $tax) {\n $obj = new Tax($tax['id_tax']);\n $taxTemp[] = sprintf($objModule->l('%1$s%2$s%%'), ($obj->rate + 0), '&nbsp;');\n }\n $sellerTotalProducts += $orderDetail['total_price_tax_excl'];\n $orderDetail['order_detail_tax'] = $taxes;\n $orderDetail['order_detail_tax_label'] = implode(', ', $taxTemp);\n $sellerOrder = $this->getProductCommissionDetail($orderDetail['product_id'], $orderDetail['product_attribute_id']);\n if ($sellerOrder) {\n $orderDetails[$id]['admin_commission'] = Tools::displayPrice($sellerOrder['admin_commission'], $this->currency);\n $orderDetails[$id]['admin_commission_tax'] = Tools::displayPrice($sellerOrder['admin_tax'], $this->currency);\n $orderDetails[$id]['seller_amount'] = Tools::displayPrice($sellerOrder['seller_amount'], $this->currency);\n $orderDetails[$id]['seller_amount_tax'] = Tools::displayPrice($sellerOrder['seller_tax'], $this->currency);\n $orderDetails[$id]['order_total_commission'] = Tools::displayPrice($sellerOrder['admin_commission'] + $sellerOrder['admin_tax'], $this->currency);\n }\n unset($sellerOrder);\n }\n\n unset($taxTemp);\n unset($orderDetail);\n // calculating seller voucher if applied\n $mpVoucher = WkMpOrderVoucher::getVoucherDetailByIdSeller($this->order->id, $this->id_seller);\n $voucherTotal = 0;\n if ($mpVoucher) {\n foreach ($mpVoucher as &$voucher) {\n $voucherTotal = $voucherTotal + $voucher['voucher_value'];\n $voucher['voucher_value'] = Tools::displayPrice($voucher['voucher_value'], $this->currency);\n }\n }\n // add product image in invoice\n if (Configuration::get('PS_PDF_IMG_INVOICE')) {\n foreach ($orderDetails as &$orderDetail) {\n if ($this->id_seller == 0) {\n $isBelongToSeller = $this->getSellerProductInfoByProductId($orderDetail['product_id']);\n //sending admin invoice then check config if seller invoice enabled and product is seller product then unset otherwise send seller product in admin invoice bescause seller invoice is disabled\n if ($isBelongToSeller && Configuration::get('MP_SELLER_INVOICE_ACTIVE') == 1) {\n unset($orderDetails[$id]);\n continue;\n }\n } else {\n $isBelongToSeller = $this->getSellerProductInfo($orderDetail['product_id']);\n if (!$isBelongToSeller) {\n unset($orderDetails[$id]);\n continue;\n }\n }\n if ($orderDetail['image'] != null) {\n $name = 'product_mini_'.(int) $orderDetail['product_id'].(isset($orderDetail['product_attribute_id']) ? '_'.(int) $orderDetail['product_attribute_id'] : '').'.jpg';\n $path = _PS_PROD_IMG_DIR_.$orderDetail['image']->getExistingImgPath().'.jpg';\n $orderDetail['image_tag'] = preg_replace(\n '/\\.*'.preg_quote(__PS_BASE_URI__, '/').'/',\n _PS_ROOT_DIR_.DIRECTORY_SEPARATOR,\n ImageManager::thumbnail($path, $name, 45, 'jpg', false),\n 1\n );\n if (file_exists(_PS_TMP_IMG_DIR_.$name)) {\n $orderDetail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_.$name);\n } else {\n $orderDetail['image_size'] = false;\n }\n }\n }\n unset($orderDetail); // don't overwrite the last order_detail later\n }\n $cartRules = $this->order->getCartRules($this->order->id);\n $freeShipping = false;\n foreach ($cartRules as $key => $cartRule) {\n if ($cartRule['free_shipping']) {\n $freeShipping = true;\n /*\n * Adjust cart rule value to remove the amount of the shipping.\n * We're not interested in displaying the shipping discount as it is already shown as \"Free Shipping\".\n */\n $cartRules[$key]['value_tax_excl'] -= $this->order->total_shipping_tax_excl;\n $cartRules[$key]['value'] -= $this->order->total_shipping_tax_incl;\n /*\n * Don't display cart rules that are only about free shipping and don't create\n * a discount on products.\n */\n if ($cartRules[$key]['value'] == 0) {\n unset($cartRules[$key]);\n }\n }\n }\n $productTaxes = 0;\n foreach ($this->getProductTaxesBreakdown() as $details) {\n $productTaxes += $details['total_amount'];\n }\n $productDiscountsTaxExcl = $this->order->total_discounts_tax_excl;\n $productDiscountsTaxIncl = $this->order->total_discounts_tax_incl;\n if ($freeShipping) {\n $productDiscountsTaxExcl -= $this->order->total_shipping_tax_excl;\n $productDiscountsTaxIncl -= $this->order->total_shipping_tax_incl;\n }\n $productsAfterDiscountsTaxExcl = $this->order->total_products - $productDiscountsTaxExcl;\n $productsAfterDiscountsTaxIncl = $this->order->total_products_wt - $productDiscountsTaxIncl;\n $shippingTaxExcl = $freeShipping ? 0 : $this->order->total_shipping_tax_excl;\n $shippingTaxIncl = $freeShipping ? 0 : $this->order->total_shipping_tax_incl;\n $shippingTaxes = $shippingTaxIncl - $shippingTaxExcl;\n $wrappingTaxes = $this->order->total_wrapping_tax_incl - $this->order->total_wrapping_tax_excl;\n $totalTaxes = $this->order->total_paid_tax_incl - $this->order->total_paid_tax_excl;\n $free = 1;\n if ($shippingTaxExcl > 0) {\n $free = 0;\n }\n $footer = array(\n 'products_before_discounts_tax_excl' => $sellerTotalProducts,\n 'product_discounts_tax_excl' => $productDiscountsTaxExcl,\n 'products_after_discounts_tax_excl' => $productsAfterDiscountsTaxExcl,\n 'products_before_discounts_tax_incl' => $this->order->total_products_wt,\n 'product_discounts_tax_incl' => $productDiscountsTaxIncl,\n 'products_after_discounts_tax_incl' => $productsAfterDiscountsTaxIncl,\n 'product_taxes' => $productTaxes,\n 'shipping_tax_excl' => $shippingTaxExcl,\n 'shipping_taxes' => $shippingTaxes,\n 'shipping_tax_incl' => $shippingTaxIncl,\n 'wrapping_tax_excl' => $this->order->total_wrapping_tax_excl,\n 'wrapping_taxes' => $wrappingTaxes,\n 'wrapping_tax_incl' => $this->order->total_wrapping_tax_incl,\n 'ecotax_taxes' => $totalTaxes - $productTaxes - $wrappingTaxes - $shippingTaxes,\n 'total_taxes' => $totalTaxes,\n 'total_paid_tax_excl' => $this->order->total_paid_tax_excl,\n 'total_paid_tax_incl' => $this->order->total_paid_tax_incl,\n 'free_shipping' => $free\n );\n foreach ($footer as $key => $value) {\n $footer[$key] = Tools::ps_round($value, _PS_PRICE_COMPUTE_PRECISION_, $this->order->round_mode);\n }\n $roundType = $this->getRoundType($this->order->round_type);\n $displayProductImages = Configuration::get('PS_PDF_IMG_INVOICE');\n $taxExcludedDisplay = Group::getPriceDisplayMethod($customer->id_default_group);\n $layout = $this->computeLayout(array('has_discount' => $hasDiscount));\n $legalFreeText = Hook::exec('displayInvoiceLegalFreeText', array('order' => $this->order));\n if (!$legalFreeText) {\n $legalFreeText = Configuration::get('PS_INVOICE_LEGAL_FREE_TEXT', (int) Context::getContext()->language->id, null, (int) $this->order->id_shop);\n }\n // Calculate all the seller and admin amount from the order\n $totalAdminCommission = $totalAdminCommissionTax = $sellerTotal = $sellerTotalTax = 0;\n $objOrderDetail = new WkMpSellerOrderDetail();\n $sellerOrderDetail = $objOrderDetail->getSellerProductFromOrder($this->order->id, $this->id_seller_customer);\n if ($sellerOrderDetail) {\n foreach ($sellerOrderDetail as $sellerDetail) {\n if (isset($orderDetails[$sellerDetail['id_order_detail']])) {\n $orderDetails[$sellerDetail['id_order_detail']]['commission_rate'] = Tools::ps_round(\n $sellerDetail['commission_rate'],\n 2\n );\n }\n $totalAdminCommission += $sellerDetail['admin_commission'];\n $totalAdminCommissionTax += $sellerDetail['admin_tax'];\n $sellerTotal += $sellerDetail['seller_amount'];\n $sellerTotalTax += $sellerDetail['seller_tax'];\n }\n }\n $sellerCommission = new WkMpCommission();\n $commissionRate = $sellerCommission->getCommissionRate($this->id_seller_customer);\n if (!$commissionRate) {\n $commissionRate = Configuration::get('WK_MP_GLOBAL_COMMISSION');\n }\n $objCurrency = new Currency($this->order->id_currency);\n if ($orderDetails) {\n foreach ($orderDetails as $key => $value) {\n $orderDetails[$key]['unit_price_tax_excl'] = Tools::displayPrice($value['unit_price_tax_excl'], $objCurrency);\n $orderDetails[$key]['ecotax_tax_excl'] = Tools::displayPrice($value['ecotax_tax_excl'], $objCurrency);\n $orderDetails[$key]['unit_price_tax_incl'] = Tools::displayPrice($value['unit_price_tax_incl'], $objCurrency);\n $orderDetails[$key]['ecotax_tax_incl'] = Tools::displayPrice($value['ecotax_tax_incl'], $objCurrency);\n $orderDetails[$key]['total_price_tax_excl'] = Tools::displayPrice($value['total_price_tax_excl'], $objCurrency);\n }\n }\n $sellerTotal = $footer['products_before_discounts_tax_excl'] + $footer['product_taxes'];\n $footer = $this->getFooterFormatedData($footer, $objCurrency, $voucherTotal);\n $carrier = new Carrier($this->order->id_carrier);\n $data = array(\n 'order' => $this->order,\n 'carrierName' => $carrier->name,\n 'currency' => new Currency($this->order->id_currency),\n 'seller_obj' => $this->obj_seller,\n 'order_invoice' => $this->order,\n 'order_details' => $orderDetails,\n 'cart_rules' => $cartRules,\n 'delivery_address' => $formattedDeliveryAddress,\n 'invoice_address' => $formattedInvoiceAddress,\n 'addresses' => array('invoice' => $invoiceAddress, 'delivery' => $deliveryAddress),\n 'tax_excluded_display' => $taxExcludedDisplay,\n 'display_product_images' => $displayProductImages,\n 'layout' => $layout,\n 'tax_tab' => $this->getTaxTabContent(),\n 'customer' => $customer,\n 'footer' => $footer,\n 'sellerTotal' => Tools::displayPrice($sellerTotal, $objCurrency),\n 'sellerTotalTax' => Tools::displayPrice($sellerTotalTax, $objCurrency),\n 'totalAdminCommission' => Tools::displayPrice($totalAdminCommission, $objCurrency),\n 'totalAdminCommissionTax' => Tools::displayPrice($totalAdminCommissionTax, $objCurrency),\n 'totalCommission' => Tools::displayPrice($totalAdminCommissionTax + $totalAdminCommission, $objCurrency),\n 'sellerCommissionRate' => $commissionRate,\n 'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_,\n 'round_type' => $roundType,\n 'legal_free_text' => $legalFreeText,\n );\n $this->context->smarty->assign($data);\n $this->context->smarty->assign(array('invoice_admin_seller' => 2));\n //To check admin product or not\n if ($this->id_seller) {\n $this->context->smarty->assign(array('is_admin_product' => $objModule->l('Seller')));\n } else {\n $this->context->smarty->assign(array('is_admin_product' => $objModule->l('Admin')));\n }\n $tpls = $this->getTpls();\n $this->context->smarty->assign($tpls);\n return $this->context->smarty->fetch($this->getTemplate('invoice'));\n }", "function getProfitYTD(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT SUM(revenue) - SUM(expense) AS 'profit' FROM invoices\");\n \n $results=false;\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "public function getLangebergSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 104\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getPrices()\n {\n }", "function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}", "public function getSellDetails()\n {\n if (request()->ajax()) {\n $start = request()->start;\n $end = request()->end;\n $business_id = request()->session()->get('user.business_id');\n\n $sell_details = $this->transactionUtil->getSellTotals($business_id, $start, $end);\n \n return $sell_details;\n }\n }", "public function generateExpenses()\n {\n \t//Iva\n \t$iva_expense = new Expense();\n \t$iva_expense->type = 'iva';\n \t$iva_expense->value = ($this->value * $this->iva_percetage)/100;\n \t$iva_expense->exchange_rate_cop = $this->exchange_rate_cop;\n \t$iva_expense->income_id = $this->id;\n \t$iva_expense->currency_id = $this->currency_id;\n \t$iva_expense->save();\n\n \t//Trsoft utility, se calcula con el valor después de descontar el iva\n\t\t$trsoft_utility_expense = new Expense();\n\t\t$trsoft_utility_expense->type = 'trsoft utility';\n\t\t//En la compra de una licencia la utilidad de trsoft aumenta\n\t\tif($this->type == 'license'){\n\t\t\t$trsoft_utility_expense->value = (\n\t\t\t\t//Valor despues de restarle el iva\n\t\t\t\t($this->value - $iva_expense->value) \n\t\t\t\t//Se calcula el % de utilidad de TrSoft, se separa la utilidad de socios\n\t\t\t\t* (100 - $this->partners_utility)\n\t\t\t)/100;\n\t\t}else if($this->type == 'commission'){\n\t\t\t//Cuando se paga una comisión la utiliad de TrSoft es la establecida\n\t\t\t$trsoft_utility_expense->value = (($this->value - $iva_expense->value) * $this->trsoft_utility)/100;\n\t\t}\n\n\t\t$trsoft_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$trsoft_utility_expense->state = 'paid out';\n\t\t$trsoft_utility_expense->income_id = $this->id;\n\t\t$trsoft_utility_expense->currency_id = $this->currency_id;\n\t\t$trsoft_utility_expense->save(); \n\n \t//Partners utility, se calcula con el valor después de descontar el iva\n\t\t$partners_utility_expense = new Expense();\n\t\t$partners_utility_expense->type = 'partners utility';\n\t\t$partners_utility_expense->value = (($this->value - $iva_expense->value) * $this->partners_utility)/100;\n\t\t$partners_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$partners_utility_expense->income_id = $this->id;\n\t\t$partners_utility_expense->currency_id = $this->currency_id;\n\t\t$partners_utility_expense->save(); \t\n\n\t\t//Si es el pago de una comisión se deben generar los egresos\n\t\t//para pago de comisión de traders y desarrollador\n\t\tif($this->type == 'commission'){\n\n\t\t}\n }", "public function obtenerBeneficiados(){\n \n //obtener datos de service\n return IncorporacionService::beneficiados();\n\n }", "public function retrieve_product_search_sales_report( $start_date,$end_date )\n\t{\n\t\t$dateRange = \"c.date BETWEEN '$start_date%' AND '$end_date%'\";\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t\t\n\t\t//$this->db->group_by('b.product_model');\n\t}", "public function getSummary();" ]
[ "0.7052269", "0.6625663", "0.65833104", "0.65596694", "0.6358199", "0.6344937", "0.63185763", "0.62113214", "0.6038706", "0.5953974", "0.5818879", "0.5816326", "0.56187576", "0.561654", "0.55583376", "0.5521509", "0.5507102", "0.54821646", "0.54545605", "0.5410496", "0.53917456", "0.5380994", "0.53668666", "0.53547376", "0.5336665", "0.53362614", "0.5332688", "0.53160983", "0.5314483", "0.52971995", "0.5296423", "0.5288552", "0.52719504", "0.5261371", "0.5255692", "0.52325344", "0.5220392", "0.52063584", "0.5184805", "0.5176812", "0.5171159", "0.51641107", "0.51447994", "0.51435536", "0.5137547", "0.5128226", "0.5121749", "0.5121654", "0.51179516", "0.5111366", "0.5110219", "0.5107539", "0.5106044", "0.50988793", "0.50843644", "0.50764495", "0.50750333", "0.5045184", "0.5038982", "0.503897", "0.5038079", "0.5036921", "0.503363", "0.5030728", "0.50271696", "0.5023361", "0.5012401", "0.5011184", "0.50095487", "0.5008937", "0.50068337", "0.50048304", "0.50019705", "0.50005007", "0.50004953", "0.49895045", "0.49790037", "0.49775824", "0.4973869", "0.49710312", "0.4970201", "0.49596745", "0.4953998", "0.4951471", "0.49427915", "0.49395514", "0.4938262", "0.49378917", "0.493464", "0.49288172", "0.4928809", "0.49252915", "0.4925107", "0.49157077", "0.49151617", "0.49147403", "0.49107772", "0.49039772", "0.4903067", "0.48988646" ]
0.547416
18
setting header to json
public function retrieveVisitorByCountry() { header('Content-Type: application/json'); //query to get the visitors grouped by country - for the current month $query = sprintf("SELECT ip,COUNT(recordID) AS visitors FROM ad_stats WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE())) GROUP BY ip;"); //execute query $result = $GLOBALS['db']->query($query); //loop through the returned data $data = array(); foreach ($result as $row) { $data[] = $row; } //free memory associated with result $result->close(); //return the data return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setHeaders(){\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n header('Content-type: application/json charset=utf8');\n }", "private function setHttpHeader($json = true)\n {\n $header = [\n \"Authorization: OAuth $this->token\",\n ];\n\n if ($json) {\n\n array_push($header, \"Content-type: application/json\");\n }\n\n curl_setopt(\n $this->curl,\n CURLOPT_HTTPHEADER,\n $header\n );\n }", "protected function setCurlHeaderElement() {\n // set header for cur\n $this->header[] = 'Content-type: application/json';\n $this->header[] = 'Authorization: Bearer '.$this->accessToken;\n }", "public function setHttpHeaders() {\n $this->_httpHeaders[] = \"Content-Type: application/json\";\n parent::setHttpHeaders();\n }", "public function setJSONHeaders() {\n\t\theader('P3P: CP=\"ALL CUR OUR\"'); // P3P privacy policy fix\n\t\theader(\"Cache-Control: no-store, no-cache, must-revalidate, max-age=0\");\n\t\theader(\"Cache-Control: post-check=0, pre-check=0\", false);\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\");\n\t\theader(\"Access-Control-Allow-Origin: *\");\n\t\theader('Access-Control-Allow-Credentials: true');\n\t\theader('Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Accept');\n\t\theader('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT');\n\t}", "protected function setHeader(){\n $this->header = [\n 'Auth-id' => $this->username,\n 'Auth-token' => $this->generateToken(),\n 'Timestamp' => time()\n ];\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }" ]
[ "0.69419104", "0.6914643", "0.6831124", "0.6768324", "0.6729442", "0.67286724", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352" ]
0.0
-1
setting header to json
public function retrieveVisitorByDate() { header('Content-Type: application/json'); //query to get the number of clicks of an advertisement $query = sprintf("SELECT COUNT(recordID) AS visitors,date FROM ad_stats GROUP BY date;"); //execute query $result = $GLOBALS['db']->query($query); //loop through the returned data $data = array(); foreach ($result as $row) { $data[] = $row; } //free memory associated with result $result->close(); //return the data return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setHeaders(){\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n header('Content-type: application/json charset=utf8');\n }", "private function setHttpHeader($json = true)\n {\n $header = [\n \"Authorization: OAuth $this->token\",\n ];\n\n if ($json) {\n\n array_push($header, \"Content-type: application/json\");\n }\n\n curl_setopt(\n $this->curl,\n CURLOPT_HTTPHEADER,\n $header\n );\n }", "protected function setCurlHeaderElement() {\n // set header for cur\n $this->header[] = 'Content-type: application/json';\n $this->header[] = 'Authorization: Bearer '.$this->accessToken;\n }", "public function setHttpHeaders() {\n $this->_httpHeaders[] = \"Content-Type: application/json\";\n parent::setHttpHeaders();\n }", "public function setJSONHeaders() {\n\t\theader('P3P: CP=\"ALL CUR OUR\"'); // P3P privacy policy fix\n\t\theader(\"Cache-Control: no-store, no-cache, must-revalidate, max-age=0\");\n\t\theader(\"Cache-Control: post-check=0, pre-check=0\", false);\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\");\n\t\theader(\"Access-Control-Allow-Origin: *\");\n\t\theader('Access-Control-Allow-Credentials: true');\n\t\theader('Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Accept');\n\t\theader('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT');\n\t}", "protected function setHeader(){\n $this->header = [\n 'Auth-id' => $this->username,\n 'Auth-token' => $this->generateToken(),\n 'Timestamp' => time()\n ];\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue()\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }" ]
[ "0.69419104", "0.6914643", "0.6831124", "0.6768324", "0.6729442", "0.67286724", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352", "0.6504352" ]
0.0
-1
query to get the total number of visitors for this month
public function totalAverageVisitors() { $query1 = "SELECT COUNT(recordID) AS totalVisitors FROM ad_stats WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()));"; $result = mysqli_query($GLOBALS['db'], $query1); $tempData1 = mysqli_fetch_assoc($result); $data['totalVisitors'] = $tempData1['totalVisitors']; //to get the final output $query2="SELECT AVG(visitors) AS avgVisitors FROM (SELECT date, COUNT(recordID)AS visitors FROM ad_stats GROUP BY date) AS T1;"; $result = mysqli_query($GLOBALS['db'], $query2); $tempData2 = mysqli_fetch_assoc($result); $data['avgVisitors'] = $tempData2['avgVisitors']; return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monthlyStats($month, $conn){\n $query = $conn->query(\"SELECT * FROM viewer_tbl\");\n $counter = 0;\n while ($data = $query->fetch_array()) {\n $dbMonth = $data['visited_date'];\n if($month == date('F' , strtotime($dbMonth))){\n ++$counter;\n }\n }\n return $counter;\n }", "public function getTotalMonth()\n {\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('date_created', array($last_thirty_days, $today))->count();\n }", "public function getNumberOfEventsPerMonth () {\n\t\t$driver = strtolower(Doctrine_Manager::connection()->getDriverName());\n\n\t\t$q = $this->createQuery('e');\n\t\t$q->select('COUNT(e.id) as num');\n\n\t\tif ($driver == 'sqlite') {\n\t\t\t$q->addSelect(\"strftime('%Y-%m-01', e.startdate) as date\");\n\t\t} else {\n\t\t\t$q->addSelect(\"DATE_FORMAT(e.startdate, '%Y-%m-01') as date\");\n\t\t}\n\n\t\t$q->groupBy('date');\n\t\t$q->orderBy('date asc');\n\n\t\treturn $q;\n\t}", "public function getLastOnlineTotalMonth()\n {\n //$today = Carbon::now('Asia/Singapore')->toDateString();\n //$timezone = new Carbon('Asia/Singapore');\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('last_online_date', array($last_thirty_days, $today))->count();\n }", "protected function get_totalVentas()\n {\n $ventas = DB::SELECT(\"SELECT SUM(subtotal) AS t_mes \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($ventas as $venta)\n {\n $totalMes = $venta->t_mes;\n }\n return $totalMes;\n }", "public function totCadastrosMes(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes a WHERE MONTH(a.data_cadastro) = Month(now());\";\n $rsclimes = $this->conexao->query($sql);\n $result = $rsclimes->fetch_array();\n $rstotclimes = $result['total'];\n\n return $rstotclimes;\n }", "public function totalViews()\n\t{\n\t\t$totalViewsQuery = $this->_generateColumnSumQuery('page_views');\n\n\t\treturn (int) $this->_runQuery($totalViewsQuery);\n\t}", "function getMonthlyOrdersCount($mounth){\n $id_user = Auth::user()->id;\n\n // Faccio una query al db per prendere tutti i ristoranti con l'id user dell'utente loggato\n $restaurants_list = Restaurant::select()->where('user_id', $id_user)->get();\n\n // Faccio una query al db Per prendermi dalla colonna delivery time solo il mese che voglio con la varibiale mounth\n $mounthly_orders_count = Order::whereMonth('delivery_time', $mounth)->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get()->count();\n\n return $mounthly_orders_count;\n }", "public function getTotalMonthPaginate()\n {\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('date_created', array($last_thirty_days, $today))->orderByRaw(\"FIELD(status , 'Approved', 'Disabled', 'Blocked') ASC\")->paginate(10);\n }", "public function countByMonths($request, $model, $column = 'created_at')\n {\n return $this->count($request, $model, Trend::BY_MONTHS, $column);\n }", "public static function select_count_by_current_month(){\n return DB::table('tb_order')\n ->whereRaw('month(datetime) = month(now()) and year(datetime) = year(now())', [])\n //->where('month(datetime)', 'month(now())')\n //->where('year(datetime)', 'year(now())')\n ->count();\n\t}", "public function getTotalRevisitToday()\n {\n return \\DB::selectOne(\"SELECT COUNT(id) as total FROM appr_dashboard_delay_order WHERE created_date BETWEEN :from AND :to AND delay_date BETWEEN :t AND :b\", [':from' => strtotime('today'), ':to' => strtotime('tomorrow'), ':t' => strtotime('today'), ':b' => strtotime('tomorrow')])->total;\n \n }", "protected function get_totalPedidos()\n {\n $pedidos = DB::SELECT(\"SELECT COUNT(*) AS t_pedidos \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($pedidos as $pedido)\n {\n $pedid_mes = $pedido->t_pedidos; \n }\n return $pedid_mes;\n }", "public function countTotalDays($m = NULL){\n\t\t\t$count = 0;\n\t\t\t$first = true;\n\t\t\tforeach(array_reverse(array_keys($this->entries)) as $month){\n\t\t\t\tif($month == $m) $count = 0;\n\t\t\t\tif($first){\n\t\t\t\t\t$first = array_keys(array_reverse($this->entries[$month]));\n\t\t\t\t\t$first = explode(\"-\", $firstmonth[0]);\n\t\t\t\t\t$count += date(\"n\", strtotime($month)) - $first[2] - 1;\n\t\t\t\t\t$first = false;\n\t\t\t\t} else if(date(\"n\", strtotime($month)) == date(\"n\")) $count += date(\"j\") - (time() < strtotime($this->config->emailTime));\n\t\t\t\telse $count += date(\"t\", strtotime($month));\n\t\t\t\tif($month == $m) break;\n\t\t\t}\n\t\t\treturn $count;\n\t\t}", "public function monthlyViews()\n {\n // Group and map views to a collection of totals\n return $this->views\n ->groupBy(function($view) {\n return $view->created_at->format('m/y');\n })\n ->map(function ($views) {\n $view = $views->first();\n\n return collect([\n 'id' => $view->created_at->format('m-y-').\n $view->episode_uuid,\n 'episode_uuid' => $view->episode_uuid,\n 'total' => $views->count(),\n 'label' => $view->created_at->format('m/y'),\n ]);\n });\n }", "public function getTotalVisitorsAndPageViews(Period $period);", "public function get_monthly_registrations($month, $year)\r\n {\r\n $this->db->select('COUNT(child_id) AS child_count'); \r\n \r\n $this->db->from($this->table);\r\n\r\n $date_from = $year . '-' . $month . '-01';\r\n $date_to = $year . '-' . $month . '-31';\r\n\r\n $this->db->where('date_registered >=', $date_from);\r\n $this->db->where('date_registered <=', $date_to);\r\n $this->db->where('removed', '0');\r\n \r\n $query = $this->db->get();\r\n\r\n $data['child_count'] = $query->row()->child_count;\r\n\r\n return $data;\r\n }", "public function total_reservas_sala_mes($fecha) // reservas sin eliminar // //PDF\n {\n\n $q_string = \"select sala, count(sala) as cant from reservas where month(fecha) = month('\".$fecha.\"') and eliminada ='0' and estado ='1' group by sala\";\n //select sala, count(sala) as cant\n //from reservas where month(fecha) ='6' and eliminada ='0' and estado ='1'\n //group by sala\n\t \t $data = $this->db->query($q_string);\n\t\t return $data;\n\t}", "public function totalOfMonth() {\n\n $query = \"SELECT SUM(TOTAL) AS TOTAL_MONTH FROM BUY WHERE\" .\n \" MONTH(BUYDATE) = MONTH(NOW()) AND YEAR(BUYDATE) = YEAR(NOW()) \";\n\n $result = parent::query($query);\n\n if ($row = $result->fetch_assoc()) {\n return $row['TOTAL_MONTH'];\n }\n\n return null;\n }", "function getSpotCountPerMonth($limit) {\n if (empty($limit)) {\n return $this->_conn->arrayQuery(\"SELECT EXTRACT(MONTH FROM to_timestamp(stamp)) AS data,\n COUNT(*) AS amount\n FROM spots\n GROUP BY data\");\n } else {\n return $this->_conn->arrayQuery(\"SELECT EXTRACT(MONTH FROM to_timestamp(stamp)) AS data,\n COUNT(*) AS amount\n FROM spots\n WHERE stamp > :stamp\n GROUP BY data\",\n array(\n ':stamp' => array(strtotime(\"-1\" . $limit), PDO::PARAM_INT)\n ));\n } # else\n\t}", "function getMonthTotal(){\n\t\t$total = $this->hhRentAmount;\n\t\tforeach ($this->members as $member){\n\t\t\tforeach ($member->getBills() as $bill){\n\t\t\t\t$total += $bill->getBillAmount();\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "public function getCurrentMonthTotalOrder() : int;", "public function totalCount();", "public function totalCount();", "public function total()\r\n {\r\n $db = $this->app->make('database')->connection();\r\n\r\n return (int) $db->fetchColumn('\r\n SELECT COUNT(1) FROM ImageOptimizerProcessedFiles \r\n WHERE UNIX_TIMESTAMP(processedAt) >= UNIX_TIMESTAMP(LAST_DAY(CURDATE()) + INTERVAL 1 DAY - INTERVAL 1 MONTH)\r\n AND UNIX_TIMESTAMP(processedAt) < UNIX_TIMESTAMP(LAST_DAY(CURDATE()) + INTERVAL 1 DAY)\r\n ');\r\n }", "public function graphmonthused_dashboard()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-0'.$i\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "function get_page_visit_count($mysql) {\n\t$prepared = $mysql->prepare('SELECT COUNT(*) AS visit_count FROM visits;');\n\t$prepared->execute();\n\t$result = $prepared->get_result(); \n\t$visit_count = $result->fetch_object()->visit_count;//fetch method on $result\n\n\treturn $visit_count; //outputs the new page visit number\n}", "public function getMonthlyHits() {\n\t\t$sql = 'SELECT *, ROUND((counter / (SELECT sum(counter) FROM analytics WHERE insertdate BETWEEN DATE_SUB(NOW(),INTERVAL 1 MONTH) AND NOW() ORDER BY counter DESC LIMIT 10)*100),2) as hits FROM analytics WHERE insertdate BETWEEN DATE_SUB(NOW(),INTERVAL 1 MONTH) AND NOW() GROUP BY pagename ORDER BY counter DESC LIMIT 10';\n\t\n\t\t//execute the query\n\t\t$rows = $this->db->clean($sql);\n\t\t\n\t\t$maxwidth = 173;\n\t\t$max = $rows[0]['hits'];\n\t\t\n\t\tforeach($rows as $key => $row) {\n\t\t\n\t\t\t$rows[$key]['maxwidth'] = round($maxwidth * ($row['hits']/$max));\n\t\t}\n\t\t\n\t\t//return the results\n\t\treturn array('month' => $rows);\n\t}", "private function _getVisitorCounts( $Days = 1 ) {\n $txnTable = $this->settings['txnTable'];\n $Days = nullInt( $Days, 1 );\n $rVal = 0;\n\n $sqlStr = \"SELECT DATE_FORMAT(`DateStamp`, '%Y-%m-%d') as `DTS`, sum(`Hits`) as `PageViews`\" .\n \" FROM `$txnTable`\" .\n \" WHERE `isResource` = 'N' and `isDeleted` = 'N'\" .\n \" and `DateStamp` >= DATE_FORMAT(DATE_SUB(Now(), INTERVAL $Days DAY), '%Y-%m-%d %H:00:00')\" .\n \" and `SiteID` = \" . nullInt($this->settings['SiteID']) .\n \" GROUP BY `DTS`;\";\n $rslt = doSQLQuery( $sqlStr );\n if ( is_array($rslt) ) {\n $rVal = nullInt( $rslt[0]['PageViews'] );\n }\n \n writeNote( \"PageViews: $rVal\" );\n\n // Return the Array\n return $rVal;\n }", "public function graphmonthused()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\t$splitday \t= \texplode('-', $this->use_date);\n \t\t// check day in month\n \t\t$lastday \t= \tcal_days_in_month(CAL_GREGORIAN,$splitday[1],$splitday[0]);\n \t\tfor ($i = 1; $i <= $lastday; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t= \tarray(\n \t\t\t\t\t'use_date' \t\t=> \t\t$splitday[0].'-'.$splitday[1].'-0'.$i, \n \t\t\t\t\t'use_appid' \t=> \t\t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_date' \t=> \t$splitday[0].'-'.$splitday[1].'-'.$i, \n \t\t\t\t\t'use_appid' => \t$this->use_appid\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'lastday'\t=>\t$lastday,\n \t\t\t'data'\t\t=>\tarray(\n\t\t\t\t'name'\t\t=>\t\t'User',\n \t\t\t\t'data'\t\t=>\t\t$count\n \t\t\t\t)\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "function getResultForMonthlyRegistered(){\n global $mysqli;\n\n $sql = \"SELECT DATE_FORMAT(u.register_date, '%M') as \\\"month\\\",\n EXTRACT(YEAR from u.register_date) as \\\"year\\\" ,\n count(*) as \\\"registered users\\\" \n FROM users u \n group by month, year \n HAVING year = 2020\n order by FIELD(month,'January','February','March','April','May','June','July','August','September','October','November','December')\";\n\n $result = $mysqli->query($sql);\n return $result->fetch_all(MYSQLI_ASSOC);\n}", "public function gettotalStoriesPerMonth() {\n $googleVis = new Googlevis();\n $columns = $googleVis->createColumns(\n array('Year/Month' => 'string', 'No. of Stories' => 'number')\n );\n\n $estimate_data = $this->getEstimateDataByMonth(\n $this->easybacklogClient->getStoriesFromTheme()\n );\n\n $row = $rows = $row_data = $row_label = array();\n\n foreach($estimate_data AS $year => $month) {\n foreach($month AS $month_no => $stories) {\n foreach($stories AS $story) {\n $counter = (!isset($counter) ? 0 : $counter);\n $counter += $story;\n }\n $rows[] = $googleVis->createDataRow(\n $year .\"/\". $month_no,\n $counter\n );\n $counter = 0;\n }\n }\n return array('cols' => $columns, 'rows' => $rows);\n }", "public function getMonthlyUserStats()\n {\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month )) as months group by monthName'));\n\n $total = [\n 'January' => 0,\n 'February' => 0,\n 'March' => 0,\n 'April' => 0,\n 'May' => 0,\n 'June' => 0,\n 'Jule' => 0,\n 'August' => 0,\n 'September' => 0,\n 'October' => 0,\n 'November' => 0,\n 'December' => 0\n ];\n\n $active = $total;\n\n foreach ($stats as $stat){\n $total[$stat->monthName] = $stat->usercount;\n }\n\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month) and is_active = 1) as months group by monthName'));\n\n foreach ($stats as $stat){\n $active[$stat->monthName] = $stat->usercount;\n }\n\n return [\n 'total' => $total,\n 'active' => $active\n ];\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "static function adminGetVisitsCount($id)\r\n {\r\n if ($id)\r\n {\r\n $sql = \"SELECT COUNT(id) FROM metric_visits WHERE metric_id={$id} LIMIT 1\";\r\n $res = Yii::app()->db->createCommand($sql)->queryScalar();\r\n }\r\n return $res;\r\n }", "public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}", "public function getNumberOfDays($month = \"\"){ $month = ($month == \"\")? $this->getMonth(): $month; return cal_days_in_month(CAL_GREGORIAN,$month,$this->getYear());}", "public function getCounterOfMonth($month = 0) {\n\t\t$month = (0 === $month OR $month > 12 OR $month < 1) ? $this->Request->month : $month;\n\t\t$this->Db->query(\"SELECT COUNT(*) FROM `yp_stat` \n\t\t\tWHERE `month` = {$month}\n\t\t\t\tAND `year` = {$this->Request->year}\");\n\t\t$stat = $this->Db->fetch_field();\n\n\t\treturn (int) $stat[0];\n\t}", "public function totalMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor+c.troco),0) as total from tbpedido_pagamento c WHERE MONTH(c.data_pagamento) = MONTH(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_assoc();\n $totalgeral = $result['total'];\n\n return $totalgeral;\n }", "public function fetchTotal($start=null, $end=null)\r\n {\r\n $conditions = array(\r\n 'action' => 'Visited Site'\r\n );\r\n \r\n if (!empty($start)) {\r\n \t$conditions['created'] = array('$gte' => strtotime($start));\r\n }\r\n \r\n if (!empty($end)) {\r\n if (empty($conditions['created'])) {\r\n $conditions['created'] = array('$lt' => strtotime($end));\r\n } else {\r\n $conditions['created']['$lt'] = strtotime($end);\r\n }\r\n \r\n }\r\n \r\n $return = \\Activity\\Models\\Actions::collection()->count($conditions);\r\n\r\n return $return;\r\n }", "public function getMonthCardCount()\n {\n return $this->count(self::_MONTH_CARD);\n }", "public function getMonthCardCount()\n {\n return $this->count(self::_MONTH_CARD);\n }", "public function vendasMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(count(*),0) as vendames FROM tbpedidos c WHERE MONTH(c.data_finaliza) = MONTH(now()) and c.status = 'F';\";\n $rsvendames = $this->conexao->query($sql);\n $result2 = $rsvendames->fetch_array();\n $totalmes = $result2['vendames'];\n\n return $totalmes;\n }", "function getVisitorsOnline(): int\n{\n return cache()->remember('i.visitorsOnline', getCacheILifetime('visitorsOnline'), function () {\n $onlinePeriod = 10; // minutes\n return \\App\\Models\\PageViews::select('user_ip')\n ->distinct()\n ->where('created_at', '>', now()->subMinutes($onlinePeriod))\n ->count(['user_ip']);\n });\n}", "public function getTotal($month = null) {\r\n $query = $this->createQuery($this->_alias)\r\n ->select(\"SUM(cp.amount) AS total_amount\");\r\n\r\n if ($month) {\r\n $query->where(\"DATE_FORMAT(cp.created_at, '%Y-%m') = ?\", $month);\r\n }\r\n\r\n $res = $query->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\r\n\r\n if (count($res) > 0) {\r\n $res = $res[0][\"cp_total_amount\"];\r\n }\r\n\r\n return $res;\r\n }", "public static function visitorCount() {\n\t\treturn self::$sessionInstance->visitorCount ();\n\t}", "public function getLastOnlineTotalMonthPaginate()\n {\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('last_online_date', array($last_thirty_days, $today))->orderByRaw(\"FIELD(status , 'Approved', 'Disabled', 'Blocked') ASC\")->paginate();\n }", "function getNbDayInMonth()\n {\n return $this->nbDaysMonth;\n }", "public function getMonthlyInstalment();", "function getUniqueVisitorsData() {\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n \n $lastmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', '01', '-');\n $lastmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', 't', '-');\n \n $currentmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', '01', '-');\n $currentmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', 't', '-');\n \n //echo $lastmonthStartDate.\"==\".$lastmonthEndDate.'<br>'.$currentmonthStartDate.'=='.$currentmonthEndDate;\n //die;\n \n //For Calculating last month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$lastmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$lastmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['last']['count']=$arrData[0]['count'];\n \n //For Calculating current month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$currentmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$currentmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['current']['count']=$arrData[0]['count'];\n \n \n //pre($arrRes);\n return $arrRes;\n }", "public static function getOrdersCount($merchantId,$month)\n {\n if(is_numeric($merchantId)) \n {\n $result = [];\n //$response['order'] = 0;\n $response['revenue'] = 0;\n \n $total = 0; \n $revenue = 0.00;\n\n $query = \"SELECT `id`,`order_data` FROM `jet_order_detail` WHERE `merchant_id` ='{$merchantId}' AND `order_real_status`='' AND `status` = 'complete' AND `shipped_at` LIKE '%\".$month.\"%' \"; \n\n $result = Data::sqlRecords($query, 'all','select');\n if (!empty($result)) \n {\n $revenue = self::calculateRevenue($result);\n $response = ['revenue'=>$revenue];\n //$total = count($result);\n //$response = ['order'=>$total,'revenue'=>$revenue];\n }\n return $response; \n } \n }", "public static function totalMatchesToday()\n {\n return Match::whereDate('created_at', today())->get()->count();\n }", "public function getTotal()\n {\n $response = $this->client->post( 'https://idf.intven.com/public_patent_listing.json', [\n 'verify' => false,\n 'json' => [\n \"report_type\" => \"public_patent_listing\",\n \"queryFields\" => new \\stdClass(),\n \"filters\" => new \\stdClass(),\n \"per_page\" => 0,\n \"from\" => 0,\n \"sort\" => \"issued_on\",\n \"sort_order\" => \"desc\"\n ],\n ]);\n $data = json_decode($response->getBody()->getContents());\n return $data->meta_data->total_count;\n }", "public function countByDate(){\n $query = $this->createQueryBuilder('o')\n ->select('SUBSTRING(o.creatAt, 1, 10) as dateOffres, COUNT(o) as count')\n ->groupBy('dateOffres')\n ;\n return $query->getQuery()->getResult();\n\n }", "public function statisticUserBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM user GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "public function get_itemmonth_total($options) {\n $item_table='sb_items';\n $this->db->select('count(distinct(isale.item_id)) as cnt');\n $this->db->from('v_itemsales isale');\n $this->db->join(\"{$item_table} i\",'i.item_id=isale.item_id');\n if (isset($options['search']) && !empty($options['search'])) {\n $this->db->like('concat(upper(i.item_number),upper(i.item_name))',$options['search']);\n }\n $this->db->where('isale.yearsale >=',$options['startyear']);\n $this->db->where('isale.yearsale <=',$options['curentyear']);\n if ($options['brand']!='ALL') {\n if ($options['brand']=='SR') {\n $this->db->where('isale.brand', $options['brand']);\n } else {\n $this->db->where_in('isale.brand', ['BT','SB']);\n }\n }\n $this->db->where('isale.qtysale > ',0);\n $data=$this->db->get()->row_array();\n return $data['cnt'];\n }", "function countTodayCount(){\n//\t\t$start = mktime(0, 0, 0,$month, $day, $year);\n//\t\t$end = mktime(0, 0, 0, $month, $day+1, $year)-1;\n\t\t\n\t\t$where = \"mq_status='QSA001'\";\n\t\treturn parent::count($where);\n\t}", "public static function totalPreMonth(){\n $data = DB::table('auctions')->select(DB::raw('substr(date,1,2) as month'), DB::raw('SUM(tax_amount) as total'))->groupBy(\"month\")->get();\n return $data;\n }", "public function getMonthlyDataCount($month, $id)\n {\n \t$copyright_count = DB::table('copyrights')\n \t\t->join('applicants', 'copyrights.int_applicant_id', '=', 'applicants.int_id')\n\t ->join('departments', 'applicants.int_department_id', '=', 'departments.int_id')\n\t ->join('colleges', 'departments.int_college_id', '=', 'colleges.int_id')\n\t ->join('branches', 'colleges.int_branch_id', '=', 'branches.int_id')\n\t ->select(DB::raw('copyrights.int_id'))\n\t ->whereMonth('copyrights.created_at', $month)\n\t ->where('departments.int_id', $id)\n\t ->get()\n ->count();\n return $copyright_count;\n }", "private function count_chrono_records(){\n\t\t$searchmonthnext = $this->searchmonth + 1;\n\t\t$start = mktime(0, 0, 0, $this->searchmonth, 1, $this->searchyear);\n\t\t$end = mktime(23, 59, 59, $searchmonthnext, 0, $this->searchyear);\n\t\t\n\t\ttry {\n \t\t \t\t$stmt = $this->db->prepare(\" SELECT COUNT(*) FROM $this->tablename WHERE $this->record_date >= :start AND $this->record_date <= :end \");\n\t\t\t\t$stmt->bindValue(':start', $start, PDO::PARAM_INT);\n\t\t\t\t$stmt->bindValue(':end', $end, PDO::PARAM_INT);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$this->volume_of_records_in_timerange = $stmt->fetchColumn();\n\t\t} catch(PDOException $ex) {\n\t\t \t\t$this->display_svg_graph = \"<p>Unable to count records.</p>\";\n\t\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function monthly_sales_report()\n\t{\n\t\t$query1 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tdate,\n\t\t\t\tEXTRACT(MONTH FROM date) as month, \n\t\t\t\tCOUNT(invoice_id) as total\n\t\t\tFROM \n\t\t\t\tinvoice\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\t$query2 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tpurchase_date,\n\t\t\t\tEXTRACT(MONTH FROM purchase_date) as month, \n\t\t\t\tCOUNT(purchase_id) as total_month\n\t\t\tFROM \n\t\t\t\tproduct_purchase\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM purchase_date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM purchase_date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\treturn [$query1,$query2];\n\t}", "public function getCurrentMonthTotalRevenue() : float;", "function getTotalPages()\n{\n include('connecter.php');\n if($con)\n {\n $nbr = $con->query('SELECT COUNT(*) AS nbre_total FROM invite');\n $resultat = $nbr->fetch();\n return $resultat['nbre_total'];\n }\n return -1;\n \n}", "public function getTotalEntries(){\n if($this->databaseConnection()){\n $query = $this->db_connection->prepare('select count(*) from events ');\n $query->execute();\n $result = $query->fetchColumn();\n return $result; \n }\n }", "private function countRegisteredUsers( &$users ): void\n {\n foreach($users as $user)\n {\n if( $user -> created_at && $user -> created_at -> year == $this -> year)\n {\n $this -> data[ self :: REGISTERED ][ $user -> created_at -> month - 1 ]++;\n }\n }\n }", "public function retrieveVisitorByCountry()\n {\n header('Content-Type: application/json');\n\n //query to get the visitors grouped by country - for the current month\n $query = sprintf(\"SELECT ip,COUNT(recordID) AS visitors FROM ad_stats WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE())) GROUP BY ip;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "public static function getMonthlySales()\n\t{\n\t\tTools::displayAsDeprecated();\n\t\t$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('\n\t\tSELECT SUM(`total_paid`) as nb\n\t\tFROM `'._DB_PREFIX_.'orders`\n\t\tWHERE MONTH(`date_add`) = MONTH(NOW())\n\t\tAND YEAR(`date_add`) = YEAR(NOW())');\n\n\t\treturn isset($result['nb']) ? $result['nb'] : 0;\n\t}", "public function getMontoTotal() {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t');\n return $command->queryRow()['total'];\n }", "public function buildTodayVisitors(): string\n {\n $startDate = Carbon::today();\n $endDate = Carbon::now();\n\n $visitorsData = AnalyticsFacade::performQuery(Period::create($startDate, $endDate), 'ga:users');\n\n return $visitorsData->totalsForAllResults['ga:users'];\n }", "function total_visa_transactions_amount(){\n $today_visa_rec_q = mysql_query(\"SELECT COUNT(order_id) AS TOTAL_VISA_ORDERS,SUM(amount) AS TOTAL_AMOUNT FROM orders WHERE (card_payment_type = '1' OR card_payment_type = 'V') AND DATE_FORMAT(timestamp,'%Y-%m-%d') = CURDATE()\")or die(mysql_error());\n $today_visa_rec = mysql_fetch_assoc($today_visa_rec_q);\n $total_visa_transactions = $today_visa_rec[\"TOTAL_VISA_ORDERS\"];\n $total_visa_transactions_amount = $today_visa_rec[\"TOTAL_AMOUNT\"];\n return $total_visa_transactions_amount;\n }", "function Monthly_Requests($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year, DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }", "public function getOldVisitsCountForThisYear($current_visit_id, $visitor_id = \"\") {\n\t\t$criteria = new CDbCriteria;\n\t\t$this->visitor = ($visitor_id !=\"\") ? $visitor_id : $this->visitor;\n\t\t$criteria->addCondition(\" ( id != '\" . $current_visit_id . \"' ) AND \"\n\t\t\t. \" tenant = \" . Yii::app()->user->tenant . \" \"\n\t\t\t. \" AND (visit_status != \" . VisitStatus::SAVED . \" AND visit_status != \" . VisitStatus::PREREGISTERED . \" ) \"\n\t\t\t. \" AND visitor = '\" . $this->visitor . \"' AND is_deleted = 0\");\n\t\t$criteria->order = \"id DESC\";\n\n\t\t$visits = $this->findAll($criteria);\n\t\tif ($visits) {\n\t\t\t$visitCount = 0;\n\t\t\tforeach ($visits as $key => $v) {\n\n\t\t\t\t//Important: if reset_id is 1 for a visit then don't count old visits before that reset visit.\n\t\t\t\tif( $v[\"reset_id\"] ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$dateIn = new DateTime($v[\"date_check_in\"]);\n\t\t\t\t$dateOut = new DateTime($v[\"date_check_out\"]);\n\t\t\t\t$dateClosed = !is_null($v[\"visit_closed_date\"]) ? new DateTime($v[\"visit_closed_date\"]) : $dateOut;\n\t\t\t\t$dateNow = new DateTime(\"NOW\");\n\n\t\t\t\t// For the current Year Only\n\t\t\t\tif ($dateNow->format(\"Y\") == $dateIn->format(\"Y\")) {\n\n\t\t\t\t\tswitch ($v->visit_status) {\n\t\t\t\t\t\tcase VisitStatus::CLOSED:\n\t\t\t\t\t\tcase VisitStatus::AUTOCLOSED:\n\t\t\t\t\t\t\tif($dateOut < $dateClosed) // back-date issue Manual Visits\n\t\t\t\t\t\t\t\t$visitCount += $dateIn->diff($dateOut)->days + 1;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$visitCount += $dateIn->diff($dateClosed)->days + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase VisitStatus::EXPIRED:\n\t\t\t\t\t\t\t$visitCount += $dateIn->diff($dateOut)->days + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase VisitStatus::ACTIVE:\n\t\t\t\t\t\t\t$visitCount += $dateIn->diff($dateNow)->days;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$visitCount += $dateIn->diff($dateOut)->days + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $visitCount;\n\n\t\t} else\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t}", "public function findUserByMonth()\n {\n $query = $this->getEntityManager()\n ->createQuery(\"\n SELECT COUNT(u.id) as total FROM OwbazUserBundle:User u\"\n );\n try { \n return $query->getArrayResult();\n \n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n } \n }", "function totalHari($month,$year){\n $jumlah = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n return $jumlah;\n}", "public function perMonth (){\n $data = Auction::totalPreMonth();\n return view(\"welcome\")->with('totalPerMonth',$data); \n }", "function showtotals(){\nglobal $XUSER, $SERVER, $ROOMS;\ncleanOnline();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]online\");\n$RV[0] = 0; $RV[1] = 0; $RV[2] = 0;\nwhile($row = Do_Fetch_Row($q)){\n$q2 = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]users WHERE username='$row[1]'\");\n$row2 = Do_Fetch_Row($q2);\nif($row2[4] == 4 || $row2[4] == 5){\n$RV[0]++;\n}else{\n$RV[1]++;\n}\n}\ncleanRooms();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]rooms\");\nwhile($row = Do_Fetch_Row($q)){\n$RV[2]++;\n}\nreturn $RV;\n}", "function getMovieCount(){\n return $this->query(\"SELECT COUNT(id) as number FROM docs WHERE visible=1\");\n }", "public function userStatics()\n { \n if (func_num_args() > 0) {\n $year = func_get_arg(0);\n $select = \"SELECT COUNT(u.user_id) AS total, m.month\n FROM (\n SELECT 'JAN' AS MONTH\n UNION SELECT 'FEB' AS MONTH\n UNION SELECT 'MAR' AS MONTH\n UNION SELECT 'APR' AS MONTH\n UNION SELECT 'MAY' AS MONTH\n UNION SELECT 'JUN' AS MONTH\n UNION SELECT 'JUL' AS MONTH\n UNION SELECT 'AUG' AS MONTH\n UNION SELECT 'SEP' AS MONTH\n UNION SELECT 'OCT' AS MONTH\n UNION SELECT 'NOV' AS MONTH\n UNION SELECT 'DEC' AS MONTH\n ) AS m\n LEFT JOIN users u ON MONTH(STR_TO_DATE(CONCAT(m.month, ' $year'),'%M %Y')) = MONTH(u.reg_date) AND YEAR(u.reg_date) = '$year'\n GROUP BY m.month\n ORDER BY 1+1\";\n\n $result = $this->getAdapter()->fetchAll($select); \n return $result;\n }\n }", "function totalvacantes_reclutador($idReclutador){\r\n $funciones = new funciones;\r\n $funciones->conectar();\r\n $sql=\"select \r\n tblmeses.descmes,ifnull(total,0) as total\r\n from\r\n tblmeses\r\n left join\r\n (select \r\n count(tblvacante.folSolici) as total,\r\n idmes,\r\n descmes,\r\n idReclutador\r\n from\r\n tblmeses\r\n left join tblsolicitud ON month(tblsolicitud.iniSolici) = tblmeses.idmes\r\n left join tblvacante ON tblvacante.folSolici = tblsolicitud.folSolici\r\n where\r\n idReclutador =\".$idReclutador.\"\r\n group by idmes , idReclutador) as t1 ON t1.idmes = tblmeses.idmes\r\n group by tblmeses.idmes\r\n \";\r\n $result = mysql_query($sql) or die(mysql_error());\r\n $datos = array();\r\n while($fila = mysql_fetch_array($result)){\r\n $datos[]=$fila;\r\n }\r\n return $datos;\r\n \r\n }", "public function getTotalGuests ()\n {\n return Guests::where([ 'is_active' => 1 ])\n ->count();\n }", "public function statisticItineraryBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM itinerary GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "public function totalOrdersByDate()\n {\n $data = [\n 'ano' => (int)date('Y'),\n 'mes' => (int)date('m'),\n 'dia' => (int)date('d'),\n ];\n\n /*$ano = Pedido\n ::selectRaw('YEAR(created_at) as ano, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('YEAR(created_at)'), [$data['ano'], $data['ano'] - 1])\n ->groupBy(DB::raw('YEAR(created_at)'))\n ->orderBy(DB::raw('YEAR(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (count($ano) == 1 && $data['ano'] == $ano[0]['ano']) {\n $ano[] = [\n 'ano' => $data['ano'] - 1,\n 'count' => 0\n ];\n }*/\n\n $mes = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('MONTH(created_at)'), [$data['mes'], $data['mes'] - 1])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($mes[0])) {\n $mes[] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n\n if (count($mes) == 1) {\n if ($data['mes'] == $mes[0]['mes']) {\n $mes[] = [\n 'mes' => $data['mes'] - 1,\n 'count' => 0\n ];\n } elseif (($data['mes'] - 1) == $mes[0]['mes']) {\n $mes[] = $mes[0];\n\n $mes[0] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n }\n\n if ($mes[1]['mes'] === 0) {\n $mes[1]['count'] = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->where(DB::raw('MONTH(created_at)'), '=', 12)\n ->where(DB::raw('YEAR(created_at)'), '=', ($data['ano'] - 1))\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n $mes[1]['count'] = $mes[1]['count'][0]['count'];\n $mes[1]['mes'] = 12;\n }\n\n $dia = Pedido\n ::selectRaw('DAY(created_at) as dia, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('DAY(created_at)'), [$data['dia'], $data['dia'] - 1])\n ->where(DB::raw('MONTH(created_at)'), '=', $data['mes'])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('DAY(created_at)'))\n ->orderBy(DB::raw('DAY(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($dia[0])) {\n $dia[] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n\n if (count($dia) == 1) {\n if ($data['dia'] == $dia[0]['dia']) {\n $dia[] = [\n 'dia' => $data['dia'] - 1,\n 'count' => 0\n ];\n } elseif (($data['dia'] - 1) == $dia[0]['dia']) {\n $dia[] = $dia[0];\n\n $dia[0] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n }\n\n $mesesExtenso = Config::get('core.meses');\n\n $pedidos = [\n /*'ano' => [\n 'atual' => [$ano[0]['ano'], $ano[0]['count']],\n 'ultimo' => [$ano[1]['ano'], $ano[1]['count']],\n ],*/\n 'mes' => [\n 'atual' => [$mesesExtenso[(int)$mes[0]['mes']], $mes[0]['count']],\n 'ultimo' => [$mesesExtenso[(int)$mes[1]['mes']], $mes[1]['count']],\n ],\n 'dia' => [\n 'atual' => [$dia[0]['dia'], $dia[0]['count']],\n 'ultimo' => [$dia[1]['dia'], $dia[1]['count']],\n ]\n ];\n\n return $this->listResponse($pedidos);\n }", "function get_pedido_cant_ventas()\n {\n $date = Carbon::now();\n $currentDate = $date->format('Y-m-d');\n $total_pedidos = DB::table('pedidos')->select(DB::raw('COUNT(*) as ventas_cant'))->whereRaw('DATE(\"created_at\") = ?',[$currentDate])->first();\n return $total_pedidos;\n }", "function Count_visitors() {\n\t\t$this->referer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : \"\";\n\t\t$this->host = \"www.\".ltrim($_SERVER['HTTP_HOST'], \"www.\");\n\t\t$this->db_connect();\n\t}", "function dashboard($data) {\n\t\t$month = $data->filter(function($user){ return $user->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($user){ return $user->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($user){ return $user->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($user){ return $user->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t\t$results = collect([\n\t\t\t\t'month' => $month->count(),\n\t\t\t\t'lastmonth' => $lastmonth->count(),\n\t\t\t\t'year' => $year->count(),\n\t\t\t\t'lastyear' => $lastyear->count(),\n\t\t\t\t'total' => $data->count(),\n\t\t\t]);\n\t\t\tif(isset($data[0]['amount'])) {\n\t\t\t\t$results = $results->union([\n\t\t\t\t\t'month_sum' => $month->sum('amount'),\n\t\t\t\t\t'lastmonth_sum' => $lastmonth->sum('amount'),\n\t\t\t\t\t'year_sum' => $year->sum('amount'),\n\t\t\t\t\t'lastyear_sum' => $lastyear->sum('amount'),\n\t\t\t\t\t'total_sum' => $data->sum('amount'),\n\t\t\t\t]);\n\t\t\t};\n\t return $results;\n\t}", "public function countCalendarEventDates() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_calendar_event_date\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute();\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}", "public function get_total_seatizen_in_a_month($year = NULL, $month = NULL) {\n\n if ($year == NULL || $month == NULL) {\n $year = date(\"Y\");\n $month = date(\"m\");\n }\n\n // check if table exist in db.\n if (!$this->_current_db->table_exists($this->_primary_table)) {\n return NULL;\n }\n\n $this->_current_db->select(\n \"DAY(\". $this->_primary_table .\".create_date) AS day, \".\n \"COUNT(\". $this->_primary_table .\".create_date) AS total\"\n );\n\n $this->_current_db->where(\"YEAR(\". $this->_primary_table .\".create_date)\", $year);\n $this->_current_db->where(\"MONTH(\". $this->_primary_table .\".create_date)\", $month);\n $this->_current_db->where($this->_primary_table .\".activation\", \"ACTIVE\");\n\n $this->_current_db->group_by(\"DATE(\". $this->_primary_table .\".create_date)\");\n $this->_current_db->order_by(\"day\", \"ASC\");\n\n $query = $this->_current_db->get($this->_primary_table);\n\n return $query->result_array();\n }", "public function retrieveVisitorByDate()\n {\n header('Content-Type: application/json');\n\n //query to get the number of clicks of an advertisement\n $query = sprintf(\"SELECT COUNT(recordID) AS visitors,date FROM ad_stats GROUP BY date;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "function calcNumActiveGuests(){\r\n\t /* Calculate number of GUESTS at site */\r\n\t $sql = $this->connection->query(\"SELECT * FROM \".TBL_ACTIVE_GUESTS);\r\n\t $this->num_active_guests = $sql->rowCount(); \r\n\t}", "function page_total(){\r\n $num_users = $this->reg->db->getRow('SELECT COUNT(id)\r\n FROM system__content\r\n WHERE user_id = ?', array($_SESSION['SYSTEM']['USER_ID']));\r\n\r\n // calculate total pages\r\n $pages = floor($num_users[0]/30);\r\n if($num_users[0]%30)\r\n $pages++;\r\n\r\n return $pages;\r\n }", "public function getTotalResults();", "public function statistics()\n\t{\n\t\t// $sql_query .= \"FROM transactions \";\n\t\t// $sql_query .= \"WHERE date(date_ordered) > date_ordered - INTERVAL 30 DAY \";\n\t\t// $sql_query .= \"GROUP BY date(date_ordered) \";\n\t\t// $sql_query .= \"ORDER BY date_ordered DESC \";\n\n\t\t// $new_cust_30_days = DB::select($sql_query);\n\n\t\t// $new_customers_30_days = array();\n\n\t\t// for ($i=0; $i<30; $i++) {\n\t\t// $timestamp = mktime(0, 0, 0, date(\"m\") , date(\"d\") - $i, date(\"Y\"));\n\t\t// $days30[] = date(\"Y-m-d\", $timestamp);;\n\t\t// }\n\t\t// foreach ($new_cust_30_days as $result) {\n\t\t// \t$arr_keys[$result->date_ordered] = $result->count;\n\t\t// }\n\t\t// foreach ($days30 as $day) {\n\t\t// \t(isset($arr_keys[$day])) ? $new_customers_30_days[$day] = $arr_keys[$day] : $new_customers_30_days[$day] = 0;\n\t\t// }\n\n\n\t\t// ============================================================================\n\n\t\t$new_customers_past_months = array();\n\t\t$sql_query = \"SELECT DATE_FORMAT(date_ordered, '%Y-%m') AS date_ordered, \";\n\t\t$sql_query .= \"COUNT(DISTINCT date_ordered) as count \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY DATE_FORMAT(date_ordered, '%Y-%m') \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_past_months = DB::select($sql_query);\n\n\t\t// ============================================================================\n\n\t\t$new_customers_this_month = array();\n\t\t$sql_query = \"SELECT date_ordered, user_email, user_firstname, user_lastname, count(*) AS amount_of_products \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE (date_ordered BETWEEN DATE_FORMAT(NOW() ,'%Y-%m-01') AND NOW() ) \";\n\t\t$sql_query .= \"AND status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY date_ordered \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_this_month = DB::select($sql_query);\n\n// print \"<pre>\";\n// print_R($new_customers_this_month);\n// exit;\n\n\n\t\t// ============================================================================\n\n\t\t$new_customers_last_30_days = array();\n\t\t$sql_query = \"SELECT date_ordered, user_email, user_firstname, user_lastname, count(*) AS amount_of_products \";\n\t\t$sql_query .= \"FROM transactions \";\n\t\t$sql_query .= \"WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_ordered \";\n\t\t$sql_query .= \"AND status != 'cancelled' \";\n\t\t$sql_query .= \"AND status != 'removed' \";\n\t\t$sql_query .= \"GROUP BY date_ordered \";\n\t\t$sql_query .= \"ORDER BY date_ordered DESC \";\n\t\t$new_customers_last_30_days = DB::select($sql_query);\n\n\t\t$pass_variables = array(\n//\t\t\t'new_customers_30_days' => $new_customers_30_days,\n\t\t\t'new_customers_last_30_days' => $new_customers_last_30_days,\n\t\t\t'new_customers_past_months' => $new_customers_past_months,\n\t\t\t'new_customers_this_month' => $new_customers_this_month\n\t\t);\n\t\treturn view('activities_statistics', $pass_variables );\n\t}", "function gettotalpageno(){\n\t $qry = \"SELECT * FROM countries\";\n\t return $result = $this->modelObj->numRows($qry);\n\t}", "public function getTotalNumberOfResults();", "function getTripsAdded(){\n global $mysqli;\n\n $sql = \"SELECT EXTRACT(MONTH from t.date_added) as \\\"month\\\",\n EXTRACT(YEAR from t.date_added) as \\\"year\\\" ,\n count(*) as \\\"count\\\" \n FROM trips t \n group by month, year \n HAVING year = 2020\";\n\n $result = $mysqli->query($sql);\n return $result->fetch_all(MYSQLI_ASSOC);\n}", "public function iN_CurrentMonthTotalSubscriptionEarning() {\n\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS MonthTotalEarnSubscription FROM i_user_subscriptions WHERE status = 'active' AND MONTH(created) = MONTH(CURDATE()) \") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\treturn isset($row['MonthTotalEarnSubscription']) ? $row['MonthTotalEarnSubscription'] : '0.00';\n\t}", "private function region_views_per_day($region='',$date='', $google_filter=FALSE) {\n\t\t$query_1 = \"SELECT views from region_classification_stats,shire_names \n\t\tWHERE region_classification_stats.region_id = shire_names.shirename_id \n\t\tAND region_classification_stats.view_date='$date' AND region_classification_stats.region_id='$region' ORDER BY\n\t\t\t\tshire_names.region_code\";\n\t\t\n\t\t$query_2 =\"SELECT sum(region_classification_stats.views - region_classification_stats.google_views) AS views from region_classification_stats,shire_names \n\t\tWHERE region_classification_stats.region_id = shire_names.shirename_id \n\t\tAND region_classification_stats.view_date='$date' AND region_classification_stats.region_id='$region' ORDER BY\n\t\t\t\tshire_names.region_code\";\n\t\t\n\t\t$query = ($google_filter)?$query_2:$query_1;\n\t\t$rows = $this->MyDB->query($query);\n\t\t\n\t\t$total_views = 0;\n\t\tforeach ($rows as $row) {\n\t\t\t//$class_total = ($google_filter)?$row['views']-$row['google_views']:$row['views'];\n\t\t\t$class_total = $row['views'];\n\t\t\t$total_views += $class_total;\n\t\t}\n\t\treturn $total_views;\n\t}", "public function countMyRepertoire()\n {\n $this->tasteTheCookie();\n\n $cinemaEmail = $_REQUEST[\"cinemaEmail\"];\n $day = $_REQUEST[\"day\"];\n\n $aamdl = new AACinemaModel();\n $results = $aamdl->countMyMovieRepertoire($cinemaEmail, $day);\n\n echo json_encode($results);\n }" ]
[ "0.75373644", "0.69837695", "0.66747797", "0.64431477", "0.6346906", "0.6285946", "0.6237632", "0.62364966", "0.62269473", "0.6174321", "0.61497647", "0.6073582", "0.6042287", "0.59998816", "0.5981906", "0.5961657", "0.59196556", "0.591257", "0.58972836", "0.5888532", "0.5880797", "0.5852929", "0.5838133", "0.5838133", "0.58051604", "0.5780437", "0.57781446", "0.57716614", "0.5768707", "0.57584995", "0.57445276", "0.57443464", "0.574244", "0.57176965", "0.57176965", "0.57176965", "0.5710927", "0.56776255", "0.56732535", "0.5669405", "0.56586075", "0.56434333", "0.5642153", "0.5642153", "0.56306857", "0.56281984", "0.5628111", "0.5627139", "0.5623175", "0.56102693", "0.5607035", "0.5602125", "0.560178", "0.55941904", "0.5559687", "0.5555627", "0.555359", "0.5552917", "0.55439323", "0.55312246", "0.55211", "0.55120176", "0.5499064", "0.54832864", "0.5479373", "0.5478277", "0.5476174", "0.5475043", "0.5465891", "0.54651195", "0.5443904", "0.5437441", "0.54222953", "0.54114664", "0.54028416", "0.540274", "0.53924763", "0.53874564", "0.5380806", "0.5380371", "0.5375683", "0.5375138", "0.5374575", "0.53711087", "0.53703547", "0.534023", "0.5339969", "0.5329786", "0.5328506", "0.5324765", "0.5316413", "0.53138655", "0.53130823", "0.53107226", "0.5307921", "0.5307323", "0.53071934", "0.5302315", "0.52900636", "0.52858394" ]
0.57094455
37